Inspired by https://github.com/spring-io/develocity-conventions, this plugin configures public Gradle projects to use the public Develocity instance at ge.gradle.org.
Requires Java 17+ and Gradle 8.14+ and Develocity plugin 4.2+.
When applied as a settings plugin alongside the Develocity Plugin, this plugin does the following:
- If the build cache is enabled (via
--build-cacheororg.gradle.caching=true, see the doc):- Enable the local cache.
- Enable ge.gradle.org as remote cache if credentials are provided, enjoy faster build! (using your preferred location)
- Enable ge.gradle.org as remote cache and anonymous read access, enjoy faster build!
- There are four build cache node available on the earth:
Develocity(the default; Germany) /eu(Finland) /us(N.California) /au(Sydney), you can use-DcacheNode=eu/-DcacheNode=us/-DcacheNode=auto use other ones.
- There are four build cache node available on the earth:
- Enable pushing to remote cache on CI if required credentials are provided.
- By default, build scans are published to
ge.gradle.org. If you would like to publish to your own Develocity server, add-Ddevelocity.server.url=https://ge.mycompany.com/. If you would like to publish to public build scan server (scan.gradle.com), add-DagreePublicBuildScanTermOfService=yesto your build.- For CI build (
CIenvironment variable exists):- Add
CIbuild scan tag. - Add build scan link and build scan custom value
gitCommitIdto the build (by auto-detecting environment variables):- GitHub Actions:
${System.getenv("GITHUB_RUN_ID")} ${System.getenv("GITHUB_RUN_NUMBER")}/https://github.com/gradle/gradle/runs/${System.getenv("GITHUB_RUN_ID")} - TeamCity:
BUILD_ID/BUILD_URL
- GitHub Actions:
- Upload build scans in the foreground.
- Add
- For local build:
- Add
LOCALbuild scan tag. - Add build scan custom value
gitCommitIdby runninggit rev-parse --verify HEAD. - If running in IDEA:
- Add
IDEAbuild scan tag. - Add build scan custom value
ideaVersionto IDEA version.
- Add
- Upload build scans in the background.
- Add
- For CI and local builds:
- Add build scan custom value
gitBranchNameby runninggit rev-parse --abbrev-ref HEAD. - If the build directory is dirty:
- Add build scan tag
dirty - Add build scan custom value
gitStatuswith the output ofgit status --porcelain
- Add build scan tag
- Add build scan custom value
- For CI build (
The plugin is published to gradle plugin portal.
This is done by configuring a plugin management repository in settings.gradle, as shown in the following example:
plugins {
// …
id("com.gradle.develocity").version("<version>")
id("io.github.gradle.develocity-conventions-plugin").version("<version>")
// …
}
To enable build scan publishing, authenticate with Develocity.
Then add a develocity.server.url system property to your build if you publish to a different server than the default one.
./gradlew myBuildTask -Ddevelocity.server.url=https://ge.mycompany.com/
To enable build cache pushing, the access key associated with the build needs to have build cache write permission.
export GRADLE_CACHE_REMOTE_URL=https://ge.mycompany.com/
./gradlew myBuildTask
./gradlew myBuildTask -Dgradle.cache.remote.server=https://ge.mycompany.com/
To enable build scan publishing, you need to correctly authenticate as documented here.
Feel free to fork this repository, customize the plugin, and make a contribution!
You can install the plugin to local maven repository via:
./gradlew publishPluginMavenPublicationToMavenLocal
Then use the plugin under development via:
buildscript {
repositories {
mavenLocal()
}
dependencies {
classpath("io.github.gradle:develocity-conventions-plugin:${thePluginVersion}")
}
}
plugins {
id("com.gradle.develocity").version("4.0.1")
}
apply(plugin= "io.github.gradle.develocity-conventions-plugin")