File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
plugin/src/main/groovy/top/niunaijun/blackobfuscator Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change 11package top.niunaijun.blackobfuscator
22
33import com.android.build.gradle.AppExtension
4+ import com.android.build.gradle.api.ApplicationVariant
45import com.android.build.gradle.internal.dsl.BuildType
56import com.android.build.gradle.internal.dsl.ProductFlavor
67import com.android.build.gradle.internal.tasks.DexMergingTask
@@ -50,6 +51,16 @@ public class ObfPlugin implements Plugin<Project> {
5051 addTask(" minifyDebugWithR8" , tasks)
5152
5253 if (android != null ) {
54+ android. applicationVariants. all(new Action<ApplicationVariant > () {
55+ @Override
56+ void execute (ApplicationVariant applicationVariant ) {
57+ def name = upperCaseFirst(applicationVariant. buildType. name)
58+ def names = [applicationVariant. buildType. name, name]
59+ for (String p : names) {
60+ addOtherTask(tasks, p)
61+ }
62+ }
63+ })
5364 android. buildTypes. all(new Action<BuildType > () {
5465 @Override
5566 void execute (BuildType buildType ) {
You can’t perform that action at this time.
0 commit comments