diff options
author | Aikar <aikar@aikar.co> | 2014-12-07 00:35:01 -0500 |
---|---|---|
committer | Aikar <aikar@aikar.co> | 2014-12-07 00:37:23 -0500 |
commit | d46b1713321b1c8c2e400699ecefc57556a86515 (patch) | |
tree | 56ed0bb2c3bc1b026fb555fbdf080604181a96ed /src | |
parent | 8c3c4ef42ee1b5617373022df6de8b9fa6da9a9c (diff) | |
download | buildtools-d46b1713321b1c8c2e400699ecefc57556a86515.tar buildtools-d46b1713321b1c8c2e400699ecefc57556a86515.tar.gz buildtools-d46b1713321b1c8c2e400699ecefc57556a86515.tar.lz buildtools-d46b1713321b1c8c2e400699ecefc57556a86515.tar.xz buildtools-d46b1713321b1c8c2e400699ecefc57556a86515.zip |
Copy final jars to current directory
This should help users find the .jar to use.
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/org/spigotmc/builder/Builder.java | 24 |
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 |