Skip to content

Commit a3d73b6

Browse files
gnpricechrisbobbe
authored andcommitted
android build [nfc]: Organize dependencies a bit
This makes it a bit cleaner for going on to add another dependency. It should also slightly simplify future RN upgrades.
1 parent c8af6d6 commit a3d73b6

File tree

1 file changed

+26
-12
lines changed

1 file changed

+26
-12
lines changed

android/app/build.gradle

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -194,14 +194,24 @@ repositories {
194194
}
195195

196196
dependencies {
197-
implementation fileTree(dir: "libs", include: ["*.jar"])
198197
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
198+
199199
implementation "androidx.core:core-ktx:1.7.0"
200200
implementation 'androidx.appcompat:appcompat:1.0.0'
201-
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"
201+
implementation 'androidx.browser:browser:1.0.0'
202+
202203
implementation "com.google.firebase:firebase-messaging:17.3.4"
203-
//noinspection GradleDynamicVersion
204-
implementation "com.facebook.react:react-native:+" // From node_modules
204+
205+
// ==== Test dependencies
206+
testImplementation 'junit:junit:4.12'
207+
testImplementation 'org.junit.jupiter:junit-jupiter:5.4.0'
208+
testImplementation 'com.google.truth:truth:0.43'
209+
testImplementation 'com.google.truth.extensions:truth-java8-extension:0.43'
210+
testImplementation 'org.mockito:mockito-core:1.10.19'
211+
212+
// ==== RN-related dependencies
213+
214+
implementation 'com.facebook.fresco:animated-gif:2.0.0' // For animated GIF support
205215

206216
// Workaround for facebook/react-native#32735; see
207217
// https://github.com/facebook/react-native/issues/32735#issue-1077061487
@@ -212,6 +222,15 @@ dependencies {
212222
}
213223
}
214224

225+
// ----------------------------------------
226+
// Dependencies from RN upstream, in the template app
227+
228+
implementation fileTree(dir: "libs", include: ["*.jar"])
229+
//noinspection GradleDynamicVersion
230+
implementation "com.facebook.react:react-native:+" // From node_modules
231+
232+
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"
233+
215234
debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") {
216235
exclude group: 'com.facebook.fbjni'
217236
}
@@ -232,15 +251,10 @@ dependencies {
232251
} else {
233252
implementation jscFlavor
234253
}
254+
// END dependencies from RN upstream
255+
// ----------------------------------------
235256

236-
implementation 'com.facebook.fresco:animated-gif:2.0.0' // For animated GIF support
237-
implementation 'androidx.browser:browser:1.0.0'
238-
239-
testImplementation 'junit:junit:4.12'
240-
testImplementation 'org.junit.jupiter:junit-jupiter:5.4.0'
241-
testImplementation 'com.google.truth:truth:0.43'
242-
testImplementation 'com.google.truth.extensions:truth-java8-extension:0.43'
243-
testImplementation 'org.mockito:mockito-core:1.10.19'
257+
// Don't put new dependencies down here. Put them above, before the upstream section.
244258
}
245259

246260
// The default kotlinOptions.jvmTarget is 1.6. With the default, we get

0 commit comments

Comments
 (0)