forked from JetBrains/kotlin-native
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Samples: Get rid of KotlinNativeTarget and KonanTarget imports
- Loading branch information
Showing
13 changed files
with
201 additions
and
245 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,25 @@ | ||
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTargetPreset | ||
|
||
plugins { | ||
kotlin("multiplatform") | ||
} | ||
|
||
// Determine host preset. | ||
val hostOs = System.getProperty("os.name") | ||
|
||
val hostPreset: KotlinNativeTargetPreset = when { | ||
hostOs == "Mac OS X" -> "macosX64" | ||
hostOs == "Linux" -> "linuxX64" | ||
hostOs.startsWith("Windows") -> "mingwX64" | ||
else -> throw GradleException("Host OS '$hostOs' is not supported in Kotlin/Native $project.") | ||
}.let { | ||
kotlin.presets[it] as KotlinNativeTargetPreset | ||
} | ||
|
||
kotlin { | ||
targetFromPreset(hostPreset, "csvParser") { | ||
// Determine host preset. | ||
val hostOs = System.getProperty("os.name") | ||
|
||
// Create target for the host platform. | ||
val hostTarget = when { | ||
hostOs == "Mac OS X" -> macosX64("csvParser") | ||
hostOs == "Linux" -> linuxX64("csvParser") | ||
hostOs.startsWith("Windows") -> mingwX64("csvParser") | ||
else -> throw GradleException("Host OS '$hostOs' is not supported in Kotlin/Native $project.") | ||
} | ||
|
||
hostTarget.apply { | ||
binaries { | ||
executable { | ||
entryPoint = "sample.csvparser.main" | ||
runTask?.args("./European_Mammals_Red_List_Nov_2009.csv", 4, 100) | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.