@@ -5,14 +5,14 @@ plugins {
55 kotlin(" jvm" ) version " 1.9.24"
66 kotlin(" plugin.serialization" ) version " 1.9.24"
77 id(" com.ncorti.ktfmt.gradle" ) version " 0.25.0"
8+ id(" com.vanniktech.maven.publish" ) version " 0.30.0"
89 application
9- `maven- publish`
1010 signing
1111}
1212
1313group = " org.iota"
1414
15- version = " 1.0-SNAPSHOT "
15+ version = " 0.0.1-alpha.1 "
1616
1717repositories { mavenCentral() }
1818
@@ -88,8 +88,6 @@ tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
8888 " -Xno-receiver-assertions" ,
8989 // Add these flags to help with recursive type issues
9090 " -Xtype-enhancement-improvements-strict-mode=false" ,
91- " -Xskip-runtime-version-check" ,
92- " -Xlenient-function-type-parameter-checks" ,
9391 )
9492 allWarningsAsErrors = false
9593 suppressWarnings = true
@@ -109,67 +107,43 @@ tasks.register("compileWithErrors") {
109107 }
110108}
111109
112- publishing {
113- publications {
114- create<MavenPublication >(" maven" ) {
115- from(components[" java" ])
116- pom {
117- name.set(" IOTA SDK Kotlin Bindings" )
118- description.set(" Kotlin bindings for the IOTA SDK" )
119- url.set(" https://github.com/iotaledger/iota-rust-sdk" )
120- licenses {
121- license {
122- name.set(" Apache-2.0" )
123- url.set(" https://www.apache.org/licenses/LICENSE-2.0.txt" )
124- }
125- }
126- developers {
127- developer {
128- id.set(" iotaledger" )
129- name.set(" IOTA Foundation" )
130- email.set(" contact@iota.org" )
131- }
132- }
133- scm {
134- connection.set(" scm:git:git://github.com/iotaledger/iota-rust-sdk.git" )
135- developerConnection.set(" scm:git:ssh://github.com/iotaledger/iota-rust-sdk.git" )
136- url.set(" https://github.com/iotaledger/iota-rust-sdk" )
137- }
110+ mavenPublishing {
111+ publishToMavenCentral(com.vanniktech.maven.publish.SonatypeHost .CENTRAL_PORTAL )
112+ signAllPublications()
113+
114+ coordinates(" org.iota" , " iota-sdk" , version.toString())
115+
116+ pom {
117+ name.set(" IOTA SDK Kotlin Bindings" )
118+ description.set(" Kotlin bindings for the IOTA SDK" )
119+ url.set(" https://github.com/iotaledger/iota-rust-sdk" )
120+ licenses {
121+ license {
122+ name.set(" Apache-2.0" )
123+ url.set(" https://www.apache.org/licenses/LICENSE-2.0.txt" )
138124 }
139125 }
140- }
141- repositories {
142- maven {
143- name = " ossrh"
144- url =
145- uri(
146- if (version.toString().endsWith(" SNAPSHOT" )) {
147- " https://s01.oss.sonatype.org/content/repositories/snapshots/"
148- } else {
149- " https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
150- }
151- )
152- val sonatypeUsername =
153- providers.environmentVariable(" ORG_GRADLE_PROJECT_SONATYPE_USERNAME" )
154- val sonatypePassword =
155- providers.environmentVariable(" ORG_GRADLE_PROJECT_SONATYPE_PASSWORD" )
156- if (sonatypeUsername.isPresent && sonatypePassword.isPresent) {
157- credentials {
158- username = sonatypeUsername.get()
159- password = sonatypePassword.get()
160- }
126+ developers {
127+ developer {
128+ id.set(" iotaledger" )
129+ name.set(" IOTA Foundation" )
130+ email.set(" contact@iota.org" )
161131 }
162132 }
133+ scm {
134+ connection.set(" scm:git:git://github.com/iotaledger/iota-rust-sdk.git" )
135+ developerConnection.set(" scm:git:ssh://github.com/iotaledger/iota-rust-sdk.git" )
136+ url.set(" https://github.com/iotaledger/iota-rust-sdk" )
137+ }
163138 }
164139}
165140
166141signing {
167- val signingKeyEncoded =
168- providers.environmentVariable( " ORG_GRADLE_PROJECT_BASE64_ENCODED_ASCII_ARMORED_SIGNING_KEY " )
169- val signingPassword = providers.environmentVariable(" ORG_GRADLE_PROJECT_SIGNING_PASSWORD " )
142+ val signingKeyEncoded = providers.environmentVariable( " ORG_GRADLE_PROJECT_signingInMemoryKey " )
143+ val signingPassword =
144+ providers.environmentVariable(" ORG_GRADLE_PROJECT_signingInMemoryKeyPassword " )
170145 if (signingKeyEncoded.isPresent && signingPassword.isPresent) {
171146 val signingKey = String (Base64 .getDecoder().decode(signingKeyEncoded.get()))
172147 useInMemoryPgpKeys(signingKey, signingPassword.get())
173- sign(publishing.publications[" maven" ])
174148 }
175149}
0 commit comments