Skip to content

Commit 3b63b02

Browse files
e5lcy6erGn0m
authored andcommitted
Keep metadata only in native target
1 parent 7db74d7 commit 3b63b02

File tree

2 files changed

+16
-21
lines changed

2 files changed

+16
-21
lines changed

gradle/native.gradle

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,12 @@ kotlin {
33
if (project.ext.ideaActive) {
44
fromPreset(project.ext.ideaPreset, 'native')
55
} else {
6-
if (project.ext.isLinuxHost) {
7-
fromPreset(presets.linuxX64, 'linuxX64')
8-
}
9-
if (project.ext.isMacosHost) {
10-
fromPreset(presets.iosArm64, 'iosArm64')
11-
fromPreset(presets.iosArm32, 'iosArm32')
12-
fromPreset(presets.iosX64, 'iosX64')
13-
fromPreset(presets.macosX64, 'macosX64')
14-
}
15-
if (project.ext.isWinHost) {
16-
fromPreset(presets.mingwX64, 'windowsX64')
17-
}
6+
fromPreset(presets.linuxX64, 'linuxX64')
7+
fromPreset(presets.iosArm64, 'iosArm64')
8+
fromPreset(presets.iosArm32, 'iosArm32')
9+
fromPreset(presets.iosX64, 'iosX64')
10+
fromPreset(presets.macosX64, 'macosX64')
11+
fromPreset(presets.mingwX64, 'windowsX64')
1812
}
1913
}
2014

gradle/publish.gradle

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ task stubJavadoc(type: Jar) {
1818
publishing {
1919
repositories {
2020
maven { url = 'https://kotlin.bintray.com/kotlinx' }
21-
maven { name = "testLocal"; url = "$rootProject.buildDir/m2"}
21+
maven { name = "testLocal"; url = "$rootProject.buildDir/m2" }
2222
}
2323
publications.all {
2424
pom.withXml(configureMavenCentralMetadata)
@@ -30,7 +30,7 @@ publishing {
3030
from kotlin.sourceSets.commonMain.kotlin
3131
}
3232

33-
it.artifactId = "$project.name"
33+
it.artifactId = "$project.name-native"
3434
it.artifact stubJavadoc
3535
it.artifact sourcesJar
3636
break
@@ -40,16 +40,17 @@ publishing {
4040
}
4141
}
4242

43-
kotlin.targets.forEach { target ->
44-
def publication = publications.findByName(target.name)
43+
kotlin.targets.all { target ->
44+
def publication = publishing.publications.findByName(target.name)
45+
4546
if (publication != null) {
4647
publication.artifact stubJavadoc
47-
}
4848

49-
if (target.platformType.name != 'native') {
50-
publication.gradleModuleMetadataFile = null
51-
tasks.matching { it.name == "generateMetadataFileFor${name.capitalize()}Publication" }.all {
52-
onlyIf { false }
49+
if (target.platformType.name != 'native') {
50+
publication.gradleModuleMetadataFile = null
51+
tasks.matching { it.name == "generateMetadataFileFor${name.capitalize()}Publication" }.all {
52+
onlyIf { false }
53+
}
5354
}
5455
}
5556
}

0 commit comments

Comments
 (0)