Skip to content

Commit

Permalink
Merge pull request #1209 from wix/rn46-min-ver
Browse files Browse the repository at this point in the history
(Android) Make RN .46 the new minimal version (i.e. stop support for 44, .45)
  • Loading branch information
d4vidi authored Mar 18, 2019
2 parents e7cbb69 + aaafe4c commit e4b9f50
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 223 deletions.
18 changes: 2 additions & 16 deletions detox/android/detox/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,6 @@ android {
versionName "1.0"
}

productFlavors {
flavorDimensions "minReactNative"
minReactNative44 {
dimension "minReactNative"

}
minReactNative46 {
dimension "minReactNative"
}
}

testOptions {
unitTests.returnDefaultValues = true

Expand Down Expand Up @@ -69,11 +58,8 @@ android {
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$_kotlinVersion"

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'
implementation 'com.squareup.okhttp3:okhttp:3.6.0'
implementation 'com.squareup.okio:okio:1.13.0'

// Versions are in-sync with the 'androidx-test-1.1.0' release/tag of the android-test github repo,
// used by the Detox generator. See https://github.com/android/android-test/releases/tag/androidx-test-1.1.0
Expand Down

This file was deleted.

6 changes: 2 additions & 4 deletions detox/scripts/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@ if (process.platform === 'darwin') {
if (process.argv[2] === "android" || process.argv[3] === "android") {
console.log("\nBuilding Detox aars");
const aars = [
"detox-minReactNative44-debug.aar",
"detox-minReactNative46-debug.aar",
"detox-minReactNative44-release.aar",
"detox-minReactNative46-release.aar"
"detox-debug.aar",
"detox-release.aar"
];
aars.forEach(aar => {
fs.removeSync(aar);
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 @@ -16,7 +16,7 @@ android {
}
testBuildType System.getProperty('testBuildType', 'debug')
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
missingDimensionStrategy "minReactNative", "minReactNative46"

/*
testInstrumentationRunnerArguments = [
'detoxServer': 'ws://localhost:8099',
Expand Down
15 changes: 14 additions & 1 deletion docs/Guide.Migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,19 @@ title: Migration Guide

We are improving detox API as we go along, sometimes these changes require us to break the API in order for it to make more sense. These migration guides refer to breaking changes.

## Migrating from Detox 11.0.0 to 11.0.1 (nonbreaking)

**React Native versions older than 0.46 are no longer supported**, so the `missingDimentsionStrategy` can be removed from `android/app/build.gradle`:

```diff
android {
defaultConfig {
// ...
- missingDimensionStrategy "minReactNative", "minReactNative46"
}
}
```



## Migrating from Detox 10.x.x to 11.x.x
Expand All @@ -16,7 +29,7 @@ We are improving detox API as we go along, sometimes these changes require us to
```diff
android {
defaultConfig {
// ...
// ...
- testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
+ testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
Expand Down
8 changes: 1 addition & 7 deletions docs/Introduction.Android.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,13 @@ In `android/app/build.gradle` add this to `defaultConfig` section:
defaultConfig {
...
testBuildType System.getProperty('testBuildType', 'debug') //this will later be used to control the test apk build type
missingDimensionStrategy "minReactNative", "minReactNative46" //read note
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
...
}
```
Please be aware that the `minSdkVersion` needs to be at least 18.

> ###### Choosing the right build type (in missingDimensionStrategy)
>Detox runs on multiple React Native versions, choose the correct build type to support the version you use.<br>
>**Available versions:**
>
>* `minReactNative44`: Support for React Native 0.44-0.45
>* `minReactNative46`: Support for React Native 0.46+



In `android/app/build.gradle` add this in `dependencies` section:
Expand Down
1 change: 0 additions & 1 deletion examples/demo-react-native/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ android {

testBuildType System.getProperty('testBuildType', 'debug')
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
missingDimensionStrategy "minReactNative", "minReactNative46"
}
splits {
abi {
Expand Down

0 comments on commit e4b9f50

Please sign in to comment.