Skip to content

Commit eea1451

Browse files
committed
Revert "Remove Develocity integration (#1014)"
This reverts commit e316b14.
1 parent 611253d commit eea1451

File tree

2 files changed

+27
-4
lines changed

2 files changed

+27
-4
lines changed

src/docs/changes/README.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@
33

44
## [Unreleased]
55

6-
**Removed**
7-
8-
- **BREAKING CHANGE:** Remove Develocity integration. ([#1013](https://github.com/GradleUp/shadow/pull/1013))
9-
106

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

src/main/groovy/com/github/jengelman/gradle/plugins/shadow/ShadowPlugin.groovy

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,33 @@ class ShadowPlugin implements Plugin<Project> {
2525
// etc. if the user applies shadow before those plugins. However, this is fine, because this was also
2626
// the behavior with the old plugin when applying in that order.
2727
plugins.apply(LegacyShadowPlugin)
28+
29+
boolean enableDevelocityIntegration = providers.gradleProperty(
30+
"com.gradleup.shadow.enableDevelocityIntegration"
31+
).map { it.toBoolean() }.getOrElse(false)
32+
if (enableDevelocityIntegration) {
33+
// Legacy build scan support for Gradle Enterprise, users should migrate to develocity plugin.
34+
rootProject.plugins.withId('com.gradle.enterprise') {
35+
configureBuildScan(rootProject)
36+
}
37+
rootProject.plugins.withId('com.gradle.develocity') {
38+
configureBuildScan(rootProject)
39+
}
40+
}
41+
}
42+
}
43+
44+
private void configureBuildScan(Project rootProject) {
45+
rootProject.buildScan.buildFinished {
46+
def shadowTasks = tasks.withType(ShadowJar)
47+
shadowTasks.each { task ->
48+
if (task.didWork) {
49+
task.stats.buildScanData.each { k, v ->
50+
rootProject.buildScan.value "shadow.${task.path}.${k}", v.toString()
51+
}
52+
rootProject.buildScan.value "shadow.${task.path}.configurations", task.configurations*.name.join(", ")
53+
}
54+
}
2855
}
2956
}
3057
}

0 commit comments

Comments
 (0)