forked from varabyte/kotter
-
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.
First draft of multiplatform support
Things aren't 100% yet, but this is enough code at this point that things are compiling. Figuring out raw mode still needs to be supported, and a few other "NotImplementedYet" places still need to be resolved. Also, we probably need to add a bit more test coverage for missing locations.
- Loading branch information
1 parent
8eae574
commit f263d48
Showing
81 changed files
with
987 additions
and
123 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
An example that shows how to generate native releases for Kotter applications. | ||
|
||
Check out this project's `build.gradle.kts` file to see how this is set up. | ||
|
||
For native builds, you must build them on the proper host machine -- for example, Windows binaries should get built on | ||
Windows machines and Linux binaries should get built on Linux machines. | ||
|
||
You can probably use something like GitHub CI to provision different host macines in order to generate artifacts for all | ||
three platforms. |
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 |
---|---|---|
@@ -0,0 +1,46 @@ | ||
plugins { | ||
alias(libs.plugins.kotlin.multiplatform) | ||
application | ||
} | ||
|
||
group = "com.varabyte.kotter" | ||
version = "1.0-SNAPSHOT" | ||
|
||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
kotlin { | ||
val hostOs = System.getProperty("os.name") | ||
val isMingwX64 = hostOs.startsWith("Windows") | ||
val nativeTarget = when { | ||
hostOs == "Mac OS X" -> macosX64("native") | ||
hostOs == "Linux" -> linuxX64("native") | ||
isMingwX64 -> mingwX64("native") | ||
else -> throw GradleException("Host OS is not supported in Kotlin/Native.") | ||
} | ||
|
||
nativeTarget.apply { | ||
binaries { | ||
executable { | ||
entryPoint = "main" | ||
} | ||
} | ||
} | ||
|
||
sourceSets { | ||
val nativeMain by getting { | ||
dependencies { | ||
implementation(project(":kotter")) | ||
implementation(libs.kotlinx.coroutines) | ||
} | ||
} | ||
} | ||
} | ||
|
||
|
||
application { | ||
mainClass.set("MainKt") | ||
} | ||
|
Oops, something went wrong.