Reorder MPP plugin logic to fix eager publishing configuration
In Gradle 5.0, the `publishing` extension is configured eagerly, so we need to make sure everything we use in publishing setup is already available at the point when it's triggered: * the `metadata` target * the source JARs Issue #KT-28520 Fixed
This commit is contained in:
+12
@@ -188,6 +188,18 @@ class NewMultiplatformIT : BaseGradleIT() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun testMavenPublishAppliedBeforeMultiplatformPlugin() =
|
||||||
|
with(Project("sample-lib", GradleVersionRequired.AtLeast("5.0"), "new-mpp-lib-and-app")) {
|
||||||
|
setupWorkingDir()
|
||||||
|
|
||||||
|
gradleBuildScript().modify { "apply plugin: 'maven-publish'\n$it" }
|
||||||
|
|
||||||
|
build {
|
||||||
|
assertSuccessful()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun testResourceProcessing() = with(Project("sample-lib", gradleVersion, "new-mpp-lib-and-app")) {
|
fun testResourceProcessing() = with(Project("sample-lib", gradleVersion, "new-mpp-lib-and-app")) {
|
||||||
val targetsWithResources = listOf("jvm6", "nodeJs", "wasm32", nativeHostTargetName)
|
val targetsWithResources = listOf("jvm6", "nodeJs", "wasm32", nativeHostTargetName)
|
||||||
|
|||||||
+3
-2
@@ -80,14 +80,15 @@ class KotlinMultiplatformPlugin(
|
|||||||
configureSourceSets(project)
|
configureSourceSets(project)
|
||||||
|
|
||||||
setUpConfigurationAttributes(project)
|
setUpConfigurationAttributes(project)
|
||||||
configurePublishingWithMavenPublish(project)
|
|
||||||
configureSourceJars(project)
|
|
||||||
|
|
||||||
// set up metadata publishing
|
// set up metadata publishing
|
||||||
targetsFromPreset.fromPreset(
|
targetsFromPreset.fromPreset(
|
||||||
KotlinMetadataTargetPreset(project, instantiator, fileResolver, kotlinPluginVersion),
|
KotlinMetadataTargetPreset(project, instantiator, fileResolver, kotlinPluginVersion),
|
||||||
METADATA_TARGET_NAME
|
METADATA_TARGET_NAME
|
||||||
)
|
)
|
||||||
|
configureSourceJars(project)
|
||||||
|
|
||||||
|
configurePublishingWithMavenPublish(project)
|
||||||
|
|
||||||
// propagate compiler plugin options to the source set language settings
|
// propagate compiler plugin options to the source set language settings
|
||||||
setupCompilerPluginOptions(project)
|
setupCompilerPluginOptions(project)
|
||||||
|
|||||||
Reference in New Issue
Block a user