File tree Expand file tree Collapse file tree
src/main/groovy/cn/hx/plugin/junkcode 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.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
Original file line number Diff line number Diff line change 11# project
22GROUP =com.github.qq549631030
3- VERSION_NAME =1.2.2
3+ VERSION_NAME =1.2.3
44
55POM_ARTIFACT_ID =android-junk-code
66POM_NAME =AndroidJunkCode
Original file line number Diff line number Diff 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 }
Original file line number Diff line number Diff 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 " )
You can’t perform that action at this time.
0 commit comments