andyfleming
12/07/2018, 12:53 AMtoomanyeduardos
12/07/2018, 2:22 AMolonho
12/07/2018, 5:42 AMandyfleming
12/07/2018, 5:51 AMandyfleming
12/07/2018, 5:52 AMandyfleming
12/07/2018, 5:53 AMandyfleming
12/07/2018, 5:53 AMandyfleming
12/07/2018, 5:55 AMolonho
12/07/2018, 6:00 AMandyfleming
12/07/2018, 6:17 AMplugins {
id 'kotlin-multiplatform' version '1.3.10'
}
repositories {
mavenCentral()
}
kotlin {
targets {
// For ARM, preset should be changed to presets.iosArm32 or presets.iosArm64
// For Linux, preset should be changed to e.g. presets.linuxX64
// For MacOS, preset should be changed to e.g. presets.macosX64
fromPreset(presets.macosX64, 'macos')
configure([macos]) {
// Comment to generate Kotlin/Native library (KLIB) instead of executable file:
compilations.main.outputKinds('EXECUTABLE')
// Change to specify fully qualified name of your application's entry point:
compilations.main.entryPoint = 'sample.main'
}
}
sourceSets {
// Note: To enable common source sets please comment out 'kotlin.import.noCommonSourceSets' property
// in gradle.properties file and re-import your project in IDE.
macosMain {
}
macosTest {
}
}
}
task runProgram {
def buildType = 'release' // Change to 'debug' to run application with debug symbols.
dependsOn "link${buildType.capitalize()}ExecutableMacos"
doLast {
def programFile = kotlin.targets.macos.compilations.main.getBinary('EXECUTABLE', buildType)
exec {
executable programFile
args ''
}
}
}
I see options for how to change the primary target, but it isn’t clear how to target multiple platforms at once.andyfleming
12/07/2018, 6:24 AMDominaezzz
12/07/2018, 1:38 PM