mirror of
https://hub.spigotmc.org/stash/scm/spigot/buildtools.git
synced 2025-04-13 09:31:28 +00:00
Copy final jars to current directory
This should help users find the .jar to use.
This commit is contained in:
parent
8c3c4ef42e
commit
d46b171332
1 changed files with 24 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue