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 f8aeb0d2..d7fcbe25 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 @@ -48,12 +48,7 @@ class AndroidJunkCodePlugin implements Plugin { for (int i = variant.sourceSets.size() - 1; i >= 0; i--) { def sourceSet = variant.sourceSets[i] if (!sourceSet.manifestFile.exists()) { - sourceSet.manifest.srcFile(project.files(manifestFile).builtBy(generateJunkCodeTask).singleFile) - project.tasks.all { - if (name == "process${variantName.capitalize()}MainManifest") { - dependsOn(generateJunkCodeTask) - } - } + sourceSet.manifest.srcFile(manifestFile) break } } diff --git a/library/src/main/groovy/cn/hx/plugin/junkcode/task/AndroidJunkCodeTask.groovy b/library/src/main/groovy/cn/hx/plugin/junkcode/task/AndroidJunkCodeTask.groovy index aca8f012..3b9b18b7 100644 --- a/library/src/main/groovy/cn/hx/plugin/junkcode/task/AndroidJunkCodeTask.groovy +++ b/library/src/main/groovy/cn/hx/plugin/junkcode/task/AndroidJunkCodeTask.groovy @@ -48,7 +48,12 @@ class AndroidJunkCodeTask extends DefaultTask { void generateClasses() { def javaDir = new File(outDir, "java") for (int i = 0; i < config.packageCount; i++) { - String packageName = config.packageBase + "." + generateName(i) + String packageName + if (config.packageBase.isEmpty()) { + packageName = generateName(i) + } else { + packageName = config.packageBase + "." + generateName(i) + } //生成Activity for (int j = 0; j < config.activityCountPerPackage; j++) { def activityPreName = generateName(j)