https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
g

gumil

03/16/2019, 9:35 PM
is there already a kotlin library with the new multiplatform plugin? I'm stuck with outputKinds for kotlin native KLIBRARY, which seems not an enum anymore in the new plugin
d

Dominaezzz

03/16/2019, 9:43 PM
If you paste a snippet I can help you convert it. 🙂
g

gumil

03/16/2019, 10:02 PM
Copy code
main {
        kotlin.srcDirs = ['src/main/kotlin', '../common/src/main/kotlin', '../../json/common/src']

        component {

            baseName = "kotlinx-serialization-runtime-native"

            // todo: fixme, k/n!
            publishJavadoc = false
            publishSources = false

            outputKinds = [KLIBRARY]
            if (!deployMode)
                target 'host'
            else
                targets = [ 'ios_arm64', 'ios_arm32', 'ios_x64', 'macos_x64', 'linux_x64', 'mingw_x64' ]

            extraOpts experimentalsEnabled
        }
    }
i wanted something similar to this, with the
outputKinds = [KLIBRARY]
but KLIBRARY seems not an enum anymore.
d

Dominaezzz

03/16/2019, 10:04 PM
By default, each native target produces a
KLIBRARY
, if you don't specify any other type.
g

gumil

03/16/2019, 10:06 PM
ohh thanks! also, is KLIBRARY be able to publish on maven?
d

Dominaezzz

03/16/2019, 10:12 PM
Yup
g

gumil

03/16/2019, 10:17 PM
Is there a way to build native binaries for iOS that can run on a linux machine?
d

Dominaezzz

03/16/2019, 10:19 PM
Native binaries aren't cross platform.
You can build a linux executable or an iOS binary but they will only run on their respective platforms.
g

gumil

03/16/2019, 10:29 PM
the problem i'm having is CI can't build iOS artifacts because it's running linux
d

Dominaezzz

03/16/2019, 10:33 PM
Ohhh. You want to build iOS binaries on a linux machine. I thought you wanted to run them.
That's not possible at the moment.
You'll need to run the build on osx.
5 Views