1-
21// //////////////////////////////////////////////////////////////////////////////////////////
32// This file is generated by Speakeasy and any edits will be lost in generation updates.
43//
98// of string where each string value is an additional line in the block) in gen.yaml.
109// //////////////////////////////////////////////////////////////////////////////////////////
1110
11+
1212plugins {
1313 // Apply the java-library plugin for API and implementation separation.
1414 id ' java-library'
1515 id ' maven-publish'
1616 id ' signing'
17+ // V2 publishing plugin (Sonatype Central Portal)
1718 id ' cl.franciscosolis.sonatype-central-upload' version ' 1.0.3'
19+ id " io.spring.dependency-management" version " 1.1.6" apply false
1820}
1921
2022compileJava. options. encoding = " UTF-8"
@@ -31,21 +33,18 @@ java {
3133 withJavadocJar()
3234}
3335
34- model {
35- tasks. generatePomFileForMavenPublication {
36- destination = file(" $buildDir /pom.xml" )
37- }
38- }
39-
4036version = " ${ version} "
4137group = " ${ groupId} "
4238
4339jar {
44- dependsOn( " : generatePomFileForMavenPublication" )
40+ dependsOn ' generatePomFileForMavenPublication'
4541 archiveBaseName = " ${ artifactId} "
4642
4743 into(" META-INF/maven/dev.hathora/cloud-sdk" ) {
48- from(" $buildDir /pom.xml" )
44+ from(layout. buildDirectory. file(" pom.xml" )) {
45+ // Only include if it exists to avoid build ordering issues
46+ duplicatesStrategy = DuplicatesStrategy . INCLUDE
47+ }
4948 }
5049}
5150
@@ -58,7 +57,7 @@ javadoc {
5857 options. addStringOption(' Xdoclint:none' , ' -quiet' )
5958}
6059
61- tasks. withType(Javadoc ) {
60+ tasks. withType(Javadoc ). configureEach {
6261 failOnError = false
6362 options. addStringOption(' Xdoclint:none' , ' -quiet' )
6463}
@@ -74,85 +73,6 @@ sourcesJar {
7473javadocJar {
7574 archiveBaseName = " ${ artifactId} "
7675}
77- sonatypeCentralUpload {
78- // This is your Sonatype generated username
79- username = System . getenv(" SONATYPE_USERNAME" )
80- // This is your sonatype generated password
81- password = System . getenv(" SONATYPE_PASSWORD" )
82-
83- // This is a list of files to upload. Ideally you would point to your jar file, source and javadoc jar (required by central)
84- archives = files(
85- " $buildDir /libs/${ artifactId} -${ version} .jar" ,
86- " $buildDir /libs/${ artifactId} -${ version} -sources.jar" ,
87- " $buildDir /libs/${ artifactId} -${ version} -javadoc.jar"
88- )
89-
90- // This is the pom file to upload. This is required by central
91- pom = file(" $buildDir /pom.xml" )
92-
93- // This is your PGP private key. This is required to sign your files
94- signingKey = System . getenv(" SONATYPE_SIGNING_KEY" )
95- // This is your PGP private key passphrase to decrypt your private key
96- signingKeyPassphrase = System . getenv(" SIGNING_KEY_PASSPHRASE" )
97- }
98-
99-
100- publishing {
101-
102- publications {
103- maven(MavenPublication ) {
104- // note that properties can't yet be used below!
105- // https://github.com/gradle/gradle/issues/18619
106- groupId = " dev.hathora"
107- artifactId = " cloud-sdk"
108- version = " 3.2.0"
109-
110- from components. java
111-
112- pom {
113- properties = [
114- ' maven.compiler.source' : ' 11' ,
115- ' maven.compiler.target' : ' 11' ,
116- ]
117- name = ' Hathora Java SDK'
118- description = ' SDK enabling Java developers to easily integrate with the Hathora API.'
119- url = ' https://github.com/hathora/cloud-sdk-java'
120- scm {
121- url = ' github.com/hathora/cloud-sdk-java'
122- connection = ' scm:git:ssh://git@github.com/hathora/cloud-sdk-java.git'
123- }
124- licenses {
125- license {
126- name = ' The MIT License (MIT)'
127- url = ' https://mit-license.org/'
128- }
129- }
130- developers {
131- developer {
132- name = ' Hathora'
133- organization = ' Hathora'
134- email = ' hello@hathora.dev'
135- }
136- }
137- organization {
138- name = ' Hathora'
139- url = ' https://hathora.dev/'
140- }
141- }
142- }
143- }
144- }
145-
146- if (! project. hasProperty(' skip.signing' )) {
147- signing {
148- def signingKey = findProperty(" signingKey" )
149- def signingPassphrase = findProperty(" signingPassphrase" )
150- useInMemoryPgpKeys(signingKey, signingPassphrase)
151- sign publishing. publications. maven
152- }
153- }
154-
155-
15676
15777dependencies {
15878 testImplementation ' org.junit.jupiter:junit-jupiter-api:5.8.1'
@@ -164,6 +84,62 @@ dependencies {
16484 implementation ' com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.18.2'
16585 api(' org.openapitools:jackson-databind-nullable:0.2.6' ) {exclude group : ' com.fasterxml.jackson.core' , module : ' jackson-databind' }
16686 implementation ' commons-io:commons-io:2.18.0'
87+ implementation ' jakarta.annotation:jakarta.annotation-api:3.0.0'
88+ api ' org.reactivestreams:reactive-streams:1.0.4'
89+ }
90+
91+ ext {
92+ springBootVersion = ' 2.7.18'
93+ }
94+
95+ subprojects {
96+ if (name in [
97+ ' cloud-sdk-spring-boot-autoconfigure' ,
98+ ' cloud-sdk-spring-boot-starter'
99+ ]) {
100+ // Ensure subprojects use the same group and version as root project
101+ group = rootProject. group
102+ version = rootProject. version
103+
104+ apply {
105+ plugin " java-library"
106+ plugin " io.spring.dependency-management"
107+ plugin " maven-publish"
108+ plugin " signing"
109+ plugin " cl.franciscosolis.sonatype-central-upload"
110+ }
111+ dependencyManagement {
112+ imports {
113+ mavenBom " org.springframework.boot:spring-boot-dependencies:${ rootProject.springBootVersion} "
114+ }
115+ }
116+ repositories {
117+ mavenCentral()
118+ }
119+ java {
120+ withSourcesJar()
121+ withJavadocJar()
122+ }
123+ tasks. withType(JavaCompile ). configureEach {
124+ options. release = 11
125+ }
126+
127+ // Apply publishing configuration to all subprojects - they'll check for publishingConfig internally
128+ apply from : rootProject. file(' publishing.gradle' )
129+ }
130+ }
131+
132+ ext {
133+ publishingConfig = [
134+ groupId : group,
135+ artifactId : artifactId,
136+ version : version,
137+ name : " Hathora Java SDK" ,
138+ description : " SDK enabling Java developers to easily integrate with the Hathora API." ,
139+ publicationName : " maven"
140+ ]
167141}
168142
143+ apply from : ' publishing.gradle'
144+
169145apply from : ' build-extras.gradle'
0 commit comments