Skip to content

Commit e86c070

Browse files
committed
1.9.0 release
1 parent 99a6fee commit e86c070

File tree

5 files changed

+41
-20
lines changed

5 files changed

+41
-20
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
- Now, this repo is powered by shadowJar for building plugins instead of the fatJar trick.
1+
- optimized `build.gradle`
2+
- Added checking frameworks.

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ This template features some cool stuff such as:
1414
- GitHub action for easier release and Jitpack usage:
1515
- You just have to run the `Release` workflow manually,
1616
it will automatically take the plugin version in your plugin.json file and upload the jar.
17+
- Changelog support: edit `CHANGELOG.md` before each release, it will be used as the release text.
1718

1819
When using this template, don't forget to change `plugin.json` and `gradle.properties`.
1920

build.gradle

Lines changed: 37 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import groovy.json.JsonSlurper
2-
import org.apache.groovy.json.internal.LazyMap
32
import java.nio.charset.StandardCharsets
4-
3+
import net.ltgt.gradle.errorprone.CheckSeverity
54

65
buildscript{
76
repositories{
@@ -11,24 +10,25 @@ buildscript{
1110
dependencies{
1211
classpath "org.codehaus.groovy:groovy-json:3.0.8" // <- For JsonSlurper syntax highlighting
1312
}
13+
14+
ext{
15+
serverDirectoryPath = System.getenv("MINDUSTRY_SERVER_HOME")
16+
metadata = new JsonSlurper().parseText(file("$rootDir/plugin.json").text)
17+
18+
versions = [
19+
"mindustry": property("props.mindustry-version"),
20+
"arc": property("props.arc-version"),
21+
"junit": "5.8.2"
22+
]
23+
}
1424
}
1525

1626
plugins{
1727
id "java"
1828
id "maven-publish"
1929
id "com.github.johnrengelman.shadow" version "7.1.2"
20-
}
21-
22-
23-
ext{
24-
serverDirectoryPath = System.getenv("MINDUSTRY_SERVER_HOME")
25-
metadata = new JsonSlurper().parseText(file("$rootDir/plugin.json").text) as LazyMap
26-
27-
versions = [
28-
"mindustry": property("props.mindustry-version"),
29-
"arc": property("props.arc-version"),
30-
"junit": "5.8.2"
31-
]
30+
id "net.ltgt.errorprone" version "2.0.2"
31+
id "org.checkerframework" version "0.6.7"
3232
}
3333

3434
group property("props.project-group")
@@ -56,10 +56,17 @@ dependencies{
5656
testImplementation "org.junit.jupiter:junit-jupiter-params:${versions.junit}"
5757
testImplementation "org.junit.jupiter:junit-jupiter-api:${versions.junit}"
5858
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:${versions.junit}"
59+
60+
// Annotations
61+
compileOnly "org.checkerframework:checker-qual:3.21.1"
62+
annotationProcessor "com.uber.nullaway:nullaway:0.9.4"
63+
errorprone "com.google.errorprone:error_prone_core:2.10.0"
64+
errorproneJavac "com.google.errorprone:javac:9+181-r4173-1"
5965
}
6066

6167
java{
6268
withSourcesJar()
69+
withJavadocJar()
6370
}
6471

6572
test{
@@ -70,8 +77,16 @@ tasks.withType(JavaCompile).configureEach {
7077
sourceCompatibility = JavaVersion.VERSION_16
7178
targetCompatibility = JavaVersion.VERSION_16
7279
options.encoding = StandardCharsets.UTF_8
73-
}
7480

81+
options.errorprone.with{
82+
disableWarningsInGeneratedCode = true
83+
disable "MissingSummary"
84+
if(!name.containsIgnoreCase("test")){
85+
check("NullAway", CheckSeverity.ERROR)
86+
option("NullAway:AnnotatedPackages", "fr.xpdustry.template")
87+
}
88+
}
89+
}
7590

7691
shadowJar{
7792
from "$rootDir/plugin.json"
@@ -115,9 +130,15 @@ task getArtifactPath{
115130
doLast{ println shadowJar.archiveFile.get().toString() }
116131
}
117132

133+
// Avoid publishing shadow artifacts to maven repo
134+
// > https://github.com/johnrengelman/shadow/issues/651
135+
components.withType(AdhocComponentWithVariants).forEach { c ->
136+
c.withVariantsFromConfiguration(configurations.shadowRuntimeElements) {skip() }
137+
}
138+
118139
publishing{
119140
publications{
120-
create("jitpack", MavenPublication){
141+
create("maven", MavenPublication){
121142
from components.java
122143

123144
pom{

plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"displayName": "Xpdustry TemplatePlugin",
44
"author": "Xpdustry",
55
"description": "A template plugin for easier development, enjoy.",
6-
"version": "1.8",
6+
"version": "1.9.0",
77
"minGameVersion": "105",
88
"hidden": true,
99
"java": true,

src/main/java/fr/xpdustry/template/TemplatePlugin.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,13 @@ public void init(){
1616

1717
/**
1818
* This method is called when the game register the server-side commands.
19-
* Make sure your plugin don't load the commands twice by adding a simple boolean check.
2019
*/
2120
@Override
2221
public void registerServerCommands(CommandHandler handler){
2322
}
2423

2524
/**
2625
* This method is called when the game register the client-side commands.
27-
* Make sure your plugin don't load the commands twice by adding a simple boolean check.
2826
*/
2927
@Override
3028
public void registerClientCommands(CommandHandler handler){

0 commit comments

Comments
 (0)