From 33532cd4f1b5acdd75a80bc6ad3701bd8a1f8889 Mon Sep 17 00:00:00 2001 From: md_5 Date: Sat, 6 Dec 2014 09:21:52 +1100 Subject: Use single maven script for both platforms --- src/main/java/org/spigotmc/builder/Builder.java | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) (limited to 'src/main') diff --git a/src/main/java/org/spigotmc/builder/Builder.java b/src/main/java/org/spigotmc/builder/Builder.java index ba192b3..bc5e4c1 100644 --- a/src/main/java/org/spigotmc/builder/Builder.java +++ b/src/main/java/org/spigotmc/builder/Builder.java @@ -124,14 +124,7 @@ public class Builder unzip( mvnTemp, new File( "." ) ); } - String mvnCmd = maven.getAbsolutePath() + "/bin/mvn"; - if ( IS_WINDOWS ) - { - mvnCmd += ".bat"; - } else - { - mvnCmd = "/bin/sh " + mvnCmd; - } + String mvn = maven.getAbsolutePath() + "/bin/mvn"; Git bukkitGit = Git.open( bukkit ); Git craftBukkitGit = Git.open( craftBukkit ); @@ -180,7 +173,7 @@ public class Builder "-m", "BuildData/mappings/package.srg", "-o", finalMappedJar.getPath() ); } - runProcess( CWD, mvnCmd, "install:install-file", "-Dfile=" + finalMappedJar, "-Dpackaging=jar", "-DgroupId=org.spigotmc", + runProcess( CWD, "sh", mvn, "install:install-file", "-Dfile=" + finalMappedJar, "-Dpackaging=jar", "-DgroupId=org.spigotmc", "-DartifactId=minecraft-server", "-Dversion=1.8-SNAPSHOT" ); File decompileDir = new File( workDir, "decompile-" + mappingsVersion ); @@ -263,17 +256,17 @@ public class Builder // Git spigotApiGit = Git.open( spigotApi ); // Git spigotServerGit = Git.open( spigotServer ); System.out.println( "Compiling Bukkit" ); - runProcess( bukkit, mvnCmd, "clean", "install" ); + runProcess( bukkit, "sh", mvn, "clean", "install" ); System.out.println( "Compiling CraftBukkit" ); - runProcess( craftBukkit, mvnCmd, "clean", "install" ); + runProcess( craftBukkit, "sh", mvn, "clean", "install" ); try { runProcess( spigot, "bash", "applyPatches.sh" ); System.out.println( "*** Spigot patches applied!" ); System.out.println( "Compiling Spigot & Spigot-API" ); - runProcess( spigot, mvnCmd, "clean", "install" ); + runProcess( spigot, "sh", mvn, "clean", "install" ); } catch ( Exception ex ) { System.err.println( "Error compiling Spigot, are you running this jar via msysgit?" ); -- cgit v1.2.3