Restore Develocity Build Scan integration#1505
Conversation
Makes IP compatibility test fail.
Fix by accessing the "buildScan" extension that's available since Develocity Gradle plugin 4.0.
|
Hi there 👋🏻 This PR demonstrates that Develocity/Build Scan integration could be restored, but it's not clear to me if you'd like to restore |
6c064c7 to
1ff7dfa
Compare
1ff7dfa to
193197d
Compare
|
Restoring Actually, I don't have much interest in adding |
src/main/kotlin/com/github/jengelman/gradle/plugins/shadow/ShadowPlugin.kt
Outdated
Show resolved
Hide resolved
Move usage out of the plugin into a separate class/file. Since
the plugin is a compileOnly dependency, it must only be referenced
if the plugin/extension is present at runtime, which includes imports.
```
org.gradle.api.internal.plugins.PluginApplicationException: Failed to apply plugin class 'com.github.jengelman.gradle.plugins.shadow.ShadowPlugin'.
> org.gradle.api.plugins.PluginInstantiationException: Could not create plugin of type 'ShadowPlugin'.
> org.gradle.internal.instantiation.ClassGenerationException: Could not generate a decorated class for type ShadowPlugin.
> java.lang.NoClassDefFoundError: com/gradle/develocity/agent/gradle/scan/BuildScanConfiguration
> java.lang.ClassNotFoundException: com.gradle.develocity.agent.gradle.scan.BuildScanConfiguration
```
Issue caught by functional tests: https://scans.gradle.com/s/k2zkknzaf3ex4
c530d9f to
783860b
Compare
src/functionalTest/kotlin/com/github/jengelman/gradle/plugins/shadow/JavaPluginTest.kt
Outdated
Show resolved
Hide resolved
src/main/kotlin/com/github/jengelman/gradle/plugins/shadow/internal/BuildScanIntegration.kt
Outdated
Show resolved
Hide resolved
src/main/kotlin/com/github/jengelman/gradle/plugins/shadow/internal/BuildScanIntegration.kt
Outdated
Show resolved
Hide resolved
…locity-integration
ddda326 to
c5af9ae
Compare
c5af9ae to
0314bfb
Compare
@Goooler, aside from The benefit for users would be, when viewing a single Build Scan, this metadata giving insights into work shadow did without having to add to the console log. Also, when using a Develocity server to process several Build Scans at scale, tracking certain measurements can help find bottlenecks or unwanted usages across several projects (e.g. dependencies and configurations as the integration logged before), fix them and track the impact. |
|
I believe this is a secondary feature with low priority. If you really want to reintroduce it, please include it in the follow-ups and ensure it is thoroughly tested. |
|
@wolfs Any comments? |
|
CC @wolfs |
Restore the Develocity Build Scan integration, which adds custom values to Build Scans about the execution of Shadow tasks. It had been first disabled (#993) to resolve #907 for consumers enabling Isolated Projects (IP), then removed altogether (#1014).
buildScanextension that's available in subprojects (cd9c600), instead of the root project's extension. That was added in Develocity Gradle plugin 4.0.compileOnlydependency is added forShadowPluginto reference thebuildScanextension class (that wasn't necessary in Groovy)com.gradle.enterprisewhich was present in the original code is omitted. There's no version of that plugin supporting thebuildScanextension in subprojects, thus adding custom values would have to take place in the root project (not IP-compatible). That plugin is replaced bycom.gradle.develocityand no longer maintained.Currently, the custom values added by this PR are an example, since
ShadowStatswas also removed recently (#1264).Tests
A functional test around IP compatibility is added to demonstrate that the fix works and to prevent future regressions.