1- import org.gradle.api.tasks.javadoc.Javadoc
2- import org.gradle.external.javadoc.StandardJavadocDocletOptions
3- import org.gradle.kotlin.dsl.compileJava
4- import org.gradle.kotlin.dsl.invoke
5-
6- @Suppress(" DSL_SCOPE_VIOLATION" ) // https://youtrack.jetbrains.com/issue/IDEA-262280
1+ import com.vanniktech.maven.publish.MavenPublishBaseExtension
72
83plugins {
94 id(" java-library" )
10- id(" maven-publish" )
11- id(" signing" )
12- alias(libs.plugins.lombok)
5+ alias(libs.plugins.lombok) apply false
6+ alias(libs.plugins.publish) apply false
137}
148
159tasks.jar {
1610 enabled = false
1711}
1812
1913subprojects {
14+ apply (plugin = " java-library" )
15+ apply (plugin = rootProject.libs.plugins.lombok.get().pluginId)
16+ apply (plugin = rootProject.libs.plugins.publish.get().pluginId)
2017
21- apply {
22- plugin(" java-library" )
23- plugin(" maven-publish" )
24- plugin(" signing" )
25- plugin(rootProject.libs.plugins.lombok.get().pluginId)
26- }
27-
28- group = " org.cloudburstmc.protocol"
18+ group = " org.allaymc.protocol"
19+ version = rootProject.version
2920
3021 tasks {
31- compileJava {
32- options.encoding = Charsets .UTF_8 .name();
22+ withType< JavaCompile >().configureEach {
23+ options.encoding = Charsets .UTF_8 .name()
3324 options.compilerArgs.add(" -parameters" )
3425 }
26+
3527 withType<Javadoc >().configureEach {
3628 (options as StandardJavadocDocletOptions ).addBooleanOption(" Xdoclint:-missing" , true )
3729 }
30+
3831 test {
3932 useJUnitPlatform()
4033 }
4134 }
4235
36+ repositories {
37+ mavenCentral()
38+ maven(" https://repo.opencollab.dev/maven-releases/" )
39+ maven(" https://repo.opencollab.dev/maven-snapshots/" )
40+ }
41+
4342 dependencies {
4443 compileOnly(rootProject.libs.checker.qual)
4544 }
@@ -52,57 +51,46 @@ subprojects {
5251 }
5352 }
5453
55- publishing {
56- repositories {
57- maven {
58- name = " maven-deploy"
59- url = uri(
60- System .getenv(" MAVEN_DEPLOY_URL" )
61- ? : " https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
62- )
63- credentials {
64- username = System .getenv(" MAVEN_DEPLOY_USERNAME" ) ? : " username"
65- password = System .getenv(" MAVEN_DEPLOY_PASSWORD" ) ? : " password"
66- }
54+ configure<MavenPublishBaseExtension > {
55+ publishToMavenCentral()
56+ signAllPublications()
57+
58+ coordinates(
59+ project.group.toString(),
60+ project.name,
61+ project.version.toString()
62+ )
63+
64+ pom {
65+ name.set(project.name)
66+ description.set(" A protocol library for Minecraft: Bedrock Edition that supports multiple versions." )
67+ url.set(" https://github.com/AllayMC/Protocol" )
68+
69+ scm {
70+ connection.set(" scm:git:git://github.com/AllayMC/Protocol.git" )
71+ developerConnection.set(" scm:git:ssh://github.com/AllayMC/Protocol.git" )
72+ url.set(" https://github.com/AllayMC/Protocol" )
6773 }
68- }
6974
70- publications {
71- create<MavenPublication >(" maven" ) {
72- from(components[" java" ])
73- pom {
74- packaging = " jar"
75- url.set(" https://github.com/CloudburstMC/Protocol" )
76-
77- scm {
78- connection.set(" scm:git:git://github.com/CloudburstMC/Protocol.git" )
79- developerConnection.set(" scm:git:ssh://github.com/CloudburstMC/Protocol.git" )
80- url.set(" https://github.com/CloudburstMC/Protocol" )
81- }
82-
83- licenses {
84- license {
85- name.set(" The Apache Software License, Version 2.0" )
86- url.set(" https://www.apache.org/licenses/LICENSE-2.0.txt" )
87- }
88- }
89-
90- developers {
91- developer {
92- name.set(" CloudburstMC Team" )
93- organization.set(" CloudburstMC" )
94- organizationUrl.set(" https://github.com/CloudburstMC" )
95- }
96- }
75+ licenses {
76+ license {
77+ name.set(" The Apache Software License, Version 2.0" )
78+ url.set(" https://www.apache.org/licenses/LICENSE-2.0.txt" )
9779 }
9880 }
99- }
100- }
10181
102- signing {
103- if (System .getenv(" PGP_SECRET" ) != null && System .getenv(" PGP_PASSPHRASE" ) != null ) {
104- useInMemoryPgpKeys(System .getenv(" PGP_SECRET" ), System .getenv(" PGP_PASSPHRASE" ))
105- sign(publishing.publications[" maven" ])
82+ developers {
83+ developer {
84+ name.set(" CloudburstMC Team" )
85+ organization.set(" CloudburstMC" )
86+ organizationUrl.set(" https://github.com/CloudburstMC" )
87+ }
88+ developer {
89+ name.set(" AllayMC Team" )
90+ organization.set(" AllayMC" )
91+ organizationUrl.set(" https://github.com/AllayMC" )
92+ }
93+ }
10694 }
10795 }
10896}
0 commit comments