tests: fix build on Windows
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user