sam
01/23/2025, 4:17 AMsrc/main/java and src/main/kotlin and src/main/scala is "main" the sourceset, or is java kotlin scala the sourcesets?Emil Kantis
01/23/2025, 6:24 AM// Configure Kotlin multiplatform projects
project.pluginManager.withPlugin(KOTLIN_MULTIPLATFORM_PLUGIN) {
project.extensions.configure<KotlinMultiplatformExtension> {
sourceSets.filter { it.name.contains("test", ignoreCase = true) }
sam
01/23/2025, 7:13 AMEmil Kantis
01/23/2025, 7:21 AMAdam S
01/23/2025, 7:49 AMAdam S
01/23/2025, 7:51 AMAdam S
01/23/2025, 7:54 AMwhen you have a layout like say src/main/java and src/main/kotlin and src/main/scala is "main" the sourceset, or is java kotlin scala the sourcesetsa
org.gradle.api.tasks.SourceSet is either main or test (or something else, because users can add their own custom SourceSets), and each SourceSet has 1+ source directories like src/main/kotlinLeoColman
01/23/2025, 12:05 PMLeoColman
01/23/2025, 12:05 PMLeoColman
01/23/2025, 12:06 PMLeoColman
01/23/2025, 12:07 PMsam
01/25/2025, 2:52 AMKotlinProjectExtension
and in there find the test sourceset. But this returns a KotlinSourceSet not a SourceSet . The regular SourceSet type that comes from the JavaBasePlugin has a runtimeClasspath option which is a file tree of all the compiled files. Trying to find the same thing but for Android projects.sam
01/25/2025, 4:21 AMval classesDir = project.layout.buildDirectory.get().asFile.toPath().resolve("tmp/kotlin-classes/releaseUnitTest")
val runtimeClasspath = project.configurations["releaseUnitTestRuntimeClasspath"]
val classpathWithTests = runtimeClasspath.plus(fileCollectionFactory.fixed(classesDir.toFile()))
I wonder if there's a way to make not use hard coded strings