Skip to content

[GENERAL][BUGFIX][build] - patch v5 build toolchains for XCode10.2 & RN0.59 compatibility #2166

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,20 @@ Also install tests project iOS Pods.

```bash
yarn
cd tests/ && yarn
cd tests/ios && pod install --repo-update
cd tests/ && yarn # see note below for XCode 10.2
cd ios && pod install --repo-update
```

Note: the `cd tests/ && yarn` will fail the first time with XCode 10.2. You must edit `node_modules/detox/ios_src/Detox.xcodeproj/project.pbxproj` and alter the 4 `SWIFT_VERSION = 3.0` entries to be `SWIFT_VERSION = 4.0` So for XCode 10.2 you need this:

```bash
yarn
cd tests/ && yarn # this will fail with partial install of detox
patch -p1 < manual-patches/detox+9.1.2.patch # alter SWIFT_VERSION to 4.0
patch -p1 < manual-patches/detox+9.1.2-no-extract.patch # do not re-extract iOS source
./node_modules/detox/scripts/build_framework.ios.sh # build the patched iOS framework
yarn # Now re-run and the build works
cd ios && pod install --repo-update
```

---
Expand Down
18 changes: 5 additions & 13 deletions tests/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
buildscript {
ext.kotlinVersion = '1.3.31'
ext {
buildToolsVersion = "28.0.3"
compileSdkVersion = 28
}

repositories {
google()
maven {
Expand All @@ -11,7 +15,6 @@ buildscript {
classpath 'com.android.tools.build:gradle:3.4.0'
classpath 'com.google.gms:google-services:4.2.0'
classpath 'com.google.firebase:firebase-plugins:1.1.5'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
classpath 'io.fabric.tools:gradle:1.25.4'
}
}
Expand Down Expand Up @@ -44,17 +47,6 @@ allprojects {
}
}

subprojects {
afterEvaluate {project ->
if (project.hasProperty("android")) {
android {
compileSdkVersion compileSdkVersion
buildToolsVersion "$buildToolsVersion"
}
}
}
}

ext {
buildToolsVersion = "28.0.3"
minSdkVersion = 18
Expand Down
42 changes: 21 additions & 21 deletions tests/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -237,52 +237,52 @@ PODS:
- nanopb/decode (0.3.901)
- nanopb/encode (0.3.901)
- Protobuf (3.7.0)
- React (0.59.8):
- React/Core (= 0.59.8)
- React/Core (0.59.8):
- yoga (= 0.59.8.React)
- React/CxxBridge (0.59.8):
- React (0.59.3):
- React/Core (= 0.59.3)
- React/Core (0.59.3):
- yoga (= 0.59.3.React)
- React/CxxBridge (0.59.3):
- Folly (= 2018.10.22.00)
- React/Core
- React/cxxreact
- React/jsiexecutor
- React/cxxreact (0.59.8):
- React/cxxreact (0.59.3):
- boost-for-react-native (= 1.63.0)
- DoubleConversion
- Folly (= 2018.10.22.00)
- glog
- React/jsinspector
- React/DevSupport (0.59.8):
- React/DevSupport (0.59.3):
- React/Core
- React/RCTWebSocket
- React/fishhook (0.59.8)
- React/jsi (0.59.8):
- React/fishhook (0.59.3)
- React/jsi (0.59.3):
- DoubleConversion
- Folly (= 2018.10.22.00)
- glog
- React/jsiexecutor (0.59.8):
- React/jsiexecutor (0.59.3):
- DoubleConversion
- Folly (= 2018.10.22.00)
- glog
- React/cxxreact
- React/jsi
- React/jsinspector (0.59.8)
- React/RCTAnimation (0.59.8):
- React/jsinspector (0.59.3)
- React/RCTAnimation (0.59.3):
- React/Core
- React/RCTBlob (0.59.8):
- React/RCTBlob (0.59.3):
- React/Core
- React/RCTNetwork (0.59.8):
- React/RCTNetwork (0.59.3):
- React/Core
- React/RCTText (0.59.8):
- React/RCTText (0.59.3):
- React/Core
- React/RCTWebSocket (0.59.8):
- React/RCTWebSocket (0.59.3):
- React/Core
- React/fishhook
- React/RCTBlob
- RNFirebase (5.3.1):
- Firebase/Core
- React
- yoga (0.59.8.React)
- yoga (0.59.3.React)

DEPENDENCIES:
- Crashlytics (~> 3.12.0)
Expand Down Expand Up @@ -402,10 +402,10 @@ SPEC CHECKSUMS:
leveldb-library: 08cba283675b7ed2d99629a4bc5fd052cd2bb6a5
nanopb: 2901f78ea1b7b4015c860c2fdd1ea2fee1a18d48
Protobuf: 7a877b7f3e5964e3fce995e2eb323dbc6831bb5a
React: 1d605e098d69bdf08960787f3446f0a9dc2e2ccf
RNFirebase: 57f6c2adb24355b4e6211e028a8e97e473432245
yoga: 128daf064cacaede0c3bb27424b6b4c71052e6cd
React: b52fdb80565505b7e4592b313a38868f5df51641
RNFirebase: f20e5e4ceaa632aebb1a29a9a91022ae0469c633
yoga: 1a492113f66a35e9e583bb0434f4b8cc668dd839

PODFILE CHECKSUM: 084df7890ac66693a9c12bb079c1824cf2e61dab

COCOAPODS: 1.5.3
COCOAPODS: 1.7.0
4 changes: 2 additions & 2 deletions tests/ios/testing.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1025,7 +1025,7 @@
files = (
);
inputPaths = (
"${SRCROOT}/Pods/Target Support Files/Pods-testing/Pods-testing-resources.sh",
"${PODS_ROOT}/Target Support Files/Pods-testing/Pods-testing-resources.sh",
"${PODS_ROOT}/FirebaseInvites/Resources/GINInviteResources.bundle",
"${PODS_ROOT}/FirebaseInvites/Resources/GPPACLPickerResources.bundle",
"${PODS_ROOT}/GTMOAuth2/Source/Touch/GTMOAuth2ViewTouch.xib",
Expand All @@ -1042,7 +1042,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-testing/Pods-testing-resources.sh\"\n";
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-testing/Pods-testing-resources.sh\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
Expand Down
11 changes: 11 additions & 0 deletions tests/manual-patches/detox+9.1.2-no-extract.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- a/node_modules/detox/scripts/build_framework.ios.sh 2019-05-25 16:36:22.000000000 -0500
+++ b/node_modules/detox/scripts/build_framework.ios.sh 2019-05-25 16:36:48.000000000 -0500
@@ -18,7 +18,7 @@
buildFramework "${detoxSourcePath}"
else
detoxSourcePath="${detoxRootPath}"/ios_src
- extractSources "${detoxSourcePath}"
+ #extractSources "${detoxSourcePath}"
buildFramework "${detoxSourcePath}"
rm -fr "${detoxSourcePath}"
fi
30 changes: 30 additions & 0 deletions tests/manual-patches/detox+9.1.2.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
diff --git a/node_modules/detox/ios_src/Detox.xcodeproj/project.pbxproj b/node_modules/detox/ios_src/Detox.xcodeproj/project.pbxproj
index 396b2f9ac..cb78c68f9 100644
--- a/node_modules/detox/ios_src/Detox.xcodeproj/project.pbxproj
+++ b/node_modules/detox/ios_src/Detox.xcodeproj/project.pbxproj
@@ -560,6 +560,7 @@
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
+ English,
en,
);
mainGroup = 3947678D1DBF985400D72256;
@@ -909,7 +910,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
- SWIFT_VERSION = 3.0;
+ SWIFT_VERSION = 4.2;
};
name = Debug;
};
@@ -939,7 +940,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.wix.Detox;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
- SWIFT_VERSION = 3.0;
+ SWIFT_VERSION = 4.2;
};
name = Release;
};
29 changes: 16 additions & 13 deletions tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,28 +17,31 @@
"test-ios-reuse": "detox test --configuration ios.sim.debug --reuse --loglevel warn",
"test-ios-cover": "nyc detox test --configuration ios.sim.debug",
"test-ios-cover-reuse": "nyc detox test --configuration ios.sim.debug --reuse --loglevel warn",
"ios:pod:install": "cd ios && rm -rf ReactNativeFirebaseDemo.xcworkspace && pod install && cd .."
"ios:pod:install": "cd ios && rm -rf ReactNativeFirebaseDemo.xcworkspace && pod install && cd ..",
"postinstall": "patch-package"
},
"dependencies": {
"detox": "12.5.0",
"@invertase/tests-firebase-functions": "^0.0.1",
"detox": "^9.0.4",
"fbjs": "^0.8.16",
"firebase-admin": "^5.12.0",
"jet": "^0.4.0",
"jet": "https://github.com/mikehardy/jet.git#v0.3.0-dev",
"jsonwebtoken": "^8.2.1",
"mocha": "^6.0.2",
"prop-types": "^15.7.2",
"react": "16.8.1",
"react-native": "0.59.8",
"mocha": "^5.2.0",
"patch-package": "^6.1.2",
"postinstall-postinstall": "^2.0.0",
"prop-types": "^15.6.1",
"react": "16.8.3",
"react-native": "0.59.3",
"should": "^13.2.1",
"should-sinon": "0.0.6",
"sinon": "^6.2.0",
"@invertase/tests-firebase-functions": "^0.0.1"
"sinon": "^6.2.0"
},
"devDependencies": {
"@babel/plugin-transform-runtime": "^7.0.0",
"@react-native-firebase/private-tests-helpers": "^0.0.9",
"@react-native-firebase/private-tests-firebase-functions": "^0.0.1",
"@babel/runtime": "^7.0.0",
"@react-native-firebase/private-tests-firebase-functions": "^0.0.1",
"@react-native-firebase/private-tests-helpers": "^0.0.9",
"babel-eslint": "^9.0.0",
"babel-plugin-istanbul": "^5.1.0",
"babel-plugin-module-resolver": "^3.1.1",
Expand All @@ -48,8 +51,8 @@
"eslint-plugin-import": "^2.11.0",
"eslint-plugin-jsx-a11y": "^6.0.3",
"eslint-plugin-react": "^7.7.0",
"flow-bin": "^0.78.0",
"nyc": "^13.3.0",
"flow-bin": "^0.98.1",
"nyc": "^13.1.0",
"rimraf": "^2.6.2"
},
"nyc": {
Expand Down
42 changes: 42 additions & 0 deletions tests/patches/detox+9.1.2.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
diff --git a/node_modules/detox/android/detox/build.gradle b/node_modules/detox/android/detox/build.gradle
index 1e7358b..ac405e0 100644
--- a/node_modules/detox/android/detox/build.gradle
+++ b/node_modules/detox/android/detox/build.gradle
@@ -19,10 +19,10 @@ android {

productFlavors {
flavorDimensions "minReactNative"
- minReactNative44 {
- dimension "minReactNative"
+ //minReactNative44 {
+ // dimension "minReactNative"

- }
+ //}
minReactNative46 {
dimension "minReactNative"
}
@@ -61,14 +61,19 @@ android {
lintOptions {
abortOnError false
}
+
+ configurations.all {
+ resolutionStrategy.force 'com.google.code.findbugs:jsr305:3.0.2'
+ resolutionStrategy.force 'com.android.support:support-annotations:28.0.0'
+ }
}

dependencies {
- minReactNative44Implementation 'com.squareup.okhttp3:okhttp:3.4.1'
- minReactNative44Implementation 'com.squareup.okhttp3:okhttp-ws:3.4.1'
+ //minReactNative44Implementation 'com.squareup.okhttp3:okhttp:3.4.1'
+ //minReactNative44Implementation 'com.squareup.okhttp3:okhttp-ws:3.4.1'

- minReactNative46Implementation 'com.squareup.okhttp3:okhttp:3.6.0'
- minReactNative46Implementation 'com.squareup.okio:okio:1.13.0'
+ minReactNative46Implementation 'com.squareup.okhttp3:okhttp:3.12.1'
+ minReactNative46Implementation 'com.squareup.okio:okio:1.15.0'

implementation('com.android.support.test.espresso:espresso-core:3.0.2', {
exclude group: 'com.google.code.findbugs'
Loading