Jacob Rhoda
11/09/2023, 10:10 PMplugins {
alias(libs.plugins.kotlin.multiplatform)
alias(libs.plugins.android.library)
alias(libs.plugins.ksp)
}
kotlin {
androidTarget()
iosArm64()
iosSimulatorArm64()
applyDefaultHierarchyTemplate()
sourceSets {
commonMain {
dependencies {
kotlin.srcDir("build/generated/ksp/metadata/commonMain/kotlin")
implementation(libs.arrow.optics)
...
}
}
commonTest {
dependencies {
implementation(kotlin("test"))
}
}
}
}
dependencies {
add("kspCommonMainMetadata", libs.arrow.opticsKspPlugin)
}
Alejandro Serrano.Mena
11/10/2023, 9:22 AMtasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().all {
if (name != "kspCommonMainKotlinMetadata") {
dependsOn("kspCommonMainKotlinMetadata")
}
}
and the kotlin.srcDir
should be slightly different ("build/generated/ksp/commonMain/kotlin"
instead of what you have)
if you get it going, could you ping me back, and then maybe I can add a bit better documentation to the Arrow website?Jacob Rhoda
11/10/2023, 4:03 PMsrcDir
directive which I’m not sure is necessary. My current file looks like…
plugins {
alias(libs.plugins.kotlin.multiplatform)
alias(libs.plugins.ksp)
}
kotlin {
// platforms
sourceSets {
commonMain {
kotlin.srcDir("build/generated/ksp/commonMain/kotlin")
}
// ...
}
}
dependencies {
add("kspCommonMainMetadata", libs.arrow.opticsKspPlugin)
}
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().all {
if (name != "kspCommonMainKotlinMetadata") {
dependsOn("kspCommonMainKotlinMetadata")
}
}
kotlin.sourceSets.commonMain {
kotlin.srcDir("build/generated/ksp/metadata/commonMain/kotlin")
}
Alejandro Serrano.Mena
11/11/2023, 7:22 AMJacob Rhoda
11/15/2023, 10:13 PM