diff --git a/build.gradle b/build.gradle index dfd4cc50..89eb7156 100644 --- a/build.gradle +++ b/build.gradle @@ -11,7 +11,7 @@ buildscript { classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath "com.getkeepsafe.dexcount:dexcount-gradle-plugin:3.0.1" if (PLUGIN_ENABLE.toBoolean()) { - classpath "com.github.qq549631030:android-junk-code:1.2.1" + classpath "com.github.qq549631030:android-junk-code:1.2.2" } // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files diff --git a/library/gradle.properties b/library/gradle.properties index eccb169e..e726ab1d 100644 --- a/library/gradle.properties +++ b/library/gradle.properties @@ -1,6 +1,6 @@ #project GROUP=com.github.qq549631030 -VERSION_NAME=1.2.1 +VERSION_NAME=1.2.2 POM_ARTIFACT_ID=android-junk-code POM_NAME=AndroidJunkCode diff --git a/library/src/main/groovy/cn/hx/plugin/junkcode/plugin/AndroidJunkCodePlugin.groovy b/library/src/main/groovy/cn/hx/plugin/junkcode/plugin/AndroidJunkCodePlugin.groovy index 901513d6..31b2217e 100644 --- a/library/src/main/groovy/cn/hx/plugin/junkcode/plugin/AndroidJunkCodePlugin.groovy +++ b/library/src/main/groovy/cn/hx/plugin/junkcode/plugin/AndroidJunkCodePlugin.groovy @@ -49,11 +49,12 @@ class AndroidJunkCodePlugin implements Plugin { def sourceSet = variant.sourceSets[i] if (!sourceSet.manifestFile.exists()) { sourceSet.manifest.srcFile(manifestFile) - def processManifestTaskProvider = project.tasks.named("process${variantName.capitalize()}MainManifest") - if (processManifestTaskProvider) { - processManifestTaskProvider.configure { - it.dependsOn(generateJunkCodeTask) - } + def processManifestTask = project.tasks.findByName("process${variantName.capitalize()}MainManifest")//AGP 4.1.0+ + if (processManifestTask == null) { + processManifestTask = project.tasks.findByName("process${variantName.capitalize()}Manifest") + } + if (processManifestTask) { + processManifestTask.dependsOn(generateJunkCodeTask) } break }