[K/N] Allow common source sets in projects created with wizard
Issue #KT-27232 Fixed
This commit is contained in:
+12
-3
@@ -74,18 +74,27 @@ class KotlinGradleNativeMultiplatformModuleBuilder : KotlinGradleAbstractMultipl
|
|||||||
fromPreset(presets.$nativePresetName, '$nativeTargetName')
|
fromPreset(presets.$nativePresetName, '$nativeTargetName')
|
||||||
|
|
||||||
configure([$nativeTargetName]) {
|
configure([$nativeTargetName]) {
|
||||||
compilations.main.outputKinds('EXECUTABLE') // Comment to generate Kotlin/Native library (KLIB) instead of executable file.
|
// 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:
|
// Change to specify fully qualified name of your application's entry point:
|
||||||
compilations.main.entryPoint = 'sample.main'
|
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.
|
||||||
|
$nativeSourceName {
|
||||||
|
}
|
||||||
|
$nativeTestName {
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
task runProgram {
|
task runProgram {
|
||||||
def buildType ="release" // Change to "debug" to run application with debug symbols.
|
def buildType = 'release' // Change to 'debug' to run application with debug symbols.
|
||||||
dependsOn "link${'$'}{buildType.capitalize()}Executable${nativeTargetName.capitalize()}"
|
dependsOn "link${'$'}{buildType.capitalize()}Executable${nativeTargetName.capitalize()}"
|
||||||
doLast {
|
doLast {
|
||||||
def programFile = kotlin.targets.$nativeTargetName.compilations.main.getBinary("EXECUTABLE", buildType)
|
def programFile = kotlin.targets.$nativeTargetName.compilations.main.getBinary('EXECUTABLE', buildType)
|
||||||
exec {
|
exec {
|
||||||
executable programFile
|
executable programFile
|
||||||
args ''
|
args ''
|
||||||
|
|||||||
Reference in New Issue
Block a user