Robert Houghton
04/13/2022, 6:28 PMbuildSrc
which provides a specialization of Test
task types. I am trying to move it from buildSrc
into a separate sub-project, consumed by includeBuild
. The plugin project builds and creates its jar as expected, but the main project cannot create the tasks any more, reporting:
Could not get unknown property 'RepeatTest' for project ':geode-assembly' of type org.gradle.api.Project.
CristianGM
04/13/2022, 6:33 PMRobert Houghton
04/13/2022, 6:36 PMsettings.gradle
, I have
pluginManagement {
includeBuild("buildSrc2")
}
and in the root build.src
,
plugins {
id 'org.apache.geode.gradle.geode-repeat-test'
}
which triggers the plugin project being built (i see the library, with the test-task .class)
In a sub-project, I try
apply plugin: 'org.apache.geode.gradle.geode-repeat-test'
tasks.register('repeatTest', org.apache.geode.gradle.testing.repeat.RepeatTest) {}
and get Could not get unknown property 'org' for project ':geode-assembly' of type org.gradle.api.Project
Robert Houghton
04/13/2022, 6:48 PMPlugin<Project>
would be available on the build classpath. There isn’t any reason to add an extension to the Project, right?CristianGM
04/13/2022, 6:49 PMRobert Houghton
04/13/2022, 6:50 PMpublic class RepeatTest extends Test implements GroovyObject {}
Robert Houghton
04/13/2022, 6:51 PMTest
is org.gradle.api.tasks.testing.Test
Vampire
04/13/2022, 7:19 PMapply
in the sub project?Vampire
04/13/2022, 7:22 PMRobert Houghton
04/13/2022, 7:32 PMplugins {
id 'org.apache.geode.gradle.geode-repeat-test' apply false
}
because the root and some others do not have tests and ergo do not need the plugin, and then using apply
to turn it on in the java-library
projects.
I’ve tried importing, and its not able to resolve 😕grossws
04/13/2022, 7:36 PMapply false
would add it to subprojects' classpath.
Usually it would be done in convention plugin which will also apply java-library pluginVampire
04/13/2022, 7:37 PMapply
Robert Houghton
04/13/2022, 7:38 PMtest.gradle
that has test logic that is added to required projects. I can’t use plugins{}
there because it is not a project build.gradle
. I’ll pull it up, and see if that helps.Vampire
04/13/2022, 7:39 PMVampire
04/13/2022, 7:40 PMVampire
04/13/2022, 7:40 PMRobert Houghton
04/13/2022, 7:43 PMVampire
04/13/2022, 8:50 PMRobert Houghton
04/13/2022, 8:52 PMbuildSrc
for starters, and can then be moved into an independent project if needed?Vampire
04/13/2022, 8:56 PMbuildSrc
nowadays, but always an included build. But yes, you can also do it in buildSrc
.Robert Houghton
04/13/2022, 8:57 PMbuildScripts