Skip to content

Commit

Permalink
Playing around and adding a note
Browse files Browse the repository at this point in the history
  • Loading branch information
deusaquilus committed Jul 16, 2024
1 parent 82a1bf9 commit 48b7a44
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions decomat-examples/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@ kotlin {

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 All @@ -56,6 +63,54 @@ kotlin {

dependencies {
add("kspCommonMainMetadata", project(":decomat-ksp"))

// 2nd build works when you don't include this!
//add("kspLinuxX64", project(":decomat-ksp"))
}


//tasks.named("compileCommonMainKotlinMetadata") {
// doFirst {
// 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("******************************************************************************")
// }
//}

tasks.register("listTasks") {
doLast {
println("Available tasks:")
tasks.forEach { task ->
println("${task.name} - ${task::class.java}")
}
}
}

tasks.forEach {
if (it.name == "compileCommonMainKotlinMetadata") {
println("**************************** HERE ****************************")
}
}

tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompileCommon>().configureEach {
doFirst {
println("******************************************************************************")
println("-------------- From: ${name} ----------------")
println("------------------------------------------------------------------------------")
println("---------------------- Build Dir List: ${File("$buildDir/generated/ksp/metadata/commonMain/kotlin").listFiles()?.let { it.map { it.name } }} ------------------------------")
println("-----------------------Build Dir: $buildDir -----------------------------------------")
println("------------------------------------------------------------------------------")
println("******************************************************************************")
}
}

tasks.withType<org.jetbrains.kotlin.gradle.dsl.KotlinCompile<*>>().configureEach {
if (name != "kspCommonMainKotlinMetadata") {
dependsOn("kspCommonMainKotlinMetadata")
}
}

tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
Expand Down

0 comments on commit 48b7a44

Please sign in to comment.