Skip to content

Commit 1b5bf98

Browse files
authored
Bintray sunset (wix#2752)
1 parent 35d8387 commit 1b5bf98

File tree

9 files changed

+126
-20
lines changed

9 files changed

+126
-20
lines changed

detox/android/build.gradle

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,25 @@ buildscript {
1111
ext.detoxKotlinVersion = ext.kotlinVersion
1212

1313
repositories {
14-
jcenter()
14+
mavenCentral()
1515
google()
1616
}
1717
dependencies {
1818
classpath 'com.android.tools.build:gradle:3.5.3'
1919
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
2020
classpath "org.jetbrains.dokka:dokka-gradle-plugin:$dokkaVersion"
2121

22-
// Needed by Spek (https://spekframework.org/setup-android)
23-
classpath 'de.mannodermaus.gradle.plugins:android-junit5:1.4.2.1'
22+
if (!rootProject.hasProperty('suppressUnitTests')) {
23+
// Needed by Spek (https://spekframework.org/setup-android)
24+
classpath 'de.mannodermaus.gradle.plugins:android-junit5:1.7.1.1'
25+
}
2426
}
2527
}
2628

2729
allprojects {
2830
repositories {
2931
mavenLocal()
30-
jcenter()
32+
mavenCentral()
3133
google()
3234
maven {
3335
url "$projectDir/../../node_modules/react-native/android"

detox/android/detox/build.gradle

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,21 @@ android {
7777
dependencies {
7878
implementation "org.jetbrains.kotlin:$_kotlinStdlib:$_kotlinVersion"
7979

80+
/*
81+
BINTRAY_SUNSET_HACK start
82+
83+
Should be:
84+
compileOnly 'com.facebook.react:react-native:+'
85+
*/
86+
compileOnly 'com.facebook.fbjni:fbjni-java-only:0.0.4'
8087
// noinspection GradleDynamicVersion
81-
compileOnly 'com.facebook.react:react-native:+'
88+
compileOnly('com.facebook.react:react-native:+') {
89+
exclude group: 'com.facebook.fbjni', module: 'fbjni-java-only'
90+
exclude group: 'com.facebook.yoga', module: 'proguard-annotations'
91+
}
92+
/*
93+
BINTRAY_SUNSET_HACK end
94+
*/
8295
}
8396

8497
// androidx.test deps.
@@ -110,8 +123,21 @@ dependencies {
110123

111124
// Unit-testing deps.
112125
dependencies {
126+
/*
127+
BINTRAY_SUNSET_HACK start
128+
Should be:
129+
testImplementation 'com.facebook.react:react-native:+'
130+
*/
131+
testImplementation 'com.facebook.fbjni:fbjni-java-only:0.0.4'
113132
// noinspection GradleDynamicVersion
114-
testImplementation 'com.facebook.react:react-native:+'
133+
testImplementation('com.facebook.react:react-native:+') {
134+
exclude group: 'com.facebook.fbjni', module: 'fbjni-java-only'
135+
exclude group: 'com.facebook.yoga', module: 'proguard-annotations'
136+
}
137+
/*
138+
BINTRAY_SUNSET_HACK end
139+
*/
140+
115141
testImplementation 'org.json:json:20140107'
116142

117143
// https://github.com/spekframework/spek/issues/232#issuecomment-610732158
@@ -126,8 +152,9 @@ dependencies {
126152
}
127153

128154
// Spek (https://spekframework.org/setup-android)
129-
if (rootProject.hasProperty('isOfficialDetoxLib') ||
130-
rootProject.hasProperty('isOfficialDetoxApp')) {
155+
if (!rootProject.hasProperty('suppressUnitTests') &&
156+
(rootProject.hasProperty('isOfficialDetoxLib') ||
157+
rootProject.hasProperty('isOfficialDetoxApp'))) {
131158
apply plugin: 'de.mannodermaus.android-junit5'
132159

133160
android {

detox/test/android/app/build.gradle

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,23 @@ dependencies {
8989
}
9090

9191
fromSourceImplementation(project(path: ':ReactAndroid'))
92+
93+
/*
94+
BINTRAY_SUNSET_HACK start
95+
(Section shouldn't be needed at all)
96+
*/
97+
if (rnInfo.isRN60OrHigher) { // Comes from elsewhere, otherwise
98+
implementation 'com.facebook.fbjni:fbjni-java-only:0.0.4'
99+
}
92100
// noinspection GradleDynamicVersion
93-
fromBinImplementation 'com.facebook.react:react-native:+'
101+
fromBinImplementation('com.facebook.react:react-native:+') {
102+
exclude group: 'com.facebook.fbjni', module: 'fbjni-java-only'
103+
exclude group: 'com.facebook.yoga', module: 'proguard-annotations'
104+
}
105+
/*
106+
BINTRAY_SUNSET_HACK end
107+
*/
108+
94109
// noinspection GradleDynamicVersion
95110
implementation(project(path: ':AsyncStorage'))
96111

detox/test/android/build.gradle

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,38 +11,55 @@ buildscript {
1111
compileSdkVersion = 29
1212
targetSdkVersion = 29
1313
minSdkVersion = 18
14+
15+
if (!rnInfo.isRN62OrHigher) {
16+
suppressUnitTests = true
17+
}
1418
}
1519
ext.detoxKotlinVersion = ext.kotlinVersion
1620

1721
repositories {
1822
google()
1923
mavenLocal()
20-
jcenter()
24+
mavenCentral()
2125
}
2226

2327
dependencies {
2428
classpath "com.android.tools.build:gradle:$androidGradlePluginVersion"
2529
classpath 'de.undercouch:gradle-download-task:4.0.2'
2630
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
2731

28-
// Needed by Spek (https://spekframework.org/setup-android)
29-
// Here in order to enable unit-tests run from Android Studio when working on the test app.
30-
classpath 'de.mannodermaus.gradle.plugins:android-junit5:1.4.2.1'
32+
if (!rootProject.hasProperty('suppressUnitTests')) {
33+
// Needed by Spek (https://spekframework.org/setup-android)
34+
// Here in order to enable unit-tests run from Android Studio when working on the test app.
35+
classpath 'de.mannodermaus.gradle.plugins:android-junit5:1.7.1.1'
36+
}
3137
}
3238
}
3339

3440
allprojects {
3541
repositories {
3642
google()
3743
mavenLocal()
38-
jcenter()
44+
mavenCentral()
3945
maven {
4046
url "$projectDir/../../node_modules/react-native/android"
4147
}
4248
maven {
4349
// Android JSC is installed from npm
4450
url("$rootDir/../node_modules/jsc-android/dist")
4551
}
52+
53+
/*
54+
BINTRAY_SUNSET_HACK start
55+
(Section shouldn't be needed at all)
56+
*/
57+
flatDir {
58+
dirs "$rootProject.projectDir/libs"
59+
}
60+
/*
61+
BINTRAY_SUNSET_HACK end
62+
*/
4663
}
4764
}
4865

Binary file not shown.

examples/demo-react-native/android/app/build.gradle

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,26 @@ dependencies {
6767
implementation 'com.android.support:appcompat-v7:28.0.0'
6868
}
6969

70+
/*
71+
BINTRAY_SUNSET_HACK start
72+
Should be:
73+
implementation 'com.facebook.react:react-native:+'
74+
*/
75+
implementation('com.facebook.fbjni:fbjni-java-only:0.0.4')
76+
7077
// noinspection GradleDynamicVersion
71-
implementation 'com.facebook.react:react-native:+'
78+
implementation('com.facebook.react:react-native:+') {
79+
exclude group: 'com.facebook.fbjni', module: 'fbjni-java-only'
80+
exclude group: 'com.facebook.yoga', module: 'proguard-annotations'
81+
}
82+
/*
83+
BINTRAY_SUNSET_HACK end
84+
*/
85+
7286
// noinspection GradleDynamicVersion
7387
implementation(project(path: ':AsyncStorage')) // Note: not required unless effectively used by your app
7488

89+
// noinspection GradleDynamicVersion
7590
androidTestImplementation('com.wix:detox:+')
7691
}
7792

examples/demo-react-native/android/build.gradle

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,10 @@ buildscript {
1313
}
1414

1515
repositories {
16-
jcenter()
16+
mavenCentral()
1717
google()
1818
}
19+
1920
dependencies {
2021
classpath "com.android.tools.build:gradle:$androidGradlePluginVersion"
2122
classpath 'de.undercouch:gradle-download-task:4.0.2'
@@ -26,7 +27,7 @@ buildscript {
2627
allprojects {
2728
repositories {
2829
mavenLocal()
29-
jcenter()
30+
mavenCentral()
3031
google()
3132
maven {
3233
url "$rootDir/../node_modules/react-native/android"
@@ -38,5 +39,30 @@ allprojects {
3839
// Android JSC is installed from npm
3940
url("$rootDir/../node_modules/jsc-android/dist")
4041
}
42+
/*
43+
BINTRAY_SUNSET_HACK start
44+
(Section shouldn't be needed at all)
45+
*/
46+
flatDir {
47+
dirs "$rootProject.projectDir/libs"
48+
}
49+
/*
50+
BINTRAY_SUNSET_HACK end
51+
*/
52+
}
53+
}
54+
55+
/*
56+
BINTRAY_SUNSET_HACK start
57+
(Shouldn't be here)
58+
*/
59+
subprojects {
60+
configurations.all {
61+
resolutionStrategy {
62+
force 'com.facebook.fbjni:fbjni-java-only:0.0.4'
63+
}
4164
}
4265
}
66+
/*
67+
BINTRAY_SUNSET_HACK end
68+
*/
Binary file not shown.

scripts/ci.android.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,13 @@ pushd detox/test
99
run_f "npm run integration"
1010
popd
1111

12-
pushd detox/android
13-
run_f "./gradlew testFullRelease"
14-
popd
12+
if [[ -z ${SKIP_UNIT_TESTS} ]]; then
13+
pushd detox/android
14+
run_f "./gradlew testFullRelease"
15+
popd
16+
else
17+
echo "SKIP_UNIT_TESTS is set: Skipping Android unit tests"
18+
fi
1519

1620
mkdir -p coverage
1721

0 commit comments

Comments
 (0)