This plugin will help you exclude so files by flavor or buildType
-
Add the following scripts to your build.gradle
buildscript { repositories { jcenter() } dependencies { classpath 'com.jween.gradle:android-soexcluder:1.1' } } apply plugin: 'com.android.application' apply plugin: 'android-soexcluder'
Note: You MUST apply
android-soexcluder
along withcom.android.application
-
Wish we have step 2!
But that's it, it a quite simple small tool to deal with so files.
-
Exclude specific so files by flavors
soexcluder { // exclude armeabi-v7a/foo.so and armeabi-v8a/bar.so for flavor1 flavor1 { exclude "lib/armeabi-v7a/foo.so", "lib/armeabi-v8a/bar.so" } // Reserve only v7a and x86 so files except foo.so for debug buildType debug { include "lib/armeabi-v7a/*.so" include "lib/x86/*.so" exclude "lib/armeabi-v7a/foo.so" exclude "lib/x86/foo.so" } }
-
Exact the same path pattern as gradle include/exclude api
soexcluder { // Reserve all so files for debug buildType except foo.so debug { include "**/*" exclude "**/foo.so" } }
-
You can even use regex in flavor/buildType entry!
soexcluder { // Remove all so files if the flavor or buildType name ends with 'o' ".*o" { exclude "**/*" } }
"THE BEER-WARE LICENSE" (Revision 42):
<Jween.Lau@gmail.com> wrote this file. As long as you retain this notice
you can do whatever you want with this stuff. If we meet some day, and you think
this stuff is worth it, you can buy me a beer in return. -Jween Lau
-
The purpose of this license is to prevent anti-labour-law companies from using the software or codes under the license, and force those companies to weigh their way of working
-
See a full list of projects under Anti-996 License
-
This draft is adapted from the MIT license. For more detailed explanation, please see Wiki. This license is designed to be compatible with all major open source licenses.
-
For law professionals or anyone who is willing to contribute to future version directly, please go to Anti-996-License-1.0. Thank you.