Project maintenance
Structure
-
buildSrcsets up most of the build curiosities of this project. -
Each subproject directory named
grolifantXXwhereXXis a number, refers to a library that is compatible with a specific Gradle major release. These libraries are not directly referenced by consuming projects.; -
grolifant-rawhideis a subproject with no Gradle API dependencies and is purely focused on execution within an external JVM process or a Gradle worker. It can be included in animplementationconfigureation of a consuming project. -
grolifant-coreis the core API and the only one that should be used in anapiorimplementationconfiguration of a consuming project. -
grolifant-herdis a library that consuming projects need to place on theruntimeOnlyconfiguration. -
test-in-plugin-contextis a local testing library which tries to build a local plugin that consumes Grolifant. It does not publish any artifacts, but it does run bothtestandgradleTesttasks as part of it’s validation. -
docsis where all the documentation goes. It is not a subproject — documentation is built from the root project. -
gradle/libs.versions.tomlis the version catalog of this project. It is also consumed bybuildSrc. -
gradle.propertiesholds certain metadata as dictated by the YSF project plugin suite. It does not hold any project dependency versions. It is also consumed bybuildSrc. -
gradle-api/buildSettingsprovides a plugin to creategradle-api-XXXprojects on the fly and is used but the mainseettings.gradle -
gradle-api/jar-extractordoes the actual work of extracting Gradle API JARs and is used bytbuildSrc. -
gradle-api/api-jarsis a template build directory used bygradle-api/buildSettingsas the project directory. Its own build directories are sent tobuild/gradle-api-XXXon the root project
Compatibility testing
The three main entities are:
-
The
test-in-plugin-contextandtest-in-plugin-context-jdk17subprojects. -
The
CompatibilityTestPlugindefined inbuildSrc. -
The
gradle/gradleTest/common.gradlefile.
When test-in-plugin-context:test is executed it will use the fallbackGradleForTesting version defined in the version catalog to set a system property called OVERRIDE_GRADLE_VERSION.
testing {
suites {
test {
targets {
all {
testTask.configure {
systemProperties OVERRIDE_GRADLE_VERSION: grolifantOps.resolveProperty('overrideTestGradleVersion',ysfProject.versionOf('fallbackGradleForTesting')).get()
systemProperties OVERRIDE_GROOVY_VERSION: ysfProject.versionOf('gradle7to8Groovy')
}
}
}
}
}
}
When test-in-plugin-context:gradleTest is executed it either use the Gradle versions defined on the command-line via -DgradleTest.versions or it will read a list from gradle.properties.
It will set a number of system properties that the test task can then process later on.
This is defined in the CompatibilityTestPlugin.
minHeapSize = '512m'
maxHeapSize = '2048m'
forkEvery = 4
systemProperties WITHOUT_DEBUG: 1,
COMPAT_TEST_RESOURCES_DIR: resourcesDir.absolutePath
The PLUGIN_COMPATIBILITY_TEST flag controls how gradle/gradleTest/common.gradle handles dependencies between test and `gradleTest executions.
Override Gradle version
When running test-in-plugin-context:test it is possible to override Gradle version using for Testkit.
Pass test -PoverrideTestGradleVersion=<VERSION> replacing <VERSION> with the specific version you desire.
This can be useful to quickly test compatibility with a specific version, rather than wait for gradleTest to do its thing.
CI
When it executes on CI, it will create parallel jobs to handle batches of Gradle versions as per the below recipes.
- component: $CI_SERVER_FQDN/ysb33rOrg/org/gitlab-pipeline-recipes/gradleTest@0.7.0
inputs:
versions: "7.3.3,7.4.2,7.5.1,7.6.4"
- component: $CI_SERVER_FQDN/ysb33rOrg/org/gitlab-pipeline-recipes/gradleTest@0.7.0
inputs:
versions: "8.0.2,8.1.1,8.2.1,8.3"
- component: $CI_SERVER_FQDN/ysb33rOrg/org/gitlab-pipeline-recipes/gradleTest@0.7.0
inputs:
versions: "8.4,8.5,8.6,8.7"
- component: $CI_SERVER_FQDN/ysb33rOrg/org/gitlab-pipeline-recipes/gradleTest@0.7.0
inputs:
versions: "8.8,8.9,8.11.1"
- component: $CI_SERVER_FQDN/ysb33rOrg/org/gitlab-pipeline-recipes/gradleTest@0.7.0
inputs:
versions: "8.12.1,8.13,8.14.3"
- component: $CI_SERVER_FQDN/ysb33rOrg/org/gitlab-pipeline-recipes/gradleTest@0.7.0
inputs:
versions: "9.0.0,9.1.0-rc-1"