Skip to content

Commit

Permalink
Use testOnly in unit-test sample.
Browse files Browse the repository at this point in the history
Fixes #1083.
  • Loading branch information
DanAlbert committed Oct 8, 2024
1 parent 9d38db9 commit a4f70e7
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions unit-test/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,20 @@ android {
viewBinding true
prefab true
}

packagingOptions {
// Libraries that are wrongly included in the junit-gtest AAR that will
// end up in our APK if we don't explicitly exclude them.
jniLibs {
excludes += ['**/libadder.so', '**/libapptest.so', '**/libc++_shared.so']
// Gradle has no way of knowing which of the libraries in our
// CMakeLists.txt are for the app and which are for tests, so we
// have to tell it which libraries are test libraries. Without
// this, the test libraries will end up packaged in the real API
// and not just the test APK.
//
// If you copy this project, be sure to update this to specify the
// names of your own test libraries.
testOnly += ["**/libapp_tests.so"]
}
}

}

dependencies {
Expand Down

0 comments on commit a4f70e7

Please sign in to comment.