Commit 7699cfac authored by Skylot's avatar Skylot

tests: fix build on Windows

parent 5c48a457
......@@ -312,16 +312,17 @@ public abstract class IntegrationTest extends TestUtils {
File outTmp = createTempDir("jadx-tmp-classes");
outTmp.deleteOnExit();
List<File> files = StaticCompiler.compile(Arrays.asList(file), outTmp, withDebugInfo);
String filter = outTmp.getAbsolutePath() + File.separator + cls.getName().replace('.', '/');
// remove classes which are parents for test class
Iterator<File> iterator = files.iterator();
while (iterator.hasNext()) {
File next = iterator.next();
if (!next.getAbsolutePath().startsWith(filter)) {
if (!next.getName().contains(cls.getSimpleName())) {
iterator.remove();
} else {
next.deleteOnExit();
}
}
for (File clsFile : files) {
clsFile.deleteOnExit();
}
return files;
}
......
......@@ -13,7 +13,6 @@ import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.net.URI;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
......@@ -73,7 +72,7 @@ public class StaticCompiler {
private File file;
protected ClassFileObject(File file, Kind kind) {
super(URI.create("file://" + file.getAbsolutePath()), kind);
super(file.toURI(), kind);
this.file = file;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment