diff options
author | md_5 <git@md-5.net> | 2014-11-29 08:31:20 +1100 |
---|---|---|
committer | md_5 <git@md-5.net> | 2014-11-29 08:31:20 +1100 |
commit | 93595221756d3501c7e6e306b1055277beb7f795 (patch) | |
tree | f7522d3da66c1d5e63a25e8449789341400a9463 /src/main/java/org/spigotmc | |
parent | 032e8ca0a3a2fd6059308ca43083df986467b99e (diff) | |
download | buildtools-93595221756d3501c7e6e306b1055277beb7f795.tar buildtools-93595221756d3501c7e6e306b1055277beb7f795.tar.gz buildtools-93595221756d3501c7e6e306b1055277beb7f795.tar.lz buildtools-93595221756d3501c7e6e306b1055277beb7f795.tar.xz buildtools-93595221756d3501c7e6e306b1055277beb7f795.zip |
Update to pull Jacobe directly from the TIOBE site.
Diffstat (limited to 'src/main/java/org/spigotmc')
-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() ); |