Skip to content

Commit

Permalink
android: avoid test deps in APK
Browse files Browse the repository at this point in the history
  • Loading branch information
darakeon committed Nov 26, 2023
1 parent faeb538 commit 50a67d3
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 13 deletions.
14 changes: 9 additions & 5 deletions android/App/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -78,16 +78,20 @@ android {
dependencies {
implementation project(':Lib')

implementation project(":TestUtils")
if (!project.hasProperty("hide-test-deps")) {
implementation project(":TestUtils")
}

implementation "com.google.android.gms:play-services-iid:$play_version"
implementation "com.squareup.retrofit2:converter-gson:$retrofit_version"

testImplementation project(":TestUtils")
if (!project.hasProperty("hide-test-deps")) {
testImplementation project(":TestUtils")

testImplementation "junit:junit:$junit_version"
testImplementation "org.mockito:mockito-core:$mockito_version"
testImplementation "org.robolectric:robolectric:$robolectric_version"
testImplementation "junit:junit:$junit_version"
testImplementation "org.mockito:mockito-core:$mockito_version"
testImplementation "org.robolectric:robolectric:$robolectric_version"
}
}

task wrapper(type: Wrapper) {
Expand Down
16 changes: 9 additions & 7 deletions android/Lib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,18 @@ dependencies {
implementation "com.squareup.retrofit2:retrofit:$retrofit_version"
implementation "com.squareup.retrofit2:converter-gson:$retrofit_version"

testImplementation project(":TestUtils")
if (!project.hasProperty("hide-test-deps")) {
testImplementation project(":TestUtils")

testImplementation "junit:junit:$junit_version"
testImplementation "org.mockito:mockito-core:$mockito_version"
testImplementation "org.robolectric:robolectric:$robolectric_version"
testImplementation "com.squareup.retrofit2:converter-gson:$retrofit_version"
testImplementation "junit:junit:$junit_version"
testImplementation "org.mockito:mockito-core:$mockito_version"
testImplementation "org.robolectric:robolectric:$robolectric_version"
testImplementation "com.squareup.retrofit2:converter-gson:$retrofit_version"

androidTestImplementation project(":TestUtils")
androidTestImplementation project(":TestUtils")

androidTestImplementation "com.android.support.test:runner:$testrunner_version"
androidTestImplementation "com.android.support.test:runner:$testrunner_version"
}
}

task wrapper(type: Wrapper) {
Expand Down
2 changes: 1 addition & 1 deletion android/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ sleep:
@sleep 2

apk:
@${GRADLE} :app:bundleRelease
@${GRADLE} :app:bundleRelease -Phide-test-deps

@cp App/build/outputs/bundle/release/* \
${PROJECT}/android/publish/ \
Expand Down

0 comments on commit 50a67d3

Please sign in to comment.