Mikołaj Kąkol
08/25/2020, 9:21 AM*.module
file in main lib, that contains information about every platform and calling multiple time mavenPublish
or sth similar would override that *.module
file.
So basically it comes to how to publish artifacts build on different platforms to a single lib?Big Chungus
08/25/2020, 9:27 AMBig Chungus
08/25/2020, 9:28 AMBig Chungus
08/25/2020, 9:33 AMBig Chungus
08/25/2020, 9:35 AMMikołaj Kąkol
08/25/2020, 9:35 AMBig Chungus
08/25/2020, 9:36 AMBig Chungus
08/25/2020, 9:37 AMMikołaj Kąkol
08/25/2020, 9:40 AMBig Chungus
08/25/2020, 9:50 AMMarc Knaup
08/25/2020, 10:17 AMBig Chungus
08/25/2020, 10:18 AMstageBuild:
jobWin:
jobMac:
jobLin:
stagePublish:
jobPublish:
Marc Knaup
08/25/2020, 10:20 AMMikołaj Kąkol
08/25/2020, 10:22 AMkotlin {
android {
if (OSKind.current != OSKind.OSX) {
publishLibraryVariants("release", "debug")
}
}
iosX64("ios") {
binaries {
framework {
baseName = "K14Lib"
}
}
}
sourceSets {
val commonMain by getting
val commonTest by getting
val androidMain by getting
val androidTest by getting
val iosMain by getting
val iosTest by getting
}
configure(listOf(targets["metadata"], android(), iosX64("ios"))) {
mavenPublication {
val targetPublication = this@mavenPublication
println("@@@@@@@@@@@@@@@@@@@@@@@ ${targetPublication.artifactId}")
tasks.withType<AbstractPublishToMaven>()
.matching { it.publication == targetPublication }
.all { onlyIf { OSKind.current != OSKind.OSX } }
}
}
}
artifactory {
setContextUrl("****")
publish(delegateClosureOf<org.jfrog.gradle.plugin.artifactory.dsl.PublisherConfig> {
repository(delegateClosureOf<org.jfrog.gradle.plugin.artifactory.dsl.DoubleDelegateWrapper> {
setProperty("repoKey", "libs-release-local")
setProperty("username", "publisher")
setProperty("password", "****")
setProperty("maven", true)
})
defaults(delegateClosureOf<groovy.lang.GroovyObject> {
invokeMethod("publications", arrayOf(
"androidDebug", "androidRelease", "ios", "iosArm64", "kotlinMultiplatform", "metadata"
))
})
})
}
I'm not sure if it's artifactory wrongly configured or maven partMarc Knaup
08/25/2020, 10:25 AMMikołaj Kąkol
08/25/2020, 10:27 AMaleksey.tomin
08/25/2020, 10:37 AMMarc Knaup
08/25/2020, 10:39 AMaleksey.tomin
08/25/2020, 10:51 AMtag: ${{ github.ref }}
I publish 4 artifacts - macos release/debug and windows release/debugMarc Knaup
08/25/2020, 10:52 AMaleksey.tomin
08/25/2020, 10:53 AMMikołaj Kąkol
08/25/2020, 1:08 PMval isPublishRun: String? by project
kotlin {
android {
if (OSKind.current != OSKind.OSX) {
publishLibraryVariants("release", "debug")
}
}
iosX64("ios") {
binaries {
framework {
baseName = "K14Lib"
}
}
}
sourceSets {
val commonMain by getting
val commonTest by getting
val androidMain by getting
val androidTest by getting
val iosMain by getting
val iosTest by getting
}
configure(listOf(targets["metadata"], android(), iosX64("ios"))) {
mavenPublication {
val targetPublication = this@mavenPublication
val shouldPublish = isPublishRun == "yes"
tasks.withType<AbstractPublishToMaven>()
.matching { it.publication == targetPublication }
.all { onlyIf { shouldPublish } }
}
}
}
Then I run jobLin/Mac in parallel and then jobPublish with this shouldPublish
set to true. After that I can compile iOS and Android App just fine. But I don't know if artfiacts on artifactory should look like this:
https://artifactory.speednet.pl/artifactory/public/me/mikolaj/K14-test-mobileLib/1.4-SNAPSHOT/
(user: public, pass: publicpublic)
it looks like that this module
thing was 3 uploaded timesMarc Knaup
08/25/2020, 1:10 PMMikołaj Kąkol
08/25/2020, 1:11 PMMarc Knaup
08/25/2020, 1:12 PMiosArm64
for the device. iosX64
only works for the simulator.Mikołaj Kąkol
08/25/2020, 1:13 PMMarc Knaup
08/25/2020, 1:14 PMMarc Knaup
08/25/2020, 1:14 PM