File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,26 @@ android {
4444 // flavors
4545 flavorDimensions + = " base"
4646 productFlavors {
47+ create(" fail-test" ) {
48+ // To test System.loadLibrary("mpd") failure
49+ // exclude the native lib from the package
50+ packaging {
51+ jniLibs {
52+ // it appears the 'excludes' is applied to all flavors
53+ // even if it's only inside this flavor.
54+ // this filters by task name to apply the exclusion only
55+ // for this flavor name.
56+ // (clearing the 'abiFilters' will only create a universal apk
57+ // with all of the abi versions)
58+ gradle.startParameter.getTaskNames().forEach { task ->
59+ if (task.contains(" fail-test" , ignoreCase = true )) {
60+ println (" NOTICE: excluding libmpd.so from package $task for testing" )
61+ excludes + = " **/libmpd.so"
62+ }
63+ }
64+ }
65+ }
66+ }
4767 create(" arm64-v8a" ) {
4868 ndk {
4969 // ABI to include in package
You can’t perform that action at this time.
0 commit comments