Justin Tullgren
09/21/2023, 4:09 PMincludedBuild
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?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.Vampire
09/21/2023, 5:11 PMJustin Tullgren
09/21/2023, 7:06 PMVampire
09/21/2023, 7:08 PMJustin Tullgren
09/21/2023, 7:09 PMVampire
09/21/2023, 7:09 PMJustin Tullgren
09/21/2023, 7:10 PMVampire
09/21/2023, 8:41 PMgw build
and got
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:
> 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
Justin Tullgren
09/21/2023, 8:53 PMVampire
09/21/2023, 8:54 PMJustin Tullgren
09/21/2023, 8:54 PMe: Working
is showing it working, i’m throwing an error in the exampleVampire
09/21/2023, 8:54 PMJustin Tullgren
09/21/2023, 8:55 PMVampire
09/21/2023, 8:55 PMJustin Tullgren
09/21/2023, 8:55 PMVampire
09/21/2023, 8:55 PM