From 93595221756d3501c7e6e306b1055277beb7f795 Mon Sep 17 00:00:00 2001 From: md_5 Date: Sat, 29 Nov 2014 08:31:20 +1100 Subject: Update to pull Jacobe directly from the TIOBE site. --- pom.xml | 5 +++++ src/main/java/org/spigotmc/builder/Builder.java | 26 ++++++++++++++++++++++++- 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index ec5e6e0..8dbe316 100644 --- a/pom.xml +++ b/pom.xml @@ -50,6 +50,11 @@ commons-io 2.4 + + org.apache.commons + commons-compress + 1.9 + 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() ); -- cgit v1.2.3