Another question for KMMBridge. I’ve been successf...
# touchlab-tools
s
Another question for KMMBridge. I’ve been successfully using
com.vanniktech.maven.publish
to publish the multiplatform packages to github actions so I feel like I would like to keep doing that, but I can use KMMBridge to take care of the XCFramework part and all that stuff. Is it designed to do that? I saw so far that if I do not specify
mavenPublishArtifacts()
it complains about that. I thought I’d perhaps be able to do just
Copy code
kmmbridge {
    frameworkName.set("libname")
    spm()
}
And run the GH actions workflow. Is this something that KMMBridge is designed to do?
k
At some point we tried
com.vanniktech.maven.publish
as we use that pretty extensively for libraries. I don't remember off hand what happened there. It should work. I'm pretty sure the vanniktech plugin just helps configure Gradle's maven publishing (I don't mean "just" as in it's not doing much. Configuring Gradle publishing is a pain).
mavenPublishArtifacts()
just tells KMMBridge that we're going to use maven to store the binaries. It shouldn't impact what that config is, assuming it's correct. The helper function
addGithubPackagesRepository()
is the "opinionated" part of this that configures maven publishing repos. If
com.vanniktech.maven.publish
is handling that, you should only need
mavenPublishArtifacts()
, but you do need it. There are other back ends to push binaries to unrelated to maven. We removed most of the default ones, but as an example,
s3PublicArtifacts
. That would push binaries to S3 instead of a maven repo. You do need to tell KMMBridge which to use.
I tried using the vanniktech plugin with our template sample: https://github.com/kpgalligan/TryVanniktech
That worked on the first try. Some highlights.
Copy code
addGithubPackagesRepository()

kmmbridge {
    mavenPublishArtifacts()
    spm()
}
mavenPublishArtifacts()
is necessary, but all it's really saying is "use maven".
addGithubPackagesRepository()
actually adds the GitHub Packages repos, and pulls auth info from GitHub Actions and the workflow. KMMBridge and the workflow are technically separate things, but KMMBridge internally has some helpers specific to GitHub Actions (see https://github.com/touchlab/KMMBridge/blob/f48be0f8b1eafb118ec60c0aaaf3deea0d43ad4[…]ridge/src/main/kotlin/co/touchlab/faktory/internal/GithubApi.kt).
Oh, wait.
allshared
has vanniktech, but I also need to add it to
analytics
and
breeds
for Android publishing. I'll try that now, although since
allshared
worked, I'd be surprised if the others didn't.
s
Oh that’s super nice to hear! I don’t think it’s gonna fail when you edit those either then. Right yeah I see those helpers, and they seem to be used over here https://github.com/touchlab/KMMBridge/blob/f48be0f8b1eafb118ec60c0aaaf3deea0d43ad4a/kmmbridge/src/main/kotlin/BuildFileHelper.kt#L31-L45 only, correct? If that is the case, if we had already configured this part ourselves, like we do here, it should also not necessarily be needed I would guess?
k
Yeah, you should be able to skip
addGithubPackagesRepository()