-
-
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.
- Loading branch information
Showing
5 changed files
with
124 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,105 @@ | ||
import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl | ||
|
||
plugins { | ||
alias(libs.plugins.multiplatform) | ||
alias(libs.plugins.android.library) | ||
// `maven-publish` | ||
// signing | ||
// alias(libs.plugins.vanniktech.publish) | ||
alias(libs.plugins.osdetector) | ||
} | ||
|
||
val artifact = VersionCatalog.artifactName() | ||
group = artifact | ||
version = libVersion | ||
|
||
kotlin { | ||
androidNativeX86() | ||
androidNativeX64() | ||
androidNativeArm32() | ||
androidNativeArm64() | ||
|
||
linuxX64() | ||
linuxArm64() | ||
mingwX64() | ||
|
||
if (getHost() == Host.MAC) { | ||
macosX64() | ||
macosArm64() | ||
|
||
iosX64() | ||
iosArm64() | ||
iosSimulatorArm64() | ||
|
||
tvosX64() | ||
tvosArm64() | ||
tvosSimulatorArm64() | ||
|
||
watchosX64() | ||
watchosArm32() | ||
watchosArm64() | ||
watchosSimulatorArm64() | ||
watchosDeviceArm64() | ||
} | ||
|
||
androidTarget() | ||
jvm() | ||
|
||
js(IR) { | ||
browser() | ||
nodejs() | ||
binaries.executable() | ||
} | ||
@OptIn(ExperimentalWasmDsl::class) | ||
wasmJs { | ||
browser() | ||
nodejs() | ||
binaries.executable() | ||
} | ||
@OptIn(ExperimentalWasmDsl::class) | ||
wasmWasi { | ||
nodejs() | ||
binaries.executable() | ||
} | ||
|
||
applyDefaultHierarchyTemplate() | ||
} | ||
|
||
android { | ||
compileSdk = Configuration.compileSdk | ||
namespace = artifact | ||
|
||
defaultConfig { | ||
minSdk = Configuration.minSdk | ||
} | ||
|
||
compileOptions { | ||
sourceCompatibility = CompileOptions.sourceCompatibility | ||
targetCompatibility = CompileOptions.targetCompatibility | ||
} | ||
} | ||
|
||
fun getHost(): Host { | ||
return when (osdetector.os) { | ||
"linux" -> Host.Linux | ||
"osx" -> Host.MAC | ||
"windows" -> Host.Windows | ||
else -> { | ||
val hostOs = System.getProperty("os.name") | ||
val isMingwX64 = hostOs.startsWith("Windows") | ||
|
||
when { | ||
hostOs == "Linux" -> Host.Linux | ||
hostOs == "Mac OS X" -> Host.MAC | ||
isMingwX64 -> Host.Windows | ||
else -> throw IllegalStateException("Unknown OS: ${osdetector.classifier}") | ||
} | ||
} | ||
} | ||
} | ||
|
||
enum class Host(val label: String) { | ||
Linux("linux"), | ||
Windows("win"), | ||
MAC("mac"); | ||
} |
4 changes: 4 additions & 0 deletions
4
annotations/src/commonMain/kotlin/dev/datlag/sekret/Obfuscate.kt
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,4 @@ | ||
package dev.datlag.sekret | ||
|
||
@Target(AnnotationTarget.TYPE, AnnotationTarget.CLASS) | ||
annotation class Obfuscate |
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,5 +1,6 @@ | ||
plugins { | ||
`kotlin-dsl` | ||
`kotlin-dsl-precompiled-script-plugins` | ||
} | ||
|
||
repositories { | ||
|
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