Improve build process

This commit is contained in:
md_5 2020-04-22 11:50:23 +10:00
parent a8ec1d60f3
commit e1335932a7
2 changed files with 21 additions and 11 deletions

28
pom.xml
View file

@ -14,9 +14,6 @@
<api.version>unknown</api.version>
<minecraft.version>1.15.2</minecraft.version>
<minecraft_version>1_15_R1</minecraft_version>
<buildtag.prefix>git-Bukkit-</buildtag.prefix>
<buildtag.suffix></buildtag.suffix>
<maven.build.timestamp.format>yyyyMMdd-HHmm</maven.build.timestamp.format>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
@ -106,7 +103,7 @@
<plugin>
<groupId>net.md-5</groupId>
<artifactId>scriptus</artifactId>
<version>0.3.2</version>
<version>0.4.1</version>
<configuration>
<format>git-Bukkit-%s</format>
</configuration>
@ -122,14 +119,17 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
<version>3.2.0</version>
<configuration>
<archive>
<manifest>
<addDefaultEntries>false</addDefaultEntries>
</manifest>
<manifestEntries>
<Main-Class>org.bukkit.craftbukkit.Main</Main-Class>
<Implementation-Title>CraftBukkit</Implementation-Title>
<Implementation-Version>${describe}</Implementation-Version>
<Implementation-Vendor>${maven.build.timestamp}</Implementation-Vendor>
<Implementation-Vendor>${project.build.outputTimestamp}</Implementation-Vendor>
<Specification-Title>Bukkit</Specification-Title>
<Specification-Version>${api.version}</Specification-Version>
<Specification-Vendor>Bukkit Team</Specification-Vendor>
@ -160,7 +160,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.1</version>
<version>3.2.3</version>
<executions>
<execution>
<phase>package</phase>
@ -169,6 +169,16 @@
</goals>
<configuration>
<createSourcesJar>${shadeSourcesJar}</createSourcesJar>
<filters>
<filter>
<artifact>org.spigotmc:minecraft-server</artifact>
<excludes>
<exclude>com/google/common/**</exclude>
<exclude>com/google/gson/**</exclude>
<exclude>com/google/thirdparty/**</exclude>
</excludes>
</filter>
</filters>
<relocations>
<!-- Cannot be relocated as it breaks translation property keys -->
<!--
@ -271,7 +281,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>3.1.0</version>
<version>3.1.1</version>
<executions>
<execution>
<phase>process-classes</phase>
@ -288,7 +298,7 @@
<dependency>
<groupId>com.puppycrawl.tools</groupId>
<artifactId>checkstyle</artifactId>
<version>8.29</version>
<version>8.31</version>
</dependency>
</dependencies>
</plugin>

View file

@ -178,10 +178,10 @@ public class Main {
}
if (Main.class.getPackage().getImplementationVendor() != null && System.getProperty("IReallyKnowWhatIAmDoingISwear") == null) {
Date buildDate = new SimpleDateFormat("yyyyMMdd-HHmm").parse(Main.class.getPackage().getImplementationVendor());
Date buildDate = new Date(Integer.parseInt(Main.class.getPackage().getImplementationVendor()) * 1000L);
Calendar deadline = Calendar.getInstance();
deadline.add(Calendar.DAY_OF_YEAR, -14);
deadline.add(Calendar.DAY_OF_YEAR, -21);
if (buildDate.before(deadline.getTime())) {
System.err.println("*** Error, this build is outdated ***");
System.err.println("*** Please download a new build as per instructions from https://www.spigotmc.org/go/outdated-spigot ***");