From 9706619b2512e4012e073a2cd709f69576d3e7b7 Mon Sep 17 00:00:00 2001 From: Nathan Sweet Date: Wed, 21 Aug 2013 16:06:06 +0000 Subject: [PATCH] Fixed compile for Linux. --- scar/src/com/esotericsoftware/scar/Build.java | 10 +++++++++- scar/src/com/esotericsoftware/scar/Scar.java | 6 ++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/scar/src/com/esotericsoftware/scar/Build.java b/scar/src/com/esotericsoftware/scar/Build.java index 2f09116..6e06ff2 100644 --- a/scar/src/com/esotericsoftware/scar/Build.java +++ b/scar/src/com/esotericsoftware/scar/Build.java @@ -378,7 +378,7 @@ static public void buildDependencies (Project project) throws IOException { static public void build (String path) throws IOException { build(project(path)); } - + /** Executes the buildDependencies, clean, compile, jar, and dist utility metshods. */ static public void build (Project project) throws IOException { if (project == null) throw new IllegalArgumentException("project cannot be null."); @@ -388,7 +388,15 @@ static public void build (Project project) throws IOException { if (INFO) info(project.toString(), "Target: " + project.path("$target$")); clean(project); + try { + Thread.sleep(100); + } catch (InterruptedException ignored) { + } compile(project); + try { + Thread.sleep(100); + } catch (InterruptedException ignored) { + } jar(project); dist(project); diff --git a/scar/src/com/esotericsoftware/scar/Scar.java b/scar/src/com/esotericsoftware/scar/Scar.java index be0a0b5..767ad8b 100644 --- a/scar/src/com/esotericsoftware/scar/Scar.java +++ b/scar/src/com/esotericsoftware/scar/Scar.java @@ -192,7 +192,9 @@ static public void jar (String outputFile, Paths inputPaths, String mainClass, P output.setLevel(Deflater.BEST_COMPRESSION); try { for (int i = 0, n = fullPaths.size(); i < n; i++) { - output.putNextEntry(new JarEntry(relativePaths.get(i).replace('\\', '/'))); + JarEntry jarEntry = new JarEntry(relativePaths.get(i).replace('\\', '/')); + jarEntry.setTime(1370273339); + output.putNextEntry(jarEntry); FileInputStream input = new FileInputStream(fullPaths.get(i)); try { byte[] buffer = new byte[4096]; @@ -1074,7 +1076,7 @@ static public void compile (Paths source, Paths classpath, String outputDir) { args.addAll(source.getPaths()); if (classpath != null && !classpath.isEmpty()) { args.add("-classpath"); - args.add(classpath.toString(";")); + args.add(isWindows ? classpath.toString(";") : classpath.toString(":")); } JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();