diff --git a/build.gradle b/build.gradle index 5e57e619..dc399995 100644 --- a/build.gradle +++ b/build.gradle @@ -10,8 +10,9 @@ buildscript { classpath 'com.android.tools.build:gradle:4.2.1' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath "com.getkeepsafe.dexcount:dexcount-gradle-plugin:3.0.1" -// classpath project(":library") - classpath "com.github.qq549631030:android-junk-code:1.1.4" + if (PLUGIN_ENABLE.toBoolean()) { + classpath "com.github.qq549631030:android-junk-code:1.1.5" + } // 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 05bd02e1..195e4590 100644 --- a/library/gradle.properties +++ b/library/gradle.properties @@ -1,6 +1,6 @@ #project GROUP=com.github.qq549631030 -VERSION_NAME=1.1.4 +VERSION_NAME=1.1.5 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 2938b96b..45213f7c 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 @@ -20,7 +20,7 @@ class AndroidJunkCodePlugin implements Plugin { def junkCodeConfig = generateJunkCodeExt.variantConfig.findByName(variantName) if (junkCodeConfig) { def junkCodeNamespace = "" - if (android.hasProperty("namespace")) {//AGP 7.3+ + if (android.hasProperty("namespace") && android.namespace) {//AGP 4.2.0+ junkCodeNamespace = android.namespace } else { //从AndroidManifest.xml找到package name @@ -38,7 +38,7 @@ class AndroidJunkCodePlugin implements Plugin { } def junkCodeOutDir = new File(project.buildDir, "generated/source/junk/$variantName") def generateJunkCodeTaskName = "generate${variantName.capitalize()}JunkCode" - def generateJunkCodeTask = project.tasks.create(generateJunkCodeTaskName, AndroidJunkCodeTask){ + def generateJunkCodeTask = project.tasks.create(generateJunkCodeTaskName, AndroidJunkCodeTask) { config = junkCodeConfig namespace = junkCodeNamespace outDir = junkCodeOutDir