Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Gradle 6.3 * Enable Gradle module metadata in all modules * Workaround for gradle/gradle#11412 * Fix invalid mutation of a tasks's dependsOn w/Gradle 6.3 * Rename root MPP module and publish the JVM JAR within * Rename the JVM module: empty suffix -> '-jvm'; * Rename the root MPP module: '-native' -> empty suffix; * Publish the JVM JAR and POM in the root MPP module, so that consumers who can't read Gradle module metadata, such as Maven or old Gradle versions, get the JVM resolution result from the root MPP module. * Enable HMPP * Add jvm attribute to detached configuration Otherwise variant-aware resolution fails to find compatible variant in kotlinx-coroutines-core * Enable HMPP conditionally for Kotlin 1.4.x and not 1.3.7x * Workaround KT-39037 * Disable PrecompiledDebugProbesTest test in train builds * Conditionally hack out the Gradle module metadata with Kotlin 1.3.7x * Conditionally rename Kotlin metadata module to *-metadata with Kotlin 1.4.x * Conditionally rename the root & JVM modules with Kotlin 1.4.x Co-authored-by: Dmitry Savvinov <dmitry.savvinov@jetbrains.com> Co-authored-by: Vsevolod Tolstopyatov <qwwdfsad@gmail.com>
- Loading branch information
1 parent
1eeed50
commit 17248c8
Showing
7 changed files
with
102 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
* Copyright 2014-2020 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. | ||
*/ | ||
|
||
|
||
/* | ||
* Publish the platform JAR and POM so that consumers who depend on this module and can't read Gradle module metadata | ||
* can still get the platform artifact and transitive dependencies from the POM. | ||
* | ||
* See the full rationale here https://youtrack.jetbrains.com/issue/KMM-237#focus=streamItem-27-4115233.0-0 | ||
*/ | ||
project.ext.publishPlatformArtifactsInRootModule = { platformPublication -> | ||
def platformPomBuilder = null | ||
|
||
platformPublication.pom.withXml { platformPomBuilder = asString() } | ||
|
||
publishing.publications.kotlinMultiplatform { | ||
platformPublication.artifacts.forEach { | ||
artifact(it) | ||
} | ||
|
||
pom.withXml { | ||
def pomStringBuilder = asString() | ||
pomStringBuilder.setLength(0) | ||
// The platform POM needs its artifact ID replaced with the artifact ID of the root module: | ||
def platformPomString = platformPomBuilder.toString() | ||
platformPomString.eachLine { line -> | ||
if (!line.contains("<!--")) { // Remove the Gradle module metadata marker as it will be added anew | ||
pomStringBuilder.append(line.replace(platformPublication.artifactId, artifactId)) | ||
pomStringBuilder.append("\n") | ||
} | ||
} | ||
} | ||
} | ||
|
||
tasks.matching { it.name == "generatePomFileForKotlinMultiplatformPublication"}.configureEach { | ||
dependsOn(tasks["generatePomFileFor${platformPublication.name.capitalize()}Publication"]) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters