Skip to content

Commit

Permalink
Adding targets
Browse files Browse the repository at this point in the history
  • Loading branch information
oldergod committed Sep 7, 2023
1 parent 24b9f5c commit c44f4ab
Show file tree
Hide file tree
Showing 6 changed files with 1,061 additions and 43 deletions.
2 changes: 1 addition & 1 deletion samples/js/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
kotlin("js")
kotlin("multiplatform")
id("com.squareup.wire")
}

Expand Down
68 changes: 56 additions & 12 deletions wire-grpc-client/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ if (project.rootProject.name == "wire") {
}

kotlin {
jvm {
withJava()
}
jvm().withJava()
if (System.getProperty("kjs", "true").toBoolean()) {
js(IR) {
configure(listOf(compilations.getByName("main"), compilations.getByName("test"))) {
Expand All @@ -34,18 +32,30 @@ kotlin {
}
}
if (System.getProperty("knative", "true").toBoolean()) {
iosX64()
androidNativeArm32()
androidNativeArm64()
androidNativeX64()
androidNativeX86()
iosArm64()
iosSimulatorArm64()
// Required to generate tests tasks: https://youtrack.jetbrains.com/issue/KT-26547
linuxX64()
macosX64()
iosSimulatorArm64()
iosX64()
linuxArm64()
linuxX64() // Required to generate tests tasks: https://youtrack.jetbrains.com/issue/KT-26547
macosArm64()
macosX64()
mingwX64()
tvosX64()
tvosArm64()
tvosSimulatorArm64()
tvosX64()
wasm().nodejs()
watchosArm32()
watchosArm64()
watchosDeviceArm64()
watchosSimulatorArm64()
watchosX64()
}

sourceSets {
val commonMain by getting {
dependencies {
Expand All @@ -63,17 +73,51 @@ kotlin {
val nativeMain by creating {
dependsOn(commonMain)
}
val iosX64Main by getting
val androidNativeArm32Main by getting
val androidNativeArm64Main by getting
val androidNativeX64Main by getting
val androidNativeX86Main by getting
val iosArm64Main by getting
val iosSimulatorArm64Main by getting
val iosX64Main by getting
val linuxArm64Main by getting
val linuxX64Main by getting
val macosX64Main by getting
val macosArm64Main by getting
val macosX64Main by getting
val mingwX64Main by getting
val tvosX64Main by getting
val tvosArm64Main by getting
val tvosSimulatorArm64Main by getting
for (it in listOf(iosX64Main, iosArm64Main, iosSimulatorArm64Main, linuxX64Main, macosX64Main, macosArm64Main, mingwX64Main, tvosX64Main, tvosArm64Main, tvosSimulatorArm64Main)) {
val tvosX64Main by getting
val wasmMain by getting
val watchosArm32Main by getting
val watchosArm64Main by getting
val watchosDeviceArm64Main by getting
val watchosSimulatorArm64Main by getting
val watchosX64Main by getting
for (it in listOf(
androidNativeArm32Main,
androidNativeArm64Main,
androidNativeX64Main,
androidNativeX86Main,
iosArm64Main,
iosSimulatorArm64Main,
iosSimulatorArm64Main,
iosX64Main,
linuxArm64Main,
linuxX64Main,
macosArm64Main,
macosX64Main,
mingwX64Main,
tvosArm64Main,
tvosSimulatorArm64Main,
tvosX64Main,
wasmMain,
watchosArm32Main,
watchosArm64Main,
watchosDeviceArm64Main,
watchosSimulatorArm64Main,
watchosX64Main,
)) {
it.dependsOn(nativeMain)
}
}
Expand Down
145 changes: 122 additions & 23 deletions wire-runtime/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import com.diffplug.gradle.spotless.SpotlessExtension
import com.vanniktech.maven.publish.JavadocJar.Javadoc
import com.vanniktech.maven.publish.KotlinMultiplatform
import com.vanniktech.maven.publish.MavenPublishBaseExtension
import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension

plugins {
kotlin("multiplatform")
Expand All @@ -17,9 +18,7 @@ if (project.rootProject.name == "wire") {
}

kotlin {
jvm {
withJava()
}
jvm().withJava()
if (System.getProperty("kjs", "true").toBoolean()) {
js(IR) {
configure(listOf(compilations.getByName("main"), compilations.getByName("test"))) {
Expand All @@ -36,18 +35,30 @@ kotlin {
}
}
if (System.getProperty("knative", "true").toBoolean()) {
iosX64()
androidNativeArm32()
androidNativeArm64()
androidNativeX64()
androidNativeX86()
iosArm64()
iosSimulatorArm64()
// Required to generate tests tasks: https://youtrack.jetbrains.com/issue/KT-26547
linuxX64()
macosX64()
iosSimulatorArm64()
iosX64()
linuxArm64()
linuxX64() // Required to generate tests tasks: https://youtrack.jetbrains.com/issue/KT-26547
macosArm64()
macosX64()
mingwX64()
tvosX64()
tvosArm64()
tvosSimulatorArm64()
tvosX64()
wasm().nodejs()
watchosArm32()
watchosArm64()
watchosDeviceArm64()
watchosSimulatorArm64()
watchosX64()
}

sourceSets {
val commonMain by getting {
dependencies {
Expand Down Expand Up @@ -89,36 +100,124 @@ kotlin {
dependsOn(commonMain)
}

val iosX64Main by getting
val androidNativeArm32Main by getting
val androidNativeArm32Test by getting
val androidNativeArm64Main by getting
val androidNativeArm64Test by getting
val androidNativeX64Main by getting
val androidNativeX64Test by getting
val androidNativeX86Main by getting
val androidNativeX86Test by getting
val iosArm64Main by getting
val iosSimulatorArm64Main by getting
val linuxX64Main by getting
val macosX64Main by getting
val macosArm64Main by getting
val mingwX64Main by getting
val tvosX64Main by getting
val tvosArm64Main by getting
val tvosSimulatorArm64Main by getting
val iosX64Test by getting
val iosArm64Test by getting
val iosSimulatorArm64Main by getting
val iosSimulatorArm64Test by getting
val iosX64Main by getting
val iosX64Test by getting
val linuxArm64Main by getting
val linuxArm64Test by getting
val linuxX64Main by getting
val linuxX64Test by getting
val macosX64Test by getting
val macosArm64Main by getting
val macosArm64Test by getting
val macosX64Main by getting
val macosX64Test by getting
val mingwX64Main by getting
val mingwX64Test by getting
val tvosX64Test by getting
val tvosArm64Main by getting
val tvosArm64Test by getting
val tvosSimulatorArm64Main by getting
val tvosSimulatorArm64Test by getting
val tvosX64Main by getting
val tvosX64Test by getting
val wasmMain by getting
val wasmTest by getting
val watchosArm32Main by getting
val watchosArm32Test by getting
val watchosArm64Main by getting
val watchosArm64Test by getting
val watchosDeviceArm64Main by getting
val watchosDeviceArm64Test by getting
val watchosSimulatorArm64Main by getting
val watchosSimulatorArm64Test by getting
val watchosX64Main by getting
val watchosX64Test by getting

for (it in listOf(iosX64Main, iosArm64Main, iosSimulatorArm64Main, linuxX64Main, macosX64Main, macosArm64Main, mingwX64Main, tvosX64Main, tvosArm64Main, tvosSimulatorArm64Main)) {
for (it in listOf(
androidNativeArm32Main,
androidNativeArm64Main,
androidNativeX64Main,
androidNativeX86Main,
iosArm64Main,
iosSimulatorArm64Main,
iosX64Main,
linuxArm64Main,
linuxX64Main,
macosArm64Main,
macosX64Main,
mingwX64Main,
tvosArm64Main,
tvosSimulatorArm64Main,
tvosX64Main,
wasmMain,
watchosArm32Main,
watchosArm64Main,
watchosDeviceArm64Main,
watchosSimulatorArm64Main,
watchosX64Main,
)) {
it.dependsOn(nativeMain)
}

for (it in listOf(iosX64Test, iosArm64Test, iosSimulatorArm64Test, linuxX64Test, macosX64Test, macosArm64Test, mingwX64Test, tvosX64Test, tvosArm64Test, tvosSimulatorArm64Test)) {
for (it in listOf(
androidNativeArm32Test,
androidNativeArm64Test,
androidNativeX64Test,
androidNativeX86Test,
iosArm64Test,
iosSimulatorArm64Test,
iosX64Test,
linuxArm64Test,
linuxX64Test,
macosArm64Test,
macosX64Test,
mingwX64Test,
tvosArm64Test,
tvosSimulatorArm64Test,
tvosX64Test,
wasmTest,
watchosArm32Test,
watchosArm64Test,
watchosDeviceArm64Test,
watchosSimulatorArm64Test,
watchosX64Test,
)) {
it.dependsOn(nativeTest)
}

for (it in listOf(iosX64Main, iosArm64Main, macosX64Main, macosArm64Main, tvosX64Main, tvosArm64Main)) {
for (it in listOf(
androidNativeArm32Main,
androidNativeArm64Main,
androidNativeX64Main,
androidNativeX86Main,
iosArm64Main,
iosSimulatorArm64Main,
iosX64Main,
linuxArm64Main,
linuxX64Main,
macosArm64Main,
macosX64Main,
mingwX64Main,
tvosArm64Main,
tvosSimulatorArm64Main,
tvosX64Main,
wasmMain,
watchosArm32Main,
watchosArm64Main,
watchosDeviceArm64Main,
watchosSimulatorArm64Main,
watchosX64Main,
)) {
it.dependsOn(darwinMain)
}
}
Expand Down
6 changes: 2 additions & 4 deletions wire-schema-tests/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@ if (project.rootProject.name == "wire") {
}

kotlin {
jvm {
// Required by MavenPublishBaseExtension even though we do not have Java sources.
withJava()
}
jvm().withJava() // Required by MavenPublishBaseExtension even though we do not have Java sources.
if (System.getProperty("kjs", "true").toBoolean()) {
js(IR) {
configure(listOf(compilations.getByName("main"), compilations.getByName("test"))) {
Expand All @@ -35,6 +32,7 @@ kotlin {
browser()
}
}

sourceSets {
val commonMain by getting {
dependencies {
Expand Down
5 changes: 2 additions & 3 deletions wire-schema/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ if (project.rootProject.name == "wire") {
}

kotlin {
jvm {
withJava()
}
jvm().withJava()
if (System.getProperty("kjs", "true").toBoolean()) {
js(IR) {
configure(listOf(compilations.getByName("main"), compilations.getByName("test"))) {
Expand All @@ -34,6 +32,7 @@ kotlin {
browser()
}
}

sourceSets {
val commonMain by getting {
dependencies {
Expand Down
Loading

0 comments on commit c44f4ab

Please sign in to comment.