Skip to content

Commit

Permalink
Fixed compile for Linux.
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanSweet committed Aug 21, 2013
1 parent 5b839c4 commit 9706619
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
10 changes: 9 additions & 1 deletion scar/src/com/esotericsoftware/scar/Build.java
Original file line number Diff line number Diff line change
Expand Up @@ -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.");
Expand All @@ -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);

Expand Down
6 changes: 4 additions & 2 deletions scar/src/com/esotericsoftware/scar/Scar.java
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 9706619

Please sign in to comment.