mirror of
https://github.com/jlengrand/compose-multiplatform.git
synced 2026-03-10 08:11:20 +00:00
Fix build helpers publishing (#1416)
* Fix compatibility with Intellij 2021.3 Resolves #1373 * Use Java reflection * Set Java source & target compatibility for build helpers Otherwise, Gradle might set Gradle metadata attributes in such way, that transitive dependencies of published modules are not resolved * Configure shadow jar manually Applying plugin configures additional publication, so that both .jar and -shadow.jar are published, and additional configurations are added to Gradle metadata. To avoid unexpected metadata resolution results, ShadowJar task is now configured manually * Fix closeStagingRepo JSON request * Update publishing build-helpers in compose
This commit is contained in:
@@ -14,6 +14,8 @@ subprojects {
|
||||
plugins.withType(JavaBasePlugin::class.java) {
|
||||
afterEvaluate {
|
||||
configureIfExists<JavaPluginExtension> {
|
||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||
targetCompatibility = JavaVersion.VERSION_1_8
|
||||
if (sourceSets.names.contains(SourceSet.MAIN_SOURCE_SET_NAME)) {
|
||||
withJavadocJar()
|
||||
withSourcesJar()
|
||||
|
||||
@@ -6,7 +6,7 @@ plugins {
|
||||
`maven-publish`
|
||||
`java-gradle-plugin`
|
||||
id("org.jetbrains.kotlin.jvm")
|
||||
id("com.github.johnrengelman.shadow")
|
||||
id("com.github.johnrengelman.shadow") apply false
|
||||
}
|
||||
|
||||
repositories {
|
||||
@@ -34,7 +34,7 @@ dependencies {
|
||||
embedded("de.undercouch:gradle-download-task:4.1.2")
|
||||
}
|
||||
|
||||
val shadow = tasks.named<ShadowJar>("shadowJar") {
|
||||
val shadowJar by tasks.registering(ShadowJar::class) {
|
||||
val fromPackage = "de.undercouch"
|
||||
val toPackage = "org.jetbrains.compose.internal.publishing.$fromPackage"
|
||||
relocate(fromPackage, toPackage)
|
||||
@@ -44,7 +44,7 @@ val shadow = tasks.named<ShadowJar>("shadowJar") {
|
||||
}
|
||||
|
||||
val jar = tasks.named<Jar>("jar") {
|
||||
dependsOn(shadow)
|
||||
from(zipTree(shadow.get().archiveFile))
|
||||
dependsOn(shadowJar)
|
||||
from(zipTree(shadowJar.get().archiveFile))
|
||||
this.duplicatesStrategy = DuplicatesStrategy.INCLUDE
|
||||
}
|
||||
@@ -80,7 +80,8 @@ class SonatypeRestApiClient(
|
||||
logger.info("Closing repository '${repo.id}'")
|
||||
buildRequest("service/local/staging/bulk/close") {
|
||||
val request = "{\"data\":{\"stagedRepositoryIds\":[\"${repo.id}\"]}}"
|
||||
post(Xml.serialize(request).toRequestBody(Json.mediaType))
|
||||
post(request.toRequestBody(Json.mediaType))
|
||||
.addHeader("Accept", Json.mediaType.toString())
|
||||
}.execute { responseBody ->
|
||||
logger.info("Finished closing repository '${repo.id}': '${responseBody.string()}'")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user