mirror of
https://github.com/badvision/jace.git
synced 2024-06-14 03:29:34 +00:00
Fixed assembler issues on Windows platform.
This commit is contained in:
parent
a544cae02c
commit
ab5d3472c0
|
@ -89,6 +89,15 @@ public class AcmeCompiler implements CompileResult<File> {
|
|||
ByteArrayOutputStream baosErr;
|
||||
PrintStream err;
|
||||
|
||||
private String normalizeWindowsPath(String path) {
|
||||
if (path.contains("\\")) {
|
||||
char firstLetter = path.toLowerCase().charAt(0);
|
||||
return "/"+firstLetter+path.substring(1).replaceAll("\\\\", "/");
|
||||
} else {
|
||||
return path;
|
||||
}
|
||||
}
|
||||
|
||||
private void invokeAcme(File sourceFile, File workingDirectory) throws ClassNotFoundException, SecurityException, NoSuchMethodException, IOException {
|
||||
String oldPath = System.getProperty("user.dir");
|
||||
redirectSystemOutput();
|
||||
|
@ -96,7 +105,7 @@ public class AcmeCompiler implements CompileResult<File> {
|
|||
compiledAsset = File.createTempFile(sourceFile.getName(), "bin", sourceFile.getParentFile());
|
||||
System.setProperty("user.dir", workingDirectory.getAbsolutePath());
|
||||
AcmeCrossAssembler acme = new AcmeCrossAssembler();
|
||||
String[] params = {"--outfile", compiledAsset.getAbsolutePath(), "-f", "cbm", "--maxerrors","16",sourceFile.getAbsolutePath()};
|
||||
String[] params = {"--outfile", normalizeWindowsPath(compiledAsset.getAbsolutePath()), "-f", "cbm", "--maxerrors","16",normalizeWindowsPath(sourceFile.getAbsolutePath())};
|
||||
int status = acme.run("Acme", params);
|
||||
successful = status == 0;
|
||||
if (!successful) {
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
package jace.assembly;
|
||||
|
||||
import org.ibex.nestedvm.UnixRuntime;
|
||||
/* This file was generated from acme by Mips2Java on Tue Jul 14 00:46:52 CDT 2015 */
|
||||
|
||||
public final class AcmeCrossAssembler extends org.ibex.nestedvm.UnixRuntime {
|
||||
public final class AcmeCrossAssembler extends UnixRuntime {
|
||||
/* program counter */
|
||||
private int pc = 0;
|
||||
|
||||
|
|
|
@ -221,6 +221,7 @@ public class Program {
|
|||
if (lastResult.isSuccessful()) {
|
||||
getHandler().execute(lastResult);
|
||||
} else {
|
||||
lastResult.getOtherMessages().forEach(System.err::println);
|
||||
getHandler().clean(lastResult);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user