Skip to content

Commit

Permalink
chore: support Apple Silicon builds (#165)
Browse files Browse the repository at this point in the history
  • Loading branch information
edeckers committed Sep 20, 2021
1 parent e310914 commit 0a89dfe
Show file tree
Hide file tree
Showing 7 changed files with 503 additions and 312 deletions.
18 changes: 12 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on: push

env:
node-version: 12
android-api-level: 30
android-api-level: 31

jobs:
build-typescript-linux:
Expand All @@ -21,7 +21,7 @@ jobs:
- run: TARGET=typescript make clean build
if: steps.node_modules.outputs.cache-hit != 'true'
build-typescript-macos:
runs-on: self-hosted
runs-on: m1
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
Expand Down Expand Up @@ -107,7 +107,7 @@ jobs:
run-android-instrumented-tests:
needs: run-android-lint
continue-on-error: true
runs-on: self-hosted
runs-on: m1
steps:
- uses: actions/checkout@v2
- name: set up JDK 1.8
Expand All @@ -119,13 +119,19 @@ jobs:
with:
path: node_modules
key: yarn-${{ hashFiles('**/yarn.lock') }}
- uses: reactivecircus/android-emulator-runner@v2.13.0
- uses: reactivecircus/android-emulator-runner@v2.20.0
env:
ANDROID_SDK_ROOT: ${{ secrets.ANDROID_SDK_ROOT }}
ORG_GRADLE_PROJECT_ADB_COMMAND_TIMEOUT_MILLISECONDS: ${{ secrets.ORG_GRADLE_PROJECT_ADB_COMMAND_TIMEOUT_MILLISECONDS }}
ORG_GRADLE_PROJECT_PROMISE_TIMEOUT_MILLISECONDS: ${{ secrets.ORG_GRADLE_PROJECT_PROMISE_TIMEOUT_MILLISECONDS }}
TARGET: android:instrumented
with:
api-level: ${{ env.android-api-level }}
arch: arm64-v8a
avd-name: ${{ secrets.ANDROID_AVD_NAME }}
emulator-options: -no-snapshot -noaudio -no-boot-anim
force-avd-creation: false
ram-size: ${{ secrets.ANDROID_AVD_RAM_SIZE }}
script: |
adb logcat -c
adb logcat | tee android_instrumented_logcat.log | grep 'io.deckers.blob_courier' &
Expand All @@ -145,7 +151,7 @@ jobs:
needs:
- build-typescript-linux
- build-typescript-macos
runs-on: self-hosted
runs-on: m1
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
Expand All @@ -156,7 +162,7 @@ jobs:
- run: TARGET=ios make lint
run-ios-tests:
needs: run-ios-lint
runs-on: self-hosted
runs-on: m1
steps:
- uses: actions/checkout@v2
- run: xcrun simctl boot "iPhone 11" || true
Expand Down
20 changes: 18 additions & 2 deletions example/ios/BlobCourierExample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,10 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
LIBRARY_SEARCH_PATHS = (
"$(SDKROOT)/usr/lib/swift",
"$(inherited)",
);
OTHER_LDFLAGS = (
"-ObjC",
"-lc++",
Expand All @@ -462,6 +466,10 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
LIBRARY_SEARCH_PATHS = (
"$(SDKROOT)/usr/lib/swift",
"$(inherited)",
);
OTHER_LDFLAGS = (
"-ObjC",
"-lc++",
Expand All @@ -486,6 +494,10 @@
"$(inherited)",
"@executable_path/Frameworks",
);
LIBRARY_SEARCH_PATHS = (
"$(SDKROOT)/usr/lib/swift",
"$(inherited)",
);
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
Expand All @@ -511,6 +523,10 @@
"$(inherited)",
"@executable_path/Frameworks",
);
LIBRARY_SEARCH_PATHS = (
"$(SDKROOT)/usr/lib/swift",
"$(inherited)",
);
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
Expand Down Expand Up @@ -556,7 +572,7 @@
COPY_PHASE_STRIP = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "arm64 ";
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "";
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
Expand Down Expand Up @@ -621,7 +637,7 @@
COPY_PHASE_STRIP = YES;
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "arm64 ";
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "";
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
Expand Down
11 changes: 10 additions & 1 deletion example/ios/Podfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

platform :ios, '10.0'
platform :ios, '11.0'

target 'BlobCourierExample' do
config = use_native_modules!
Expand All @@ -26,6 +26,15 @@ target 'BlobCourierExample' do
use_flipper!()

post_install do |installer|
installer.aggregate_targets.each do |aggregate_target|
aggregate_target.user_project.native_targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['LIBRARY_SEARCH_PATHS'] = ['$(SDKROOT)/usr/lib/swift', '$(inherited)']
end
end
aggregate_target.user_project.save
end

react_native_post_install(installer)
end
end
Loading

0 comments on commit 0a89dfe

Please sign in to comment.