Commits

Aikar authored d46b1713321
Copy final jars to current directory

This should help users find the .jar to use.
No tags

src/main/java/org/spigotmc/builder/Builder.java

Modified
9 9 import com.google.common.io.ByteStreams;
10 10 import com.google.common.io.Files;
11 11 import com.google.common.io.Resources;
12 12 import difflib.DiffUtils;
13 13 import difflib.Patch;
14 14 import java.io.BufferedReader;
15 15 import java.io.BufferedWriter;
16 16 import java.io.File;
17 17 import java.io.FileOutputStream;
18 18 import java.io.FileWriter;
19 +import java.io.FilenameFilter;
19 20 import java.io.IOException;
20 21 import java.io.InputStream;
21 22 import java.io.InputStreamReader;
22 23 import java.io.OutputStream;
23 24 import java.io.PrintStream;
24 25 import java.net.URL;
25 26 import java.util.Arrays;
26 27 import java.util.Date;
27 28 import java.util.Enumeration;
28 29 import java.util.List;
266 267 runProcess( spigot, "bash", "applyPatches.sh" );
267 268 System.out.println( "*** Spigot patches applied!" );
268 269 System.out.println( "Compiling Spigot & Spigot-API" );
269 270 runProcess( spigot, "sh", mvn, "clean", "install" );
270 271 } catch ( Exception ex )
271 272 {
272 273 System.err.println( "Error compiling Spigot, are you running this jar via msysgit?" );
273 274 ex.printStackTrace();
274 275 System.exit( 1 );
275 276 }
277 +
278 + for ( int i = 0; i < 35; i++ ) System.out.println( " " );
279 + System.out.println( "Success! Everything compiled successfully. Copying final .jar files now." );
280 + copyJar( "CraftBukkit/target", "craftbukkit", "craftbukkit-" + MC_VERSION + ".jar" );
281 + copyJar( "Spigot/Spigot-Server/target", "spigot", "spigot-" + MC_VERSION + ".jar" );
282 + }
283 +
284 + public static void copyJar( String path, final String jarPrefix, String outJarName ) throws Exception
285 + {
286 + File[] files = new File( path ).listFiles( new FilenameFilter()
287 + {
288 + @Override
289 + public boolean accept( File dir, String name )
290 + {
291 + return name.startsWith( jarPrefix ) && name.endsWith( ".jar" );
292 + }
293 + } );
294 + for ( File file : files )
295 + {
296 + System.out.println( "Copying " + file.getName() + " to " + CWD.getAbsolutePath() );
297 + Files.copy( file, new File( CWD, outJarName ) );
298 + System.out.println( " - Saved as " + outJarName );
299 + }
276 300 }
277 301
278 302 public static void getJacobe() throws Exception
279 303 {
280 304 if ( IS_WINDOWS )
281 305 {
282 306 File jacobeWindows = new File( "jacobe.win32.zip" );
283 307 download( "http://www.tiobe.com/content/products/jacobe/jacobe.win32.zip", jacobeWindows );
284 308 unzip( jacobeWindows, jacobeDir );
285 309 } else

Everything looks good. We'll let you know here if there's anything you should know about.

Add shortcut