Skip to content

Commit

Permalink
Create a build matrix to support multiple version of React Native and…
Browse files Browse the repository at this point in the history
… OSs (#345)

* Multiple versions of React Native (latest and the version used internally at Wix)
* Multiple versions of Xcode (currently 8.3.3 and 9, 8.3.3 will be dropped soon)
  • Loading branch information
rotemmiz authored Oct 18, 2017
1 parent 110fed2 commit 30eeefd
Show file tree
Hide file tree
Showing 18 changed files with 445 additions and 105 deletions.
81 changes: 61 additions & 20 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,67 @@
language: objective-c
osx_image: xcode8.3
language: node_js
node_js: 8

matrix:
include:
- language: objective-c
os: osx
osx_image: xcode8.3
env:
- REACT_NATIVE_VERSION=0.44.2
install:
- ./scripts/install.ios.sh
script:
- ./scripts/ci.ios.sh
- language: objective-c
os: osx
osx_image: xcode8.3
env:
- REACT_NATIVE_VERSION=0.49.3
install:
- ./scripts/install.ios.sh
script:
- ./scripts/ci.ios.sh
- language: objective-c
os: osx
osx_image: xcode9
env:
- REACT_NATIVE_VERSION=0.44.2
install:
- ./scripts/install.ios.sh
script:
- ./scripts/ci.ios.sh
- language: objective-c
os: osx
osx_image: xcode9
env:
- REACT_NATIVE_VERSION=0.49.3
install:
- ./scripts/install.ios.sh
script:
- ./scripts/ci.ios.sh
- language: android
os: linux
jdk: oraclejdk8
env:
- REACT_NATIVE_VERSION=0.49.3
android:
components:
- build-tools-25.0.3
- android-25
- extra-android-m2repository
- extra-google-google_play_services
- extra-google-m2repository
- sys-img-armeabi-v7a-android-26
install:
- ./scripts/install.android.sh
script:
- ./scripts/ci.android.sh

branches:
only:
- master
env:
global:
- NODE_VERSION=stable
install:
- brew install yarn
- export CODE_SIGNING_REQUIRED=NO
- brew tap wix/brew
- brew install applesimutils --HEAD
- curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.1/install.sh | bash
- export NVM_DIR="$HOME/.nvm" && [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"
- nvm install $NODE_VERSION
- nvm use $NODE_VERSION
- npm install -g [email protected] >/dev/null 2>&1
- npm install -g react-native-cli >/dev/null 2>&1
- npm install -g detox-cli >/dev/null 2>&1
- gem install xcpretty >/dev/null 2>&1
script:
- ./scripts/ci.sh
before_install:
- nvm install stable
notifications:
email: true
slack:
Expand Down
5 changes: 2 additions & 3 deletions detox/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,7 @@
"eslint-plugin-react-native": "^2.3.2",
"jest": "^20.0.4",
"minimist": "^1.2.0",
"mockdate": "^2.0.1",
"shelljs": "^0.7.3",
"ttab": "^0.3.1"
"mockdate": "^2.0.1"
},
"dependencies": {
"child-process-promise": "^2.2.0",
Expand All @@ -55,6 +53,7 @@
"get-port": "^2.1.0",
"lodash": "^4.14.1",
"npmlog": "^4.0.2",
"shell-utils": "^1.0.9",
"telnet-client": "0.15.3",
"ws": "^1.1.1"
},
Expand Down
2 changes: 1 addition & 1 deletion detox/scripts/build_framework.ios.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ echo "###############################"
echo "###############################"
echo "Extracting Detox sources..."

xcodebuild build -project "${detoxSourcePath}"/Detox.xcodeproj -scheme DetoxFramework -configuration Release -derivedDataPath "${detoxFrameworkDirPath}"/DetoxBuild > /dev/null
xcodebuild build -project "${detoxSourcePath}"/Detox.xcodeproj -scheme DetoxFramework -configuration Release -derivedDataPath "${detoxFrameworkDirPath}"/DetoxBuild
mv "${detoxFrameworkDirPath}"/DetoxBuild/Build/Products/Release-universal/Detox.framework "${detoxFrameworkDirPath}"
rm -fr "${detoxFrameworkDirPath}"/DetoxBuild

Expand Down
4 changes: 2 additions & 2 deletions detox/src/devices/IosDriver.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const DeviceDriverBase = require('./DeviceDriverBase');
const InvocationManager = require('../invoke').InvocationManager;
const invoke = require('../invoke');
const GREYConfiguration = require('./../ios/earlgreyapi/GREYConfiguration');
const exec = require('child-process-promise').exec;
const exec = require('shell-utils').exec;
const environment = require('../utils/environment');

class IosDriver extends DeviceDriverBase {
Expand Down Expand Up @@ -40,7 +40,7 @@ class IosDriver extends DeviceDriverBase {
}
} else {
log.info(`Building Detox.framework (${environment.getDetoxVersion()}) into ${detoxFrameworkDirPath}...`);
await exec(path.join(__dirname, `../../scripts/build_framework.ios.sh "${detoxIosSourceTarballDirPath}" "${detoxFrameworkDirPath}"`));
await exec.execAsync(path.join(__dirname, `../../scripts/build_framework.ios.sh "${detoxIosSourceTarballDirPath}" "${detoxFrameworkDirPath}"`));
}
}

Expand Down
2 changes: 1 addition & 1 deletion detox/test/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ dependencies {

testCompile 'junit:junit:4.12'

androidTestCompile(project(path: ":detox", configuration: "oldOkhttpDebug"), {
androidTestCompile(project(path: ":detox", configuration: "newOkhttpDebug"), {
exclude group: 'com.android.support', module: 'support-annotations'
})
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ public List<NativeModule> createNativeModules(ReactApplicationContext reactConte
);
}

@Override
public List<Class<? extends JavaScriptModule>> createJSModules() {
return Collections.emptyList();
}
Expand Down
2 changes: 1 addition & 1 deletion detox/test/e2e/mocha.opts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
--recursive
--timeout 240000
--timeout 480000
--bail
94 changes: 92 additions & 2 deletions detox/test/ios/example.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,48 @@
remoteGlobalIDString = 394767961DBF985400D72256;
remoteInfo = Detox;
};
4644B8641F897583003223D4 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 139D7ECE1E25DB7D00323FB7;
remoteInfo = "third-party";
};
4644B8661F897583003223D4 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 3D383D3C1EBD27B6005632C8;
remoteInfo = "third-party-tvOS";
};
4644B8681F897583003223D4 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 139D7E881E25C6D100323FB7;
remoteInfo = "double-conversion";
};
4644B86A1F897583003223D4 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 3D383D621EBD27B9005632C8;
remoteInfo = "double-conversion-tvOS";
};
4644B86E1F916562003223D4 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 3DBE0D001F3B181A0099AA32;
remoteInfo = fishhook;
};
4644B8701F916562003223D4 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 3DBE0D0D1F3B181C0099AA32;
remoteInfo = "fishhook-tvOS";
};
78C398B81ACF4ADC00677621 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */;
Expand Down Expand Up @@ -412,6 +454,8 @@
children = (
139FDEF41B06529B00C62182 /* libRCTWebSocket.a */,
39A34C4B1E30ED3600BEBB59 /* libRCTWebSocket-tvOS.a */,
4644B86F1F916562003223D4 /* libfishhook.a */,
4644B8711F916562003223D4 /* libfishhook-tvOS.a */,
);
name = Products;
sourceTree = "<group>";
Expand Down Expand Up @@ -445,6 +489,10 @@
39A34C5D1E30ED3600BEBB59 /* libcxxreact.a */,
39A34C5F1E30ED3600BEBB59 /* libjschelpers.a */,
39A34C611E30ED3600BEBB59 /* libjschelpers.a */,
4644B8651F897583003223D4 /* libthird-party.a */,
4644B8671F897583003223D4 /* libthird-party.a */,
4644B8691F897583003223D4 /* libdouble-conversion.a */,
4644B86B1F897583003223D4 /* libdouble-conversion.a */,
);
name = Products;
sourceTree = "<group>";
Expand Down Expand Up @@ -856,6 +904,48 @@
remoteRef = 39B044611DAED76400431EC5 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
4644B8651F897583003223D4 /* libthird-party.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = "libthird-party.a";
remoteRef = 4644B8641F897583003223D4 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
4644B8671F897583003223D4 /* libthird-party.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = "libthird-party.a";
remoteRef = 4644B8661F897583003223D4 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
4644B8691F897583003223D4 /* libdouble-conversion.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = "libdouble-conversion.a";
remoteRef = 4644B8681F897583003223D4 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
4644B86B1F897583003223D4 /* libdouble-conversion.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = "libdouble-conversion.a";
remoteRef = 4644B86A1F897583003223D4 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
4644B86F1F916562003223D4 /* libfishhook.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = libfishhook.a;
remoteRef = 4644B86E1F916562003223D4 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
4644B8711F916562003223D4 /* libfishhook-tvOS.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = "libfishhook-tvOS.a";
remoteRef = 4644B8701F916562003223D4 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
78C398B91ACF4ADC00677621 /* libRCTLinking.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
Expand Down Expand Up @@ -906,7 +996,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "export NODE_BINARY=node\n../node_modules/react-native/packager/react-native-xcode.sh";
shellScript = "export NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh";
};
399B4E001ED587120098D2AC /* Bundle React Native code and images */ = {
isa = PBXShellScriptBuildPhase;
Expand All @@ -920,7 +1010,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "export NODE_BINARY=node\n../node_modules/react-native/packager/react-native-xcode.sh";
shellScript = "export NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh";
};
/* End PBXShellScriptBuildPhase section */

Expand Down
Loading

0 comments on commit 30eeefd

Please sign in to comment.