Fix build expiration.

This commit is contained in:
md_5 2014-09-01 16:47:16 +10:00
parent 5282a8f45a
commit 4573285a70

View File

@ -3,6 +3,7 @@ package net.md_5.bungee;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.concurrent.TimeUnit;
import joptsimple.OptionParser;
@ -47,9 +48,11 @@ public class Bootstrap
if ( BungeeCord.class.getPackage().getSpecificationVersion() != null && System.getProperty( "IReallyKnowWhatIAmDoingISwear" ) == null )
{
Date buildDate = new SimpleDateFormat( "yyyyMMdd" ).parse( BungeeCord.class.getPackage().getSpecificationVersion() );
Calendar deadline = Calendar.getInstance();
deadline.add( Calendar.WEEK_OF_YEAR, 2 );
if ( Calendar.getInstance().after( new SimpleDateFormat( "yyyyMMdd" ).parse( BungeeCord.class.getPackage().getSpecificationVersion() ) ) )
deadline.add( Calendar.WEEK_OF_YEAR, -3 );
if ( buildDate.before( deadline.getTime() ) )
{
System.err.println( "*** Warning, this build is outdated ***" );
System.err.println( "*** Please download a new build from http://ci.md-5.net/job/BungeeCord ***" );