Fix incremental build on Windows

This commit is contained in:
Alexey Andreev 2019-06-26 20:15:42 +03:00
parent da27628e19
commit 90a5ad72d5
2 changed files with 4 additions and 2 deletions

View File

@ -249,6 +249,7 @@ public class IncrementalCBuilder {
private List<String> getChangedClasses(Collection<File> changedFiles) { private List<String> getChangedClasses(Collection<File> changedFiles) {
List<String> result = new ArrayList<>(); List<String> result = new ArrayList<>();
String[] prefixes = Arrays.stream(classPath).map(s -> s.replace('\\', '/')).toArray(String[]::new);
for (File file : changedFiles) { for (File file : changedFiles) {
String path = file.getPath().replace('\\', '/'); String path = file.getPath().replace('\\', '/');
@ -256,7 +257,7 @@ public class IncrementalCBuilder {
continue; continue;
} }
String prefix = Arrays.stream(classPath) String prefix = Arrays.stream(prefixes)
.filter(path::startsWith) .filter(path::startsWith)
.findFirst() .findFirst()
.orElse(""); .orElse("");

View File

@ -907,6 +907,7 @@ public class CodeServlet extends HttpServlet {
private List<String> getChangedClasses(Collection<File> changedFiles) { private List<String> getChangedClasses(Collection<File> changedFiles) {
List<String> result = new ArrayList<>(); List<String> result = new ArrayList<>();
String[] prefixes = Arrays.stream(classPath).map(s -> s.replace('\\', '/')).toArray(String[]::new);
for (File file : changedFiles) { for (File file : changedFiles) {
String path = file.getPath().replace('\\', '/'); String path = file.getPath().replace('\\', '/');
@ -914,7 +915,7 @@ public class CodeServlet extends HttpServlet {
continue; continue;
} }
String prefix = Arrays.stream(classPath) String prefix = Arrays.stream(prefixes)
.filter(path::startsWith) .filter(path::startsWith)
.findFirst() .findFirst()
.orElse(""); .orElse("");