-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding targets #7
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
plugins { | ||
kotlin("js") | ||
kotlin("multiplatform") | ||
id("com.squareup.wire") | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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"))) { | ||
|
@@ -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 { | ||
|
@@ -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, | ||
Comment on lines
+103
to
+104
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. logic: iosSimulatorArm64Main is duplicated in the list |
||
iosX64Main, | ||
linuxArm64Main, | ||
linuxX64Main, | ||
macosArm64Main, | ||
macosX64Main, | ||
mingwX64Main, | ||
tvosArm64Main, | ||
tvosSimulatorArm64Main, | ||
tvosX64Main, | ||
wasmMain, | ||
watchosArm32Main, | ||
watchosArm64Main, | ||
watchosDeviceArm64Main, | ||
watchosSimulatorArm64Main, | ||
watchosX64Main, | ||
)) { | ||
it.dependsOn(nativeMain) | ||
} | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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") | ||
|
@@ -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"))) { | ||
|
@@ -36,18 +35,30 @@ kotlin { | |
} | ||
} | ||
if (System.getProperty("knative", "true").toBoolean()) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. style: Consider grouping targets by platform (e.g., iOS, tvOS, watchOS) for better readability. |
||
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 { | ||
|
@@ -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( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. logic: The darwinMain source set is being used for non-Darwin platforms. Consider creating a separate source set for Android and Linux targets. |
||
androidNativeArm32Main, | ||
androidNativeArm64Main, | ||
androidNativeX64Main, | ||
androidNativeX86Main, | ||
iosArm64Main, | ||
iosSimulatorArm64Main, | ||
iosX64Main, | ||
linuxArm64Main, | ||
linuxX64Main, | ||
macosArm64Main, | ||
macosX64Main, | ||
mingwX64Main, | ||
tvosArm64Main, | ||
tvosSimulatorArm64Main, | ||
tvosX64Main, | ||
wasmMain, | ||
watchosArm32Main, | ||
watchosArm64Main, | ||
watchosDeviceArm64Main, | ||
watchosSimulatorArm64Main, | ||
watchosX64Main, | ||
)) { | ||
it.dependsOn(darwinMain) | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: iosSimulatorArm64() is duplicated on lines 40 and 41