1- import org.cadixdev.gradle.licenser.Licenser
21import org.cadixdev.gradle.licenser.LicenseExtension
32
43plugins {
5- id(" java" )
6- id(" java-library" )
7- id(" maven-publish" )
4+ java
5+ `java- library`
6+ `maven- publish`
7+ signing
8+
89 id(" org.cadixdev.licenser" ) version " 0.6.1"
910}
1011
11- the<JavaPluginExtension >().toolchain {
12- languageVersion.set(JavaLanguageVersion .of(8 ))
12+ java {
13+ toolchain.languageVersion.set(JavaLanguageVersion .of(16 ))
14+ }
15+
16+ tasks.compileJava.configure {
17+ options.release.set(8 )
18+ }
19+
20+ configurations.all {
21+ attributes.attribute(TargetJvmVersion .TARGET_JVM_VERSION_ATTRIBUTE , 16 )
1322}
1423
15- group = " me.arcaniax"
16- version = " 1.2.1-SNAPSHOT"
24+ group = " com.arcaniax"
25+ version = " 1.3.0"
26+
27+ var versuffix by extra(" SNAPSHOT" )
28+ version = if (! project.hasProperty(" release" )) {
29+ String .format(" %s-%s" , project.version, versuffix)
30+ } else {
31+ String .format(project.version as String )
32+ }
1733
1834repositories {
1935 mavenCentral()
2036 maven {
21- name = " Spigot "
22- url = uri(" https://hub.spigotmc.org/nexus/content/repositories/snapshots " )
37+ name = " PaperMC "
38+ url = uri(" https://papermc.io/repo/repository/maven-public/ " )
2339 }
2440}
2541
2642dependencies {
27- compileOnlyApi(" org.spigotmc:spigot -api:1.16.5 -R0.1-SNAPSHOT" )
43+ compileOnlyApi(" io.papermc.paper:paper -api:1.17.1 -R0.1-SNAPSHOT" )
2844}
2945
3046configure<LicenseExtension > {
@@ -33,23 +49,7 @@ configure<LicenseExtension> {
3349 newLine.set(false )
3450}
3551
36- val javadocDir = rootDir.resolve(" docs" ).resolve(" javadoc" )
3752tasks {
38- val assembleTargetDir = create<Copy >(" assembleTargetDirectory" ) {
39- destinationDir = rootDir.resolve(" target" )
40- into(destinationDir)
41- from(withType<Jar >())
42- }
43- named(" build" ) {
44- dependsOn(assembleTargetDir)
45- }
46-
47- named<Delete >(" clean" ) {
48- doFirst {
49- rootDir.resolve(" target" ).deleteRecursively()
50- javadocDir.deleteRecursively()
51- }
52- }
5353
5454 compileJava {
5555 options.compilerArgs.addAll(arrayOf(" -Xmaxerrs" , " 1000" ))
@@ -68,7 +68,7 @@ tasks {
6868 " implSpec:a:Implementation Requirements:" ,
6969 " implNote:a:Implementation Note:"
7070 )
71- opt.destinationDirectory = javadocDir
71+ opt.links( " https://papermc.io/javadocs/paper/1.17/ " )
7272 }
7373}
7474
@@ -77,13 +77,32 @@ java {
7777 withJavadocJar()
7878}
7979
80+ signing {
81+ if (! version.toString().endsWith(" -SNAPSHOT" )) {
82+ signing.isRequired
83+ sign(publishing.publications)
84+ }
85+ }
86+
8087publishing {
8188 publications {
8289 create<MavenPublication >(" maven" ) {
8390 from(components[" java" ])
8491
8592 pom {
8693
94+ name.set(project.name + " " + project.version)
95+ description.set(" The API for Head Database, a Minecraft plugin that allows you to obtain thousands of custom Minecraft skulls that feature unique designs." )
96+ url.set(" https://github.com/Arcaniax-Development/HeadDatabase-API" )
97+
98+ licenses {
99+ license {
100+ name.set(" GNU General Public License, Version 3.0" )
101+ url.set(" https://www.gnu.org/licenses/gpl-3.0.html" )
102+ distribution.set(" repo" )
103+ }
104+ }
105+
87106 developers {
88107 developer {
89108 id.set(" Arcaniax" )
@@ -96,6 +115,11 @@ publishing {
96115 connection.set(" scm:https://Arcaniax-Development@github.com/Arcaniax-Development/HeadDatabase-API.git" )
97116 developerConnection.set(" scm:git://github.com/Arcaniax-Development/HeadDatabase-API.git" )
98117 }
118+
119+ issueManagement {
120+ system.set(" GitHub" )
121+ url.set(" https://github.com/Arcaniax-Development/HeadDatabase-API/issues" )
122+ }
99123 }
100124 }
101125 }
@@ -106,11 +130,13 @@ publishing {
106130 val nexusPassword: String? by project
107131 if (nexusUsername != null && nexusPassword != null ) {
108132 maven {
109- val thirdParty = " https://mvn.intellectualsites.com/content/repositories/thirdparty/"
110- val snapshotRepositoryUrl = " https://mvn.intellectualsites.com/content/repositories/snapshots/"
133+ val releasesRepositoryUrl =
134+ " https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
135+ val snapshotRepositoryUrl =
136+ " https://s01.oss.sonatype.org/content/repositories/snapshots/"
111137 url = uri(
112138 if (version.toString().endsWith(" -SNAPSHOT" )) snapshotRepositoryUrl
113- else thirdParty
139+ else releasesRepositoryUrl
114140 )
115141
116142 credentials {
0 commit comments