File tree Expand file tree Collapse file tree
src/main/groovy/cn/hx/plugin/junkcode/plugin Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ buildscript {
1111 classpath " org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version "
1212 classpath " com.getkeepsafe.dexcount:dexcount-gradle-plugin:3.0.1"
1313 if (PLUGIN_ENABLE . toBoolean()) {
14- classpath " com.github.qq549631030:android-junk-code:1.2.4 "
14+ classpath " com.github.qq549631030:android-junk-code:1.2.5 "
1515 }
1616 // NOTE: Do not place your application dependencies here; they belong
1717 // in the individual module build.gradle files
Original file line number Diff line number Diff line change 11# project
22GROUP =com.github.qq549631030
3- VERSION_NAME =1.2.4
3+ VERSION_NAME =1.2.5
44
55POM_ARTIFACT_ID =android-junk-code
66POM_NAME =AndroidJunkCode
Original file line number Diff line number Diff line change @@ -49,9 +49,16 @@ class AndroidJunkCodePlugin implements Plugin<Project> {
4949 def sourceSet = variant. sourceSets[i]
5050 if (! sourceSet. manifestFile. exists()) {
5151 sourceSet. manifest. srcFile(manifestFile)
52- def processManifestTaskProvider = project. tasks. named(" process${ variantName.capitalize()} Manifest" )
53- if (processManifestTaskProvider) {
54- processManifestTaskProvider. configure {
52+ // AGP4.1.0+
53+ def processManifestTaskName = " process${ variantName.capitalize()} MainManifest"
54+ def processManifestTask = project. tasks. findByName(processManifestTaskName)
55+ if (processManifestTask == null ) {
56+ // before AGP4.1.0
57+ processManifestTaskName = " process${ variantName.capitalize()} Manifest"
58+ processManifestTask = project. tasks. findByName(processManifestTaskName)
59+ }
60+ if (processManifestTask) {
61+ project. tasks. named(processManifestTaskName). configure {
5562 it. dependsOn(generateJunkCodeTask)
5663 }
5764 }
You can’t perform that action at this time.
0 commit comments