https://kotlinlang.org logo
#touchlab-tools
Title
# touchlab-tools
g

Giuliopime

10/21/2023, 5:53 PM
How do you actually use the
frameworkName.set("name...")
setting? 'cause with this setup
Copy code
listOf(
        iosX64(),
        iosArm64(),
        iosSimulatorArm64()
    ).forEach {
        it.binaries.framework {
            isStatic = true
        }
    }

// Rest of the file...

kmmbridge {
    frameworkName.set("ZenBreakCoreKit")
    spm()
    mavenPublishArtifacts()
}
I get
Only one framework name currently allowed. Found ZenBreakCoreKit and shared-core
and the docs don't mention anything about this Additionally, previously I was setting the baseName inside the framework block, and I was getting a wrong name in the github packages, like shared-core-kmmbridge with unspecified version
I just can't understand why I'm getting
unspecified
version in github packages, @kpgalligan can you help with that, it's quite weird 'cause I retried like 10 times with different configs and can't get it to work
k

kpgalligan

10/24/2023, 1:38 PM
Are you using the template project or setting up your own? If setting up your own, you need to configure version.
At a minimum, it expects
version
to be set.
g

Giuliopime

10/24/2023, 1:43 PM
I've setup the project a while ago with the compose multiplatform template. I checked your template before asking here and I think I copied all relevant instructions. Which
version
are you referring to?
k

kpgalligan

10/24/2023, 2:00 PM
Gradle config for pretty much anything has a
version
property. KMMBridge uses that. I was looking through the docs to find where that's clearly explained, and it's not, so we need to update that. The docs are mostly around using the tutorial, then just "docs". Anyway,
version
needs to be set on Gradle https://github.com/touchlab/KMMBridgeSKIETemplate/blob/main/build.gradle.kts#L28, then the docs that talk about it are here https://kmmbridge.touchlab.co/docs/general/CONFIGURATION_OVERVIEW#versionmanager, but they're not clear about version, so we'll need to update that.
Essentially, though, when you publish, you'll need Gradle to set a
version
. To try it, set something like:
Copy code
version = '0.1.2'
and publish. You should see
0.1.2
in your repo
g

Giuliopime

10/24/2023, 2:10 PM
Alright, I'll try that then. But what's the point of autoversion if I need it in gradle?
k

kpgalligan

10/24/2023, 2:11 PM
Are you using autoversion? If so, you need to pull that into Gradle. Autoversion is just a CI thing.
g

Giuliopime

10/24/2023, 2:11 PM
I'm using the autoversion workflow yeah
let me check
ah mb then. didn't copy that part
k

kpgalligan

10/24/2023, 2:13 PM
Yeah, same issue on our end. We talk about autoversion for CI, but don't really explain that bit
❤️ 1
g

Giuliopime

10/24/2023, 2:13 PM
I'll decide between the two, there should be no issues with autoversion if I also have another version for my full app releases on github correct?
since there is the version prefix
k

kpgalligan

10/24/2023, 2:16 PM
You mean if you have
1.2
as your prefix and
1.2.12
(for example) as the dev/published version for KMMBridge builds? If your app version is
1.2
I haven't tested that scenario, but SPM should prefer
1.2.12
over
1.2
, so I would assume that should be fine. If you can explain a bit better how your version releases would work, it might be easier to comment and test it out.
g

Giuliopime

10/24/2023, 2:18 PM
basically I'm making a desktop app (for the multiplatform contest ^^ irrelevant) and I publish releases of that on github, versioned releases obv. so example release 1.0.0 has all the installers for the 1.0.0 version, release 1.0.1 is the next one etc... The swift package compiled from the shared kotlin module of the app would go out with the 0.1.x version prefix to not interfere with the "actual app" versions
k

kpgalligan

10/24/2023, 2:39 PM
OK, if you're pushing tags with 0.1.x for SPM, assuming Xcode is grabbing them < 1.0.0, you should be fine.
g

Giuliopime

10/24/2023, 2:40 PM
perfect appreciate the help a ton
k

kpgalligan

10/24/2023, 2:40 PM
Appreciate the feedback. Let me know how that goes and if you run into more issues.
👍 1
g

Giuliopime

10/24/2023, 2:46 PM
One last thing, would about the naming. What's the proper way of setting it?
I use the frameworkName.set but I get the error that I have two different names unless I set the baseName inside the framework binaries
I described it better in the original msg
Additionally, settings the subprojects group and version via the main build.gradle.kts doesn't make it so every subproject has that group and version instead of just the shared module?
I know I can just use that code in the module where I need it, I was just confused that it's used that way in the template
5 Views