Inject Develocity plugin for versions 3.17 and above (#62)

To handle the rebranding of the GE plugin, this PR updates the inject-develocity init script 
to apply the `com.gradle.develocity` plugin if `3.17+` version of the plugin is requested.
This commit is contained in:
Pavlo Shevchenko
2024-04-03 22:47:50 +02:00
committed by GitHub
parent 5512434733
commit 5a171ce5b8
16 changed files with 440 additions and 201 deletions

View File

@@ -28,6 +28,9 @@ if (isTopLevelBuild) {
settings.pluginManager.withPlugin("com.gradle.enterprise") {
captureUsingBuildScanPublished(settings.extensions["gradleEnterprise"].buildScan, settings.rootProject, invocationId)
}
settings.pluginManager.withPlugin("com.gradle.develocity") {
captureUsingBuildScanPublished(settings.extensions["develocity"].buildScan, settings.rootProject, invocationId)
}
}
} else if (atLeastGradle3) {
projectsEvaluated { gradle ->
@@ -104,7 +107,13 @@ class BuildResults {
}
def setBuildResult(def result) {
buildResults['buildFailed'] = result.failure != null
try {
// Gradle and old Build Scan/Gradle Enterprise plugins report a single optional failure in the build result
buildResults['buildFailed'] = result.failure != null
} catch (Exception e) {
// Develocity plugin unwraps all build failures and reports them as a mandatory array
buildResults['buildFailed'] = !result.failures.empty
}
}
def setBuildScanUri(def buildScanUrl) {