File tree Expand file tree Collapse file tree 3 files changed +12
-5
lines changed
src/main/groovy/cn/hx/plugin/junkcode/plugin Expand file tree Collapse file tree 3 files changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ buildscript {
11
11
classpath " org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version "
12
12
classpath " com.getkeepsafe.dexcount:dexcount-gradle-plugin:3.0.1"
13
13
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 "
15
15
}
16
16
// NOTE: Do not place your application dependencies here; they belong
17
17
// in the individual module build.gradle files
Original file line number Diff line number Diff line change 1
1
# project
2
2
GROUP =com.github.qq549631030
3
- VERSION_NAME =1.2.4
3
+ VERSION_NAME =1.2.5
4
4
5
5
POM_ARTIFACT_ID =android-junk-code
6
6
POM_NAME =AndroidJunkCode
Original file line number Diff line number Diff line change @@ -49,9 +49,16 @@ class AndroidJunkCodePlugin implements Plugin<Project> {
49
49
def sourceSet = variant. sourceSets[i]
50
50
if (! sourceSet. manifestFile. exists()) {
51
51
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 {
55
62
it. dependsOn(generateJunkCodeTask)
56
63
}
57
64
}
You can’t perform that action at this time.
0 commit comments