Smallville7123
04/17/2019, 1:47 AMolonho
04/17/2019, 6:55 AMSmallville7123
04/17/2019, 6:55 AMSmallville7123
04/17/2019, 6:56 AMSmallville7123
04/17/2019, 6:56 AMlinuxX64("linux") {
binaries {
executable {
// Change to specify fully qualified name of your application's entry point:
entryPoint = 'sample.main'
// Specify command-line arguments, if necessary:
runTask?.args('-t')
}
}
}ilya.matveev
04/17/2019, 7:12 AMexecutable call is just a shortcut creating both debug and release executables and configuring them in the same way. But you can create and configure them separately:
linuxX64("linux") {
binaries {
executable(listOf(DEBUG)) { /* Debug configuration */ }
executable(listOf(RELEASE)) { /* Release configuration */ }
}
}
You also can access already created binary and perform additional configurations. The example below uses the apply function from the Kotlin DSL but the getExecutable is available for Groovy DSL too.
linuxX64("linux") {
binaries {
getExecutable("DEBUG").apply { /* Additional configurations. */}
}
}
This example shows how to configure a project with different sources for debug and release build: https://github.com/ilmat192/kotlin-native-gradle-samples/tree/master/debug-logger.Smallville7123
04/17/2019, 7:18 AMSmallville7123
04/17/2019, 7:20 AMgetExecutable will only work if it has actually been built before?Smallville7123
04/17/2019, 7:25 AMSmallville7123
04/17/2019, 7:26 AMlinuxX64("linux") {
binaries {
executable(listOf(DEBUG)) {
entryPoint = 'sample.main'
runTask?.args('-d -t')
}
executable(listOf(RELEASE)) {
entryPoint = 'sample.main'
runTask?.args('-t')
}
}
}Smallville7123
04/17/2019, 7:27 AMSmallville7123
04/17/2019, 7:27 AMilya.matveev
04/17/2019, 9:24 AMlinuxX64("linux") {
binaries {
executable([DEBUG]) { /* Debug configuration */ }
executable([RELEASE]) { /* Release configuration */ }
}
}Smallville7123
04/17/2019, 9:28 AM