File tree Expand file tree Collapse file tree 2 files changed +17
-2
lines changed
module-communication-plugin/src/main/kotlin/com/flyjingfish/module_communication_plugin Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,21 @@ abstract class ExportTask : DefaultTask() {
3434 val buildFile = File (dir, path)
3535
3636 val moduleKey = curProject.buildDir.absolutePath
37- PackageRecordUtils .clear(moduleKey,buildFile)
37+ val isClear = PackageRecordUtils .clear(moduleKey,buildFile)
38+ if (isClear){
39+ val recordPackageSet = mutableSetOf<String >()
40+ for (file in collection.files) {
41+ val packageName = getPackageName(file)
42+ packageName?.let {
43+ recordPackageSet.add(it)
44+ }
45+ }
46+
47+ for (packageName in recordPackageSet) {
48+ val packageFile = File (buildFile.absolutePath + " /" + packageName.replace(" ." ," /" ))
49+ packageFile.deleteRecursively()
50+ }
51+ }
3852
3953 for (file in collection.files) {
4054 val packageName = getPackageName(file)
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ object PackageRecordUtils {
1414 lastRecordPackageSet.add(packageName)
1515 }
1616
17- fun clear (moduleKey : String ,buildFile : File ){
17+ fun clear (moduleKey : String ,buildFile : File ): Boolean {
1818 val lastRecordPackageSet = lastRecordPackageMap[moduleKey]
1919 lastRecordPackageSet?.let {
2020// println("lastRecordPackageSet-size="+it.size);
@@ -26,6 +26,7 @@ object PackageRecordUtils {
2626
2727 it.clear()
2828 }
29+ return lastRecordPackageSet.isNullOrEmpty()
2930 }
3031
3132}
You can’t perform that action at this time.
0 commit comments