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:
Shawn Pearce 2013-08-06 18:37:45 -07:00
parent 980b51f64e
commit 39371d57b3
2 changed files with 3 additions and 15 deletions

View File

@ -19,27 +19,15 @@ import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.jar.JarEntry;
import java.util.jar.JarOutputStream;
public class BuckPrologCompiler {
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 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());
}
jar(out, java);

View File

@ -19,7 +19,7 @@ def prolog_cafe_library(
visibility = []):
genrule(
name = name + '__pl2j',
cmd = 'cd $SRCDIR;$(exe //lib/prolog:compiler) $DEPS ' +
cmd = 'cd $SRCDIR;$(exe //lib/prolog:compiler) ' +
' '.join(srcs) +
' $OUT',
srcs = srcs,