From 90a5ad72d5153a5325a492457cbf472543e15260 Mon Sep 17 00:00:00 2001 From: Alexey Andreev Date: Wed, 26 Jun 2019 20:15:42 +0300 Subject: [PATCH] Fix incremental build on Windows --- .../org/teavm/tooling/c/incremental/IncrementalCBuilder.java | 3 ++- .../src/main/java/org/teavm/devserver/CodeServlet.java | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/c-incremental/src/main/java/org/teavm/tooling/c/incremental/IncrementalCBuilder.java b/tools/c-incremental/src/main/java/org/teavm/tooling/c/incremental/IncrementalCBuilder.java index 3aa85865b..e2c3f0f89 100644 --- a/tools/c-incremental/src/main/java/org/teavm/tooling/c/incremental/IncrementalCBuilder.java +++ b/tools/c-incremental/src/main/java/org/teavm/tooling/c/incremental/IncrementalCBuilder.java @@ -249,6 +249,7 @@ public class IncrementalCBuilder { private List getChangedClasses(Collection changedFiles) { List result = new ArrayList<>(); + String[] prefixes = Arrays.stream(classPath).map(s -> s.replace('\\', '/')).toArray(String[]::new); for (File file : changedFiles) { String path = file.getPath().replace('\\', '/'); @@ -256,7 +257,7 @@ public class IncrementalCBuilder { continue; } - String prefix = Arrays.stream(classPath) + String prefix = Arrays.stream(prefixes) .filter(path::startsWith) .findFirst() .orElse(""); diff --git a/tools/devserver/src/main/java/org/teavm/devserver/CodeServlet.java b/tools/devserver/src/main/java/org/teavm/devserver/CodeServlet.java index acffed5da..248fb7855 100644 --- a/tools/devserver/src/main/java/org/teavm/devserver/CodeServlet.java +++ b/tools/devserver/src/main/java/org/teavm/devserver/CodeServlet.java @@ -907,6 +907,7 @@ public class CodeServlet extends HttpServlet { private List getChangedClasses(Collection changedFiles) { List result = new ArrayList<>(); + String[] prefixes = Arrays.stream(classPath).map(s -> s.replace('\\', '/')).toArray(String[]::new); for (File file : changedFiles) { String path = file.getPath().replace('\\', '/'); @@ -914,7 +915,7 @@ public class CodeServlet extends HttpServlet { continue; } - String prefix = Arrays.stream(classPath) + String prefix = Arrays.stream(prefixes) .filter(path::startsWith) .findFirst() .orElse("");