Skip to content

Commit d8d07b6

Browse files
committed
调整keep文件名称
1 parent 68203b5 commit d8d07b6

4 files changed

Lines changed: 8 additions & 9 deletions

File tree

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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.2"
14+
classpath "com.github.qq549631030:android-junk-code:1.2.3"
1515
}
1616
// NOTE: Do not place your application dependencies here; they belong
1717
// in the individual module build.gradle files

library/gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#project
22
GROUP=com.github.qq549631030
3-
VERSION_NAME=1.2.2
3+
VERSION_NAME=1.2.3
44

55
POM_ARTIFACT_ID=android-junk-code
66
POM_NAME=AndroidJunkCode

library/src/main/groovy/cn/hx/plugin/junkcode/plugin/AndroidJunkCodePlugin.groovy

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,11 @@ class AndroidJunkCodePlugin implements Plugin<Project> {
4949
def sourceSet = variant.sourceSets[i]
5050
if (!sourceSet.manifestFile.exists()) {
5151
sourceSet.manifest.srcFile(manifestFile)
52-
def processManifestTask = project.tasks.findByName("process${variantName.capitalize()}MainManifest")//AGP 4.1.0+
53-
if (processManifestTask == null) {
54-
processManifestTask = project.tasks.findByName("process${variantName.capitalize()}Manifest")
55-
}
56-
if (processManifestTask) {
57-
processManifestTask.dependsOn(generateJunkCodeTask)
52+
def processManifestTaskProvider = project.tasks.named("process${variantName.capitalize()}Manifest")
53+
if (processManifestTaskProvider) {
54+
processManifestTaskProvider.configure {
55+
it.dependsOn(generateJunkCodeTask)
56+
}
5857
}
5958
break
6059
}

library/src/main/groovy/cn/hx/plugin/junkcode/task/AndroidJunkCodeTask.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ class AndroidJunkCodeTask extends DefaultTask {
237237
}
238238

239239
void generateKeep() {
240-
def keepFile = new File(outDir, "res/raw/keep.xml")
240+
def keepFile = new File(outDir, "res/raw/android_junk_code_keep.xml")
241241
StringBuilder sb = new StringBuilder()
242242
sb.append("<resources xmlns:tools=\"http://schemas.android.com/tools\"\n" +
243243
" tools:keep=\"@layout/${config.resPrefix}*, @drawable/${config.resPrefix}*\" />\n")

0 commit comments

Comments
 (0)