Hi, I am using an `includedBuild` to develop a `ko...
# gradle
j
Hi, I am using an
includedBuild
to develop a
kotlin compiler plugin
. The subplugin however is ways being “fetched” and not using the artifact from the included build, which is requiring me to publish to mavenlocal or another repo for testing. Is there a way to have the kotlin compiler use the artifact from the build?
including the build in the
pluginManagement
section doesn’t have a substitution option, so it looks like the build class path doesn’t have the artifact and is looking for the gradle coordinate of the
kotlin sub plugin
provided by the gradle plugin.
v
You probably need to include at top-level instead or additionally.
j
i tried both
no luck unfortunately
v
Can you maybe knit an MCVE?
j
i’ll try. i don’t have a place to host though
v
GitHub?
Or package it as zip and attach here
j
k, let me get it together
IncludeBuildIssueExample.zip
v
Well, it is as I suspected. Not having instructions how to use the MCVE I did
gw build
and got
Copy code
Execution failed for task ':app:compileKotlin'.
> Could not resolve all files for configuration ':app:kotlinCompilerPluginClasspathMain'.
   > Could not find com.example:plugin-kotlin:0.0.1.
     Searched in the following locations:
       - file:/C:/Users/bkautler/.m2/repository/com/example/plugin-kotlin/0.0.1/plugin-kotlin-0.0.1.pom
       - <https://repo.maven.apache.org/maven2/com/example/plugin-kotlin/0.0.1/plugin-kotlin-0.0.1.pom>
       - <https://dl.google.com/dl/android/maven2/com/example/plugin-kotlin/0.0.1/plugin-kotlin-0.0.1.pom>
     Required by:
         project :app
This means it is needed as a dependency in a normal configuration. So I just added the
includeBuild("buildLogic")
top-level and it went on until the next error which is during app kotlin compilation after
plugin-kotlin
was built already:
Copy code
> Task :buildLogic:plugin-gradle:compileKotlin UP-TO-DATE
> Task :buildLogic:plugin-gradle:compileJava NO-SOURCE
> Task :buildLogic:plugin-gradle:pluginDescriptors UP-TO-DATE
> Task :buildLogic:plugin-gradle:processResources UP-TO-DATE
> Task :buildLogic:plugin-gradle:classes UP-TO-DATE
> Task :buildLogic:plugin-gradle:jar UP-TO-DATE

> Configure project :app
!!! Gradle Plugin Applied

> Task :app:processResources NO-SOURCE
> Task :app:processTestResources NO-SOURCE
> Task :buildLogic:plugin-kotlin:processResources
> Task :buildLogic:plugin-kotlin:compileKotlin
> Task :buildLogic:plugin-kotlin:compileJava NO-SOURCE
> Task :buildLogic:plugin-kotlin:classes
> Task :buildLogic:plugin-kotlin:jar

> Task :app:compileKotlin
e: Working

> Task :app:compileKotlin FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
   > Compilation error. See log for more details
j
where did you add includeBuild(“buildLogic”)? settings.gradle.kts or build.gradle.kts?
v
Well, one compiles, the other not 😄
j
This
e: Working
is showing it working, i’m throwing an error in the example
v
Yeah, thought so
j
ok so just including it worked, then something in my setup is incorrect. i’ll have to mess around again
v
👌
j
thanks!
v
yw