Slackbot
06/25/2022, 12:45 AMVampire
06/26/2022, 10:14 AMDavid Chang
06/26/2022, 1:59 PMDavid Chang
06/26/2022, 2:08 PMincludeBuild by the project coordinate inside of buildSrc with implementation project(":buildtools") and the error is
> Project with path ':buildtools' could not be found in project ':buildSrc'.
Should I be trying to go in the other direction? and if yes, what would the project coordinate be because implementation project(":buildSrc") doesn't seem to workVampire
06/26/2022, 2:44 PMproject(...).
Included builds are own builds and you cannot reference them with project(...), you just reference them by their normal Maven coordinates like any other dependency.David Chang
06/26/2022, 4:24 PMDavid Chang
06/26/2022, 4:24 PMVampire
06/26/2022, 4:25 PMoutgoingVariants task and you should see the coordinates you need to use.David Chang
06/26/2022, 11:27 PMVampire
06/27/2022, 9:06 AMincludeBuild from buildSrc? That is expected.
I just thought it might maybe work like with the plugin, that you included from the root build and can access it from buildSrc since the order changed and settings are now evaluated before buildSrc.
This was the other way around in older Gradle versions.Vampire
06/27/2022, 9:16 AMVampire
06/27/2022, 9:16 AMDavid Chang
06/27/2022, 2:47 PMincludeBuild to buildSrc , I'm aware that works. The missing piece for me is how to reuse the classes in that plugin as a dependency.Vampire
06/27/2022, 2:48 PMVampire
06/27/2022, 2:48 PMincludeBuild in the "parent" settings script and just declare the dependency in the buildSrc build.Vampire
06/27/2022, 2:49 PMbuildSrc.
I never use it these days, except for exceptional cases like monkey-patching plugin classes.
Besides that I always use an included build like gradle/build-logicDavid Chang
06/27/2022, 2:49 PMsettings.gradle for buildSrcDavid Chang
06/27/2022, 2:49 PMbuildSrc eventually.. just will take some timeVampire
06/27/2022, 2:51 PMbuildSrc, you do not listenVampire
06/27/2022, 2:51 PMVampire
06/27/2022, 2:51 PMDavid Chang
06/27/2022, 2:51 PMsettings.gradleVampire
06/27/2022, 2:51 PMVampire
06/27/2022, 2:52 PMDavid Chang
06/27/2022, 2:52 PMVampire
06/27/2022, 2:52 PMVampire
06/27/2022, 2:52 PMDavid Chang
06/27/2022, 2:54 PMVampire
06/27/2022, 2:58 PMincludeBuild in the parent settings script and the dependency in the buildSrc build script with the correct coordinates as can be found as capability in the output of outgoingVariants task as already mentioned.
There is really nothing more to it.David Chang
06/27/2022, 2:58 PMsettings.gradle
pluginManagement {
includeBuild ('gradle/gradle-plugin')
}
includeBuild ('gradle/gradle-plugin')
in gradle/gradle-plugin/settings.gradle
rootProject.name = "plugin"
include(":plugin")
include(":buildtools")
in buildSrc/build.gradle, I tried both the maven coordinates and projectVampire
06/27/2022, 2:58 PMDavid Chang
06/27/2022, 2:59 PMDavid Chang
06/27/2022, 3:02 PMExecution failed for task ':buildSrc:generateSourceRoots'.
> Error while evaluating property 'sourceRoots' of task ':buildSrc:generateSourceRoots'
> Failed to calculate the value of task ':buildSrc:generateSourceRoots' property 'sourceRoots'.
> Project with path ':buildtools' could not be found in project ':buildSrc'.Vampire
06/27/2022, 3:04 PMDavid Chang
06/27/2022, 3:04 PMVampire
06/27/2022, 3:05 PMVampire
06/27/2022, 3:06 PMDavid Chang
06/27/2022, 4:53 PMThein the parent settings script and the dependency in theincludeBuildbuild script with the correct coordinates as can be found as capability in the output ofbuildSrctask as already mentioned.outgoingVariants
Vampire
06/27/2022, 4:59 PMDavid Chang
06/27/2022, 5:00 PMDavid Chang
06/27/2022, 5:00 PMDavid Chang
06/28/2022, 12:39 AMDavid Chang
06/28/2022, 12:39 AMVampire
06/28/2022, 10:03 AMDavid Chang
06/28/2022, 6:19 PMVampire
06/28/2022, 6:20 PMVampire
06/28/2022, 6:21 PM