I have the following code in my top level `build.g...
# compiler
s
I have the following code in my top level
build.gradle.kts
file in order to test my compiler plugin (without the more "recommended" route of creating a gradle plugin), but Im not seeing it working for multi-project gradle projects. The plugin seems to only get invoked for a single sub-project, as per the screenshot only displaying output mentioning the sub-project with a single Kotlin file (I am printing out the list of KtFile virtualPath in the
analysisCompleted
method). Project can be found here https://github.com/Strum355/lsif-kotlin (the snippet below would be in the root
build.gradle.kts
)
Copy code
allprojects {
    tasks.withType<KotlinCompile> {
        val targetroot = File(this@allprojects.buildDir, "semanticdb-targetroot")
        kotlinOptions {
            freeCompilerArgs = freeCompilerArgs + listOf(
                "-Xplugin=/home/noah/Sourcegraph/lsif-kotlin/semanticdb-kotlinc-1.0-SNAPSHOT-all.jar",
                "-P",
                "plugin:com.sourcegraph.lsif-kotlin:sourceroot=${this@allprojects.projectDir.path}",
                "-P",
                "plugin:com.sourcegraph.lsif-kotlin:targetroot=${targetroot}"
            )
        }
    }
}
Think Ive found the issue, a subproject was overriding
freeCompilerArgs
🤦‍♂️
Copy code
val compileKotlin: KotlinCompile by tasks
compileKotlin.kotlinOptions {
    freeCompilerArgs = listOf("-Xinline-classes") // instead of freeCompilerArgs + listOf("-Xinline-classes")
}
👌 1