Skip to content

Commit a4f70e7

Browse files
committed
Use testOnly in unit-test sample.
Fixes #1083.
1 parent 9d38db9 commit a4f70e7

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

unit-test/app/build.gradle

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,20 @@ android {
2424
viewBinding true
2525
prefab true
2626
}
27+
2728
packagingOptions {
28-
// Libraries that are wrongly included in the junit-gtest AAR that will
29-
// end up in our APK if we don't explicitly exclude them.
3029
jniLibs {
31-
excludes += ['**/libadder.so', '**/libapptest.so', '**/libc++_shared.so']
30+
// Gradle has no way of knowing which of the libraries in our
31+
// CMakeLists.txt are for the app and which are for tests, so we
32+
// have to tell it which libraries are test libraries. Without
33+
// this, the test libraries will end up packaged in the real API
34+
// and not just the test APK.
35+
//
36+
// If you copy this project, be sure to update this to specify the
37+
// names of your own test libraries.
38+
testOnly += ["**/libapp_tests.so"]
3239
}
3340
}
34-
3541
}
3642

3743
dependencies {

0 commit comments

Comments
 (0)