diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/org/spigotmc/builder/Builder.java | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/src/main/java/org/spigotmc/builder/Builder.java b/src/main/java/org/spigotmc/builder/Builder.java index c8248b4..3c2325f 100644 --- a/src/main/java/org/spigotmc/builder/Builder.java +++ b/src/main/java/org/spigotmc/builder/Builder.java @@ -41,6 +41,7 @@ public class Builder public static final boolean IS_MAC = System.getProperty( "os.name" ).startsWith( "Mac" ); public static final File CWD = new File( "." ); public static final String MC_VERSION = "1.8"; + private static final File jacobeDir = new File( "jacobe" ); public static void main(String[] args) throws Exception { @@ -104,6 +105,12 @@ public class Builder clone( "https://hub.spigotmc.org/stash/scm/spigot/builddata.git", buildData ); } + if ( !jacobeDir.exists() ) + { + System.out.println( "Jacobe does not exist, downloading" ); + getJacobe(); + } + File maven = new File( "apache-maven-3.2.3" ); if ( !maven.exists() ) { @@ -189,7 +196,7 @@ public class Builder runProcess( "java -jar BuildData/bin/fernflower.jar -dgs=1 -hdc=0 -rbr=0 -asc=1 " + clazzDir + " " + decompileDir, CWD ); - String jacobePath = "BuildData/bin/jacobe"; + String jacobePath = jacobeDir.getPath() + "/jacobe"; if ( IS_WINDOWS ) { jacobePath += ".exe"; @@ -269,6 +276,23 @@ public class Builder } } + public static void getJacobe() throws Exception + { + if ( IS_WINDOWS ) + { + File jacobeWindows = new File( "jacobe.win32.zip" ); + download( "http://www.tiobe.com/content/products/jacobe/jacobe.win32.zip", jacobeWindows ); + unzip( jacobeWindows, jacobeDir ); + } else + { + File jacobeLinux = new File( "jacobe.linux.tar.gz" ); + download( "http://www.tiobe.com/content/products/jacobe/jacobe.linux.tar.gz", jacobeLinux ); + + jacobeDir.mkdir(); + runProcess( "tar xzvf " + jacobeLinux.getPath() + " -C " + jacobeDir.getPath(), CWD ); + } + } + public static void pull(Git repo) throws Exception { System.out.println( "Pulling updates for " + repo.getRepository().getDirectory() ); |