nestserau
02/26/2019, 4:38 PMklib
under the ios
category. I build my fat frameworks using this code: https://gist.github.com/benasher44/32f602b9d5ec596ceaa3c9d190b14fc9 Kudos to @basher Further I’ve added a couple of extra tasks to create a zip to be consumed by CocoaPods:
task("zipIos${config}Artifacts", dependsOn: "createIos${config}Artifacts", group: "iOS", type: Zip) {
archiveFileName = "${rootProject.name}${"debug".equalsIgnoreCase(config) ? '-debug' : ''}.zip"
destinationDirectory = file("$outputDir/..")
from outputDir
}
And now I’m stuck. How do I tell the maven-publish
plugin to also include the artifacts produced by zipIosDebugArtifacts
and zipIosReleaseArtifacts
tasks? If I read these docs https://kotlinlang.org/docs/reference/building-mpp-with-gradle.html#publishing-a-multiplatform-library it concerns configuring targets, but that’s not something that is useful for me, since my artifact is a result of multiple targets.publishing {
repositories {
maven {
url "yourUrl"
credentials(PasswordCredentials) {
username = 'username'
password = 'password'
}
}
}
publications {
iosDebugFrameworks(MavenPublication) {
afterEvaluate {
artifactId = 'reports-framework-debug'
artifact zipIosDebugArtifacts
}
}
iosReleaseFrameworks(MavenPublication) {
afterEvaluate {
artifactId = 'reports-framework'
artifact zipIosReleaseArtifacts
}
}
}
}
And on top of that you need to move the code in the original post from afterEvaluate
to the main body. It requires very minimal adjustments, so there is no good reason for it to be in afterEvaluate
actually.