diff --git a/matrix/matrix-android/matrix-gradle-plugin/src/main/kotlin/com/tencent/matrix/plugin/trace/MatrixTrace.kt b/matrix/matrix-android/matrix-gradle-plugin/src/main/kotlin/com/tencent/matrix/plugin/trace/MatrixTrace.kt index 27a3ebc80..c96046633 100644 --- a/matrix/matrix-android/matrix-gradle-plugin/src/main/kotlin/com/tencent/matrix/plugin/trace/MatrixTrace.kt +++ b/matrix/matrix-android/matrix-gradle-plugin/src/main/kotlin/com/tencent/matrix/plugin/trace/MatrixTrace.kt @@ -292,9 +292,17 @@ class MatrixTrace( if (isIncremental) { val outChangedFiles = HashMap() + for ((changedFileInput, status) in mapOfChangedFiles) { val changedFileInputFullPath = changedFileInput.absolutePath + + // mapOfChangedFiles is contains all. each collectDirectoryInputTask should handle itself, should not handle other file + if (!changedFileInputFullPath.contains(inputFullPath)) { + continue + } + val changedFileOutput = File(changedFileInputFullPath.replace(inputFullPath, outputFullPath)) + if (status == Status.ADDED || status == Status.CHANGED) { resultOfDirInputToOut[changedFileInput] = changedFileOutput } else if (status == Status.REMOVED) { diff --git a/samples/sample-android/app/build.gradle b/samples/sample-android/app/build.gradle index 9c2372380..374a37d2c 100644 --- a/samples/sample-android/app/build.gradle +++ b/samples/sample-android/app/build.gradle @@ -165,8 +165,8 @@ matrix { sevenZipPath = "${project.configurations.sevenZipDependency.resolve().getAt(0).getAbsolutePath()}" //Notice: You need to modify the value of $apksignerPath on different platform. the value below only suitable for Mac Platform, //if on Windows, you may have to replace apksigner with apksigner.bat. - apksignerPath = "${android.getSdkDirectory().getAbsolutePath()}/build-tools/${android.getBuildToolsVersion()}/apksigner" - zipAlignPath = "${android.getSdkDirectory().getAbsolutePath()}/build-tools/${android.getBuildToolsVersion()}/zipalign" + apksignerPath = "${android.getSdkDirectory().getAbsolutePath()}/build-tools/${android.getBuildToolsVersion()}/apksigner${isWindows() ? ".bat" : ""}" + zipAlignPath = "${android.getSdkDirectory().getAbsolutePath()}/build-tools/${android.getBuildToolsVersion()}/zipalign${isWindows() ? ".exe" : ""}" ignoreResources = ["R.id.*", "R.bool.*", "R.layout.unused_layout"] } } @@ -186,3 +186,12 @@ project.tasks.whenTaskAdded { } } } + +def isWindows() { + try { + String os = System.getProperty("os.name").toLowerCase() + return os.indexOf("win") >= 0 + } catch (Exception ignored) { + return false + } +} \ No newline at end of file