Skip to content

Commit

Permalink
Adding more KMP targets
Browse files Browse the repository at this point in the history
  • Loading branch information
deusaquilus committed Jul 18, 2024
1 parent 767da2c commit 091f4ff
Show file tree
Hide file tree
Showing 2 changed files with 125 additions and 13 deletions.
64 changes: 62 additions & 2 deletions decomat-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import freemarker.template.Template
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent
import org.gradle.internal.impldep.org.apache.commons.io.output.ByteArrayOutputStream
import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.jetbrains.kotlin.gradle.tasks.KotlinNativeCompile
import java.io.Writer
Expand All @@ -36,15 +37,74 @@ kotlin {
val isMac = platform == "mac"
val isWindows = platform == "windows"

jvm {
jvmToolchain(11)
// If we're not the CI build a limited set of standard targets
jvm {
jvmToolchain(11)
}

if(!isCI) {
js {
browser()
nodejs()
}

linuxX64()
macosX64()
mingwX64()
}

// If we are a CI, build all the targets for the specified platform
if (isLinux && isCI) {
js {
browser()
nodejs()
}

linuxX64()
linuxArm64()

@OptIn(ExperimentalWasmDsl::class)
wasmWasi()
@OptIn(ExperimentalWasmDsl::class)
wasmJs()

androidNativeX64()
androidNativeX86()
androidNativeArm32()
androidNativeArm64()

// Need to know about this since we publish the -tooling metadata from
// the linux containers. Although it doesn't build these it needs to know about them.
macosX64()
macosArm64()
iosX64()
iosArm64()
iosSimulatorArm64()
tvosX64()
tvosArm64()
watchosX64()
watchosArm32()
watchosArm64()

mingwX64()
}

if (isMac && isCI) {
macosX64()
macosArm64()
iosX64()
iosArm64()
iosSimulatorArm64()
tvosX64()
tvosArm64()
watchosX64()
watchosArm32()
watchosArm64()
}
if (isWindows && isCI) {
mingwX64()
}


sourceSets {
commonMain {
Expand Down
74 changes: 63 additions & 11 deletions decomat-examples/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -20,26 +20,78 @@ kotlin {
val isWindows = platform == "windows"


// If we're not the CI build a limited set of standard targets
// If we're not the CI build a limited set of standard targets
jvm {
jvmToolchain(11)
}
js {
browser()
nodejs()

if(!isCI) {
js {
browser()
nodejs()
}

linuxX64()
macosX64()
mingwX64()
}

// If we are a CI, build all the targets for the specified platform
if (isLinux && isCI) {
js {
browser()
nodejs()
}

linuxX64()
linuxArm64()

@OptIn(ExperimentalWasmDsl::class)
wasmWasi()
@OptIn(ExperimentalWasmDsl::class)
wasmJs()

androidNativeX64()
androidNativeX86()
androidNativeArm32()
androidNativeArm64()

// Need to know about this since we publish the -tooling metadata from
// the linux containers. Although it doesn't build these it needs to know about them.
macosX64()
macosArm64()
iosX64()
iosArm64()
iosSimulatorArm64()
tvosX64()
tvosArm64()
watchosX64()
watchosArm32()
watchosArm64()

mingwX64()
}

if (isMac && isCI) {
macosX64()
macosArm64()
iosX64()
iosArm64()
iosSimulatorArm64()
tvosX64()
tvosArm64()
watchosX64()
watchosArm32()
watchosArm64()
}
if (isWindows && isCI) {
mingwX64()
}

linuxX64()

sourceSets {
val commonMain by getting {
println("------------------------------------------------------------------------------")
println("------------------------------------------------------------------------------")
println("---------------------- Build Dir List: ${File("$buildDir/generated/ksp/metadata/commonMain/kotlin").listFiles()?.let { it.map { it.name } }} ------------------------------")
println("-----------------------Build Dir: $buildDir -----------------------------------------")
println("------------------------------------------------------------------------------")
println("------------------------------------------------------------------------------")

kotlin.srcDir("$buildDir/generated/ksp/metadata/commonMain/kotlin")
dependencies {
//kotlin.srcDir("$buildDir/generated/ksp/main/kotlin")
Expand Down

0 comments on commit 091f4ff

Please sign in to comment.