Skip to content

Commit

Permalink
Adjustments for the compilation of MinetickMod
Browse files Browse the repository at this point in the history
And once again I should do my stuff in branches, this makes merging upstream updates a lot simpler
  • Loading branch information
Poweruser committed Jul 5, 2015
1 parent 44af261 commit 98d15fa
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 24 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@

<modelVersion>4.0.0</modelVersion>

<groupId>org.spigotmc</groupId>
<groupId>de.minetick</groupId>
<artifactId>builder</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>

<name>BuildTools</name>
<name>MinetickTools</name>
<description></description>

<properties>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/spigotmc/builder/BuildInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ public static class Refs
private String BuildData;
private String Bukkit;
private String CraftBukkit;
private String Spigot;
private String Minetick;
}
}
42 changes: 21 additions & 21 deletions src/main/java/org/spigotmc/builder/Builder.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
public class Builder
{

public static final String LOG_FILE = "BuildTools.log.txt";
public static final String LOG_FILE = "MinetickTools.log.txt";
public static final boolean IS_WINDOWS = System.getProperty( "os.name" ).startsWith( "Windows" );
public static final File CWD = new File( "." );
private static boolean dontUpdate;
Expand Down Expand Up @@ -159,10 +159,10 @@ public static void main(String[] args) throws Exception
clone( "https://hub.spigotmc.org/stash/scm/spigot/craftbukkit.git", craftBukkit );
}

File spigot = new File( "Spigot" );
if ( !spigot.exists() )
File minetick = new File( "Minetick" );
if ( !minetick.exists() )
{
clone( "https://hub.spigotmc.org/stash/scm/spigot/spigot.git", spigot );
clone( "https://github.com/Poweruser/Minetick.git", minetick );
}

File buildData = new File( "BuildData" );
Expand Down Expand Up @@ -193,7 +193,7 @@ public static void main(String[] args) throws Exception

Git bukkitGit = Git.open( bukkit );
Git craftBukkitGit = Git.open( craftBukkit );
Git spigotGit = Git.open( spigot );
Git minetickGit = Git.open( minetick );
Git buildGit = Git.open( buildData );

BuildInfo buildInfo = new BuildInfo( "Dev Build", "Development", 0, new BuildInfo.Refs( "master", "master", "master", "master" ) );
Expand All @@ -208,7 +208,7 @@ public static void main(String[] args) throws Exception
String verInfo;
try
{
verInfo = get( "https://hub.spigotmc.org/versions/" + askedVersion + ".json" );
verInfo = get( "https://github.com/Poweruser/Minetick/wiki/versions/" + askedVersion + ".json" );
} catch ( IOException ex )
{
System.err.println( "Could not get version " + askedVersion + " does it exist? Try another version or use 'latest'" );
Expand All @@ -230,7 +230,7 @@ public static void main(String[] args) throws Exception
pull( buildGit, buildInfo.getRefs().getBuildData() );
pull( bukkitGit, buildInfo.getRefs().getBukkit() );
pull( craftBukkitGit, buildInfo.getRefs().getCraftBukkit() );
pull( spigotGit, buildInfo.getRefs().getSpigot() );
pull( minetickGit, buildInfo.getRefs().getMinetick() );
}

VersionInfo versionInfo = new Gson().fromJson(
Expand Down Expand Up @@ -360,15 +360,15 @@ public boolean apply(String input)

FileUtils.moveDirectory( tmpNms, nmsDir );

File spigotApi = new File( spigot, "Bukkit" );
if ( !spigotApi.exists() )
File minetickApi = new File( minetick, "Bukkit" );
if ( !minetickApi.exists() )
{
clone( "file://" + bukkit.getAbsolutePath(), spigotApi );
clone( "file://" + bukkit.getAbsolutePath(), minetickApi );
}
File spigotServer = new File( spigot, "CraftBukkit" );
if ( !spigotServer.exists() )
File minetickServer = new File( minetick, "CraftBukkit" );
if ( !minetickServer.exists() )
{
clone( "file://" + craftBukkit.getAbsolutePath(), spigotServer );
clone( "file://" + craftBukkit.getAbsolutePath(), minetickServer );
}

// Git spigotApiGit = Git.open( spigotApi );
Expand All @@ -392,17 +392,17 @@ public boolean apply(String input)

try
{
runProcess( spigot, "bash", "applyPatches.sh" );
System.out.println( "*** Spigot patches applied!" );
runProcess( minetick, "bash", "applyPatches.sh" );
System.out.println( "*** Minetick patches applied!" );

if ( !skipCompile )
{
System.out.println( "Compiling Spigot & Spigot-API" );
runProcess( spigot, "sh", mvn, "clean", "install" );
System.out.println( "Compiling Minetick & Minetick-API" );
runProcess( minetick, "sh", mvn, "clean", "install" );
}
} catch ( Exception ex )
{
System.err.println( "Error compiling Spigot, are you running this jar via msysgit?" );
System.err.println( "Error compiling Minetick, are you running this jar via msysgit?" );
ex.printStackTrace();
System.exit( 1 );
}
Expand All @@ -416,7 +416,7 @@ public boolean apply(String input)
{
System.out.println( "Success! Everything compiled successfully. Copying final .jar files now." );
copyJar( "CraftBukkit/target", "craftbukkit", "craftbukkit-" + versionInfo.getMinecraftVersion() + ".jar" );
copyJar( "Spigot/Spigot-Server/target", "spigot", "spigot-" + versionInfo.getMinecraftVersion() + ".jar" );
copyJar( "Minetick/MinetickMod/target", "minetick", "minetick-" + versionInfo.getMinecraftVersion() + ".jar" );
}
}

Expand Down Expand Up @@ -622,7 +622,7 @@ public static void disableHttpsCertificateCheck()
@Override
public java.security.cert.X509Certificate[] getAcceptedIssuers()
{
return null;
return new X509Certificate[0];
}

@Override
Expand All @@ -638,7 +638,7 @@ public void checkServerTrusted(X509Certificate[] certs, String authType)
};

// Trust SSL certs
SSLContext sc = SSLContext.getInstance( "SSL" );
SSLContext sc = SSLContext.getInstance( "TLS" );
sc.init( null, trustAllCerts, new SecureRandom() );
HttpsURLConnection.setDefaultSSLSocketFactory( sc.getSocketFactory() );

Expand Down

0 comments on commit 98d15fa

Please sign in to comment.