From 39371d57b33a4422eb19f3093611171704283ea2 Mon Sep 17 00:00:00 2001 From: Shawn Pearce Date: Tue, 6 Aug 2013 18:37:45 -0700 Subject: [PATCH] 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 --- lib/prolog/java/BuckPrologCompiler.java | 16 ++-------------- lib/prolog/prolog.defs | 2 +- 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/lib/prolog/java/BuckPrologCompiler.java b/lib/prolog/java/BuckPrologCompiler.java index f761ea8237..0db6763fb9 100644 --- a/lib/prolog/java/BuckPrologCompiler.java +++ b/lib/prolog/java/BuckPrologCompiler.java @@ -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 srcs = new ArrayList(); - List jars = new ArrayList(); - 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); diff --git a/lib/prolog/prolog.defs b/lib/prolog/prolog.defs index 95a75b2cbf..d8df8f7e09 100644 --- a/lib/prolog/prolog.defs +++ b/lib/prolog/prolog.defs @@ -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,