Simplify buck based prolog compiler
The JARs are no longer passed into the prolog to java stage. $DEPS is not necessary on the command line and .jar handling inside of the translater is not required. Change-Id: I1d12ab95376bd5878609bc8635955734e599e3cf
This commit is contained in:
parent
980b51f64e
commit
39371d57b3
@ -19,27 +19,15 @@ import java.io.File;
|
|||||||
import java.io.FileInputStream;
|
import java.io.FileInputStream;
|
||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.jar.JarEntry;
|
import java.util.jar.JarEntry;
|
||||||
import java.util.jar.JarOutputStream;
|
import java.util.jar.JarOutputStream;
|
||||||
|
|
||||||
public class BuckPrologCompiler {
|
public class BuckPrologCompiler {
|
||||||
public static void main(String[] argv) throws IOException, CompileException {
|
public static void main(String[] argv) throws IOException, CompileException {
|
||||||
List<File> srcs = new ArrayList<File>();
|
|
||||||
List<File> jars = new ArrayList<File>();
|
|
||||||
for (int i = 0; i < argv.length - 1; i++) {
|
|
||||||
String s = argv[i];
|
|
||||||
if (s.endsWith(".pl")) {
|
|
||||||
srcs.add(new File(s));
|
|
||||||
} else if (s.endsWith(".jar")) {
|
|
||||||
jars.add(new File(s));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
File out = new File(argv[argv.length - 1]);
|
File out = new File(argv[argv.length - 1]);
|
||||||
File java = tmpdir("java");
|
File java = tmpdir("java");
|
||||||
for (File src : srcs) {
|
for (int i = 0; i < argv.length - 1; i++) {
|
||||||
|
File src = new File(argv[i]);
|
||||||
new Compiler().prologToJavaSource(src.getPath(), java.getPath());
|
new Compiler().prologToJavaSource(src.getPath(), java.getPath());
|
||||||
}
|
}
|
||||||
jar(out, java);
|
jar(out, java);
|
||||||
|
@ -19,7 +19,7 @@ def prolog_cafe_library(
|
|||||||
visibility = []):
|
visibility = []):
|
||||||
genrule(
|
genrule(
|
||||||
name = name + '__pl2j',
|
name = name + '__pl2j',
|
||||||
cmd = 'cd $SRCDIR;$(exe //lib/prolog:compiler) $DEPS ' +
|
cmd = 'cd $SRCDIR;$(exe //lib/prolog:compiler) ' +
|
||||||
' '.join(srcs) +
|
' '.join(srcs) +
|
||||||
' $OUT',
|
' $OUT',
|
||||||
srcs = srcs,
|
srcs = srcs,
|
||||||
|
Loading…
Reference in New Issue
Block a user