summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGunfighterJ <joseph.jenniges@gmail.com>2014-12-09 20:15:32 +0100
committerGunfighterJ <joseph.jenniges@gmail.com>2014-12-09 20:15:32 +0100
commitf09c6388754c2ea1150099ba0c74333d00e249fe (patch)
tree56ed0bb2c3bc1b026fb555fbdf080604181a96ed
parent8c3c4ef42ee1b5617373022df6de8b9fa6da9a9c (diff)
parentd46b1713321b1c8c2e400699ecefc57556a86515 (diff)
downloadbuildtools-f09c6388754c2ea1150099ba0c74333d00e249fe.tar
buildtools-f09c6388754c2ea1150099ba0c74333d00e249fe.tar.gz
buildtools-f09c6388754c2ea1150099ba0c74333d00e249fe.tar.lz
buildtools-f09c6388754c2ea1150099ba0c74333d00e249fe.tar.xz
buildtools-f09c6388754c2ea1150099ba0c74333d00e249fe.zip
Merge pull request #6 in SPIGOT/buildtools from ~AIKAR/buildtools:copyJar to master
* commit 'd46b1713321b1c8c2e400699ecefc57556a86515': Copy final jars to current directory
-rw-r--r--src/main/java/org/spigotmc/builder/Builder.java24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/main/java/org/spigotmc/builder/Builder.java b/src/main/java/org/spigotmc/builder/Builder.java
index 45971b5..ba9ff81 100644
--- a/src/main/java/org/spigotmc/builder/Builder.java
+++ b/src/main/java/org/spigotmc/builder/Builder.java
@@ -16,6 +16,7 @@ import java.io.BufferedWriter;
import java.io.File;
import java.io.FileOutputStream;
import java.io.FileWriter;
+import java.io.FilenameFilter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
@@ -273,6 +274,29 @@ public class Builder
ex.printStackTrace();
System.exit( 1 );
}
+
+ for ( int i = 0; i < 35; i++ ) System.out.println( " " );
+ System.out.println( "Success! Everything compiled successfully. Copying final .jar files now." );
+ copyJar( "CraftBukkit/target", "craftbukkit", "craftbukkit-" + MC_VERSION + ".jar" );
+ copyJar( "Spigot/Spigot-Server/target", "spigot", "spigot-" + MC_VERSION + ".jar" );
+ }
+
+ public static void copyJar( String path, final String jarPrefix, String outJarName ) throws Exception
+ {
+ File[] files = new File( path ).listFiles( new FilenameFilter()
+ {
+ @Override
+ public boolean accept( File dir, String name )
+ {
+ return name.startsWith( jarPrefix ) && name.endsWith( ".jar" );
+ }
+ } );
+ for ( File file : files )
+ {
+ System.out.println( "Copying " + file.getName() + " to " + CWD.getAbsolutePath() );
+ Files.copy( file, new File( CWD, outJarName ) );
+ System.out.println( " - Saved as " + outJarName );
+ }
}
public static void getJacobe() throws Exception