mirror of
https://github.com/InsanusMokrassar/KotlinPublicationScriptsBuilder.git
synced 2025-09-04 15:39:17 +00:00
Compare commits
2 Commits
build-abb2
...
build-c954
Author | SHA1 | Date | |
---|---|---|---|
c954e2cf42 | |||
ffe0f3f33b |
@@ -6,7 +6,9 @@ const val generateCentralSonatypeUploadingPartImports = """import java.nio.chars
|
|||||||
import java.net.http.HttpClient
|
import java.net.http.HttpClient
|
||||||
import java.net.http.HttpRequest
|
import java.net.http.HttpRequest
|
||||||
import java.net.http.HttpResponse"""
|
import java.net.http.HttpResponse"""
|
||||||
const val generateCentralSonatypeUploadingPart = """if ((project.hasProperty('SONATYPE_USER') || System.getenv('SONATYPE_USER') != null) && (project.hasProperty('SONATYPE_PASSWORD') || System.getenv('SONATYPE_PASSWORD') != null)) {
|
const val generateCentralSonatypeUploadingPart = """// This script work based on https://ossrh-staging-api.central.sonatype.com/swagger-ui/#/default/manual_upload_repository
|
||||||
|
// and getting available open repos and just uploading them
|
||||||
|
if ((project.hasProperty('SONATYPE_USER') || System.getenv('SONATYPE_USER') != null) && (project.hasProperty('SONATYPE_PASSWORD') || System.getenv('SONATYPE_PASSWORD') != null)) {
|
||||||
def taskName = "uploadSonatypePublication"
|
def taskName = "uploadSonatypePublication"
|
||||||
if (rootProject.tasks.names.contains(taskName) == false) {
|
if (rootProject.tasks.names.contains(taskName) == false) {
|
||||||
rootProject.tasks.register(taskName) {
|
rootProject.tasks.register(taskName) {
|
||||||
@@ -39,7 +41,7 @@ const val generateCentralSonatypeUploadingPart = """if ((project.hasProperty('SO
|
|||||||
.build()
|
.build()
|
||||||
def uploadResponse = client.send(uploadRequest, HttpResponse.BodyHandlers.ofString())
|
def uploadResponse = client.send(uploadRequest, HttpResponse.BodyHandlers.ofString())
|
||||||
if (uploadResponse.statusCode() != 200) {
|
if (uploadResponse.statusCode() != 200) {
|
||||||
throw IllegalStateException("Faced error of uploading for repo with key ${"$"}it. Response: ${"$"}uploadResponse")
|
throw new IllegalStateException("Faced error of uploading for repo with key ${"$"}it. Response: ${"$"}uploadResponse")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -61,11 +61,11 @@ publishing {
|
|||||||
""" }}
|
""" }}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
repositories {
|
repositories {
|
||||||
${repositories.joinToString("\n ") { it.build(" ") }}
|
${repositories.joinToString("\n ") { it.build(" ") }}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
${gpgSigning.generateMavenConfig()}
|
${gpgSigning.generateMavenConfig()}
|
||||||
""".trimIndent()
|
""".trimIndent()
|
||||||
|
@@ -58,11 +58,11 @@ publishing {
|
|||||||
""" }}
|
""" }}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
repositories {
|
repositories {
|
||||||
${repositories.joinToString("\n ") { it.build(" ") }}
|
${repositories.joinToString("\n ") { it.build(" ") }}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
${gpgSigning.generateMavenConfig()}
|
${gpgSigning.generateMavenConfig()}
|
||||||
""".trimIndent()
|
""".trimIndent()
|
||||||
|
@@ -42,10 +42,10 @@ publishing {
|
|||||||
}""" }}
|
}""" }}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
repositories {
|
repositories {
|
||||||
${repositories.joinToString("\n ") { it.build(" ") }}
|
${repositories.joinToString("\n ") { it.build(" ") }}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
${gpgSigning.generateMavenConfig()}
|
${gpgSigning.generateMavenConfig()}
|
||||||
""".trimIndent()
|
""".trimIndent()
|
||||||
|
Reference in New Issue
Block a user