Skip to content

Commit

Permalink
Revert "Remove Develocity integration (#1014)"
Browse files Browse the repository at this point in the history
This reverts commit e316b14.
  • Loading branch information
Goooler committed Feb 2, 2025
1 parent 611253d commit eea1451
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 4 deletions.
4 changes: 0 additions & 4 deletions src/docs/changes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@

## [Unreleased]

**Removed**

- **BREAKING CHANGE:** Remove Develocity integration. ([#1013](https://github.com/GradleUp/shadow/pull/1013))


## [v8.3.5] (2024-11-03)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,33 @@ class ShadowPlugin implements Plugin<Project> {
// etc. if the user applies shadow before those plugins. However, this is fine, because this was also
// the behavior with the old plugin when applying in that order.
plugins.apply(LegacyShadowPlugin)

boolean enableDevelocityIntegration = providers.gradleProperty(
"com.gradleup.shadow.enableDevelocityIntegration"
).map { it.toBoolean() }.getOrElse(false)
if (enableDevelocityIntegration) {
// Legacy build scan support for Gradle Enterprise, users should migrate to develocity plugin.
rootProject.plugins.withId('com.gradle.enterprise') {
configureBuildScan(rootProject)
}
rootProject.plugins.withId('com.gradle.develocity') {
configureBuildScan(rootProject)
}
}
}
}

private void configureBuildScan(Project rootProject) {
rootProject.buildScan.buildFinished {
def shadowTasks = tasks.withType(ShadowJar)
shadowTasks.each { task ->
if (task.didWork) {
task.stats.buildScanData.each { k, v ->
rootProject.buildScan.value "shadow.${task.path}.${k}", v.toString()
}
rootProject.buildScan.value "shadow.${task.path}.configurations", task.configurations*.name.join(", ")
}
}
}
}
}

0 comments on commit eea1451

Please sign in to comment.