in a multiplatform project how can i use the gradl...
# multiplatform
c
in a multiplatform project how can i use the gradle platform feature?
Copy code
kotlin {
    jvm()
    sourceSets {
        val jvmMain by getting {
            dependencies {
                implementation(enforcedPlatform("org.jetbrains.kotlin:kotlin-bom:$kotlinVersion"))
the
enforcedPlatform
part is highlighted in red in my gradle file
l
@christophsturm Use
platform
instead.
c
thanks. i thought that both is not supported
actually platform also does not work 🙂
l
What does "also does not work" mean? Do you expect me or others to guess what happens exactly?
👎 2
c
It fails exactly the same way. It’s also red.
l
red, but does it compile?
c
no. it says
Unresolved reference: platform
🙂
d
@christophsturm I am also trying to get
platform
or
enforcedPlatform
to work as part of my multiplatform project. I too am having the same issue as you. Did you get it resolved? Or what did you do to work around it?
c
I just commented it out „for now“ :)
Was hoping for someone at JetBrains to comment, maybe it’s time for a youtrack
d
Yes, that's disappointing. Did you just manually add your dependencies instead?
Help has been provided in the ticket. There are two options, the most natural one to me is:
Copy code
val jvmMain by getting {
    dependencies {
        implementation(project.dependencies.enforcedPlatform("..."))
    }
}
🙌 1
✅ 1
c
thanks