Skip to content

Commit

Permalink
Merge pull request #11 from detroit-labs/add-apple-silicon-support
Browse files Browse the repository at this point in the history
Add Apple silicon support
  • Loading branch information
nwdl committed Jan 12, 2021
2 parents 03e9d74 + 620763d commit 18fdd7a
Show file tree
Hide file tree
Showing 14 changed files with 50 additions and 10 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -1,3 +1,4 @@
DerivedData/
xcuserdata/
build
.build
Expand Down
1 change: 1 addition & 0 deletions .version
@@ -0,0 +1 @@
1.10.0
6 changes: 6 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,11 @@
# Orchard Change Log

## [1.10.0](https://github.com/Detroit-Labs/Orchard/releases/tag/1.10.0)
**Released:** 2021-01-12

### Added
- Support for Apple Silicon

## [1.9.0](https://github.com/Detroit-Labs/Orchard/releases/tag/1.9.0)
**Released:** 2021-01-08

Expand Down
31 changes: 31 additions & 0 deletions Makefile
@@ -0,0 +1,31 @@
VERSION_FILE=.version
VERSION_STRING=$(shell cat "$(VERSION_FILE)")

.PHONY: get-version set-version git-tag pod-publish publish

get-version:
@echo $(VERSION_STRING)

set-version:
$(eval NEW_VERSION := $(filter-out $@,$(MAKECMDGOALS)))
@echo "$(NEW_VERSION)" > "$(VERSION_FILE)"
@sed -i '' '/^[[:blank:]]*spec.version/ s/'\"'[^'\"'][^'\"']*'\"'/'\"'$(NEW_VERSION)'\"'/' Orchard.podspec
@sed -i '' '/^[[:blank:]]*MARKETING_VERSION/ s/= [^;]*;/= $(NEW_VERSION);/' Orchard.xcodeproj/project.pbxproj
$(eval CHANGELOG_URL := "\#\# \[$(NEW_VERSION)\]\(https:\/\/github.com\/Detroit-Labs\/Orchard\/releases\/tag\/$(NEW_VERSION)\)")
$(eval CHANGELOG_DATE := "\*\*Released:\*\* `date +"%Y-%m-%d"`")
@sed -i '' '3s/^/'$(CHANGELOG_URL)'\n'$(CHANGELOG_DATE)'\n\n/' CHANGELOG.md

git-tag:
ifneq ($(strip $(shell git status --untracked-files=no --porcelain 2>/dev/null)),)
$(error git state is not clean)
endif
git tag -a "$(VERSION_STRING)" -m "$(VERSION_STRING)"
git push origin "$(VERSION_STRING)"

pod-publish:
pod trunk push Orchard.podspec

publish: pod-publish

%:
@:
2 changes: 1 addition & 1 deletion Orchard-ObjC/iOS/OrchardiOSDevice.m
Expand Up @@ -21,7 +21,7 @@ OrchardiOSDevice OrchardiOSDeviceFromNSString(NSString * _Nonnull string) {
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
#pragma clang diagnostic ignored "-Wunguarded-availability"

if ([string orchard_isEqualToOneOfStrings:@[@"i386", @"x86_64"]]) {
if ([string orchard_isEqualToOneOfStrings:@[@"arm64", @"i386", @"x86_64"]]) {
return OrchardiOSDeviceSimulator;
}

Expand Down
2 changes: 1 addition & 1 deletion Orchard-ObjC/iOS/OrchardiOSDevice.m.gyb
Expand Up @@ -22,7 +22,7 @@ OrchardiOSDevice OrchardiOSDeviceFromNSString(NSString * _Nonnull string) {
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
#pragma clang diagnostic ignored "-Wunguarded-availability"

if ([string orchard_isEqualToOneOfStrings:@[@"i386", @"x86_64"]]) {
if ([string orchard_isEqualToOneOfStrings:@[@"arm64", @"i386", @"x86_64"]]) {
return OrchardiOSDeviceSimulator;
}

Expand Down
2 changes: 1 addition & 1 deletion Orchard-ObjC/tvOS/OrchardtvOSDevice.m
Expand Up @@ -15,7 +15,7 @@
#import "OrchardDeviceIdentification.h"

OrchardtvOSDevice OrchardtvOSDeviceFromNSString(NSString *string) {
if ([string orchard_isEqualToOneOfStrings:@[@"i386", @"x86_64"]]) {
if ([string orchard_isEqualToOneOfStrings:@[@"arm64", @"i386", @"x86_64"]]) {
return OrchardtvOSDeviceSimulator;
}
else if ([string isEqualToString:@"AppleTV5,3"]) {
Expand Down
2 changes: 1 addition & 1 deletion Orchard-ObjC/tvOS/OrchardtvOSDevice.m.gyb
Expand Up @@ -16,7 +16,7 @@
#import "OrchardDeviceIdentification.h"

OrchardtvOSDevice OrchardtvOSDeviceFromNSString(NSString *string) {
if ([string orchard_isEqualToOneOfStrings:@[@"i386", @"x86_64"]]) {
if ([string orchard_isEqualToOneOfStrings:@[@"arm64", @"i386", @"x86_64"]]) {
return OrchardtvOSDeviceSimulator;
}
% import sys
Expand Down
2 changes: 1 addition & 1 deletion Orchard-ObjC/watchOS/OrchardwatchOSDevice.m
Expand Up @@ -17,7 +17,7 @@
#import "OrchardDeviceIdentification.h"

OrchardwatchOSDevice OrchardwatchOSDeviceFromNSString(NSString *string) {
if ([string orchard_isEqualToOneOfStrings:@[@"i386", @"x86_64"]]) {
if ([string orchard_isEqualToOneOfStrings:@[@"arm64", @"i386", @"x86_64"]]) {
return OrchardwatchOSDeviceSimulator;
}
else if ([string isEqualToString:@"Watch1,1"]) {
Expand Down
2 changes: 1 addition & 1 deletion Orchard-ObjC/watchOS/OrchardwatchOSDevice.m.gyb
Expand Up @@ -18,7 +18,7 @@
#import "OrchardDeviceIdentification.h"

OrchardwatchOSDevice OrchardwatchOSDeviceFromNSString(NSString *string) {
if ([string orchard_isEqualToOneOfStrings:@[@"i386", @"x86_64"]]) {
if ([string orchard_isEqualToOneOfStrings:@[@"arm64", @"i386", @"x86_64"]]) {
return OrchardwatchOSDeviceSimulator;
}
% import sys
Expand Down
2 changes: 1 addition & 1 deletion Orchard-Swift/DeviceIdentification.swift
Expand Up @@ -81,7 +81,7 @@ internal func parseDeviceIdentity(from modelString: String) -> DeviceIdentity {
}
#endif

if modelString == "i386" || modelString == "x86_64" {
if ["arm64", "i386", "x86_64"].contains(modelString) {
return .simulator
}

Expand Down
2 changes: 1 addition & 1 deletion Orchard.podspec
@@ -1,7 +1,7 @@
Pod::Spec.new do |spec|

spec.name = "Orchard"
spec.version = "1.9.0"
spec.version = "1.10.0"
spec.summary = "Device identification for iOS, watchOS, and tvOS."

spec.description = <<-DESC
Expand Down
4 changes: 2 additions & 2 deletions Orchard.xcodeproj/project.pbxproj
Expand Up @@ -575,7 +575,7 @@
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MARKETING_VERSION = 1.9.0;
MARKETING_VERSION = 1.10.0;
ONLY_ACTIVE_ARCH = YES;
RUN_CLANG_STATIC_ANALYZER = YES;
SUPPORTED_PLATFORMS = "iphonesimulator iphoneos watchsimulator watchos appletvsimulator appletvos";
Expand Down Expand Up @@ -617,7 +617,7 @@
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MARKETING_VERSION = 1.9.0;
MARKETING_VERSION = 1.10.0;
RUN_CLANG_STATIC_ANALYZER = YES;
SUPPORTED_PLATFORMS = "iphonesimulator iphoneos watchsimulator watchos appletvsimulator appletvos";
SWIFT_COMPILATION_MODE = wholemodule;
Expand Down
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -82,6 +82,7 @@ Orchard can be installed using CocoaPods. There are two subspecs, `Swift` and
`ObjC`, so use either of these lines in your `Podfile`:

`pod "Orchard/ObjC"`

`pod "Orchard/Swift"`

#### Swift Package Manager
Expand Down

0 comments on commit 18fdd7a

Please sign in to comment.