Skip to content

Commit

Permalink
fix(detox): change detox to compiling dependency to fix android with …
Browse files Browse the repository at this point in the history
…react native 0.68 (#10701)
  • Loading branch information
xiongemi committed Jun 13, 2022
1 parent cce43db commit e00dc75
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
Expand Up @@ -147,6 +147,7 @@ android {
<% if (e2eTestRunner === 'detox') { %>
testBuildType System.getProperty('testBuildType', 'debug') // This will later be used to control the test apk build type
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
missingDimensionStrategy 'detox', 'full'
<% } %>

if (isNewArchitectureEnabled()) {
Expand Down Expand Up @@ -302,7 +303,7 @@ dependencies {
}

<% if (e2eTestRunner === 'detox') { %>
androidTestImplementation('com.wix:detox:+')
androidTestImplementation(project(path: ":detox"))
<% } %>
}

Expand Down
Expand Up @@ -8,6 +8,9 @@ buildscript {
minSdkVersion = 21
compileSdkVersion = 31
targetSdkVersion = 31
<% if (e2eTestRunner === 'detox') { %>
kotlinVersion = '1.6.21'
<% } %>

if (System.properties['os.arch'] == "aarch64") {
// For M1 Users we need to use the NDK 24 which added support for aarch64
Expand All @@ -25,6 +28,9 @@ buildscript {
classpath("com.android.tools.build:gradle:7.0.4")
classpath("com.facebook.react:react-native-gradle-plugin")
classpath("de.undercouch:gradle-download-task:4.1.2")
<% if (e2eTestRunner === 'detox') { %>
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
<% } %>
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
Expand All @@ -49,12 +55,5 @@ allprojects {
}
google()
maven { url 'https://www.jitpack.io' }

<% if (e2eTestRunner === 'detox') { %>
maven {
// All of Detox' artifacts are provided via the npm module
url "$rootDir/../node_modules/detox/Detox-android"
}
<% } %>
}
}
Expand Up @@ -3,6 +3,11 @@ rootProject.name = '<%= className %>'
include ':react-native-config'
project(':react-native-config').projectDir = new File(rootProject.projectDir, '../../../node_modules/react-native-config/android')

<% if (e2eTestRunner === 'detox') { %>
include ':detox'
project(':detox').projectDir = new File(rootProject.projectDir, '../node_modules/detox/android/detox')
<% } %>

apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle");
applyNativeModulesSettingsGradle(settings)

Expand Down

0 comments on commit e00dc75

Please sign in to comment.