Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jenkinsci/gradle-plugin
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: gradle-2.10
Choose a base ref
...
head repository: jenkinsci/gradle-plugin
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: gradle-2.11
Choose a head ref

Commits on Feb 12, 2024

  1. Bump to next rev

    alextu committed Feb 12, 2024
    Copy the full SHA
    d0fc906 View commit details

Commits on Feb 22, 2024

  1. Bump io.netty:netty-bom from 4.1.106.Final to 4.1.107.Final (#396)

    Bumps [io.netty:netty-bom](https://github.com/netty/netty) from 4.1.106.Final to 4.1.107.Final.
    - [Commits](netty/netty@netty-4.1.106.Final...netty-4.1.107.Final)
    
    ---
    updated-dependencies:
    - dependency-name: io.netty:netty-bom
      dependency-type: direct:production
      update-type: version-update:semver-patch
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Feb 22, 2024
    Copy the full SHA
    f000707 View commit details
  2. Bump net.bytebuddy:byte-buddy from 1.14.11 to 1.14.12 (#397)

    Bumps [net.bytebuddy:byte-buddy](https://github.com/raphw/byte-buddy) from 1.14.11 to 1.14.12.
    - [Release notes](https://github.com/raphw/byte-buddy/releases)
    - [Changelog](https://github.com/raphw/byte-buddy/blob/master/release-notes.md)
    - [Commits](raphw/byte-buddy@byte-buddy-1.14.11...byte-buddy-1.14.12)
    
    ---
    updated-dependencies:
    - dependency-name: net.bytebuddy:byte-buddy
      dependency-type: direct:production
      update-type: version-update:semver-patch
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Feb 22, 2024
    Copy the full SHA
    81db4bd View commit details

Commits on Feb 27, 2024

  1. Bump com.gradle.common-custom-user-data-gradle-plugin (#399)

    Bumps com.gradle.common-custom-user-data-gradle-plugin from 1.12.1 to 1.12.2.
    
    ---
    updated-dependencies:
    - dependency-name: com.gradle.common-custom-user-data-gradle-plugin
      dependency-type: direct:production
      update-type: version-update:semver-patch
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Feb 27, 2024
    Copy the full SHA
    92f796e View commit details
  2. Copy the full SHA
    6439fd2 View commit details

Commits on Mar 4, 2024

  1. Add an ability to capture task/goal input files (#400)

    * Add an ability to capture task/goal input files
    
    * Fix configuration migration test
    
    * Remove explicit help attribute
    welandaz authored Mar 4, 2024
    Copy the full SHA
    f8dae98 View commit details
  2. Bump com.gradle.common-custom-user-data-gradle-plugin (#403)

    Bumps com.gradle.common-custom-user-data-gradle-plugin from 1.12.2 to 1.13.
    
    ---
    updated-dependencies:
    - dependency-name: com.gradle.common-custom-user-data-gradle-plugin
      dependency-type: direct:production
      update-type: version-update:semver-minor
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Mar 4, 2024
    Copy the full SHA
    d5f4934 View commit details
  3. Bump de.undercouch.download from 5.5.0 to 5.6.0 (#402)

    Bumps [de.undercouch.download](https://github.com/michel-kraemer/gradle-download-task) from 5.5.0 to 5.6.0.
    - [Release notes](https://github.com/michel-kraemer/gradle-download-task/releases)
    - [Commits](michel-kraemer/gradle-download-task@5.5.0...5.6.0)
    
    ---
    updated-dependencies:
    - dependency-name: de.undercouch.download
      dependency-type: direct:production
      update-type: version-update:semver-minor
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Mar 4, 2024
    Copy the full SHA
    59c4674 View commit details
  4. Bump com.github.spotbugs from 6.0.7 to 6.0.8 (#401)

    Bumps com.github.spotbugs from 6.0.7 to 6.0.8.
    
    ---
    updated-dependencies:
    - dependency-name: com.github.spotbugs
      dependency-type: direct:production
      update-type: version-update:semver-patch
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Mar 4, 2024
    Copy the full SHA
    9de14d2 View commit details

Commits on Mar 5, 2024

  1. Bump CCUD Maven 1.13 (#404)

    cdsap authored Mar 5, 2024
    Copy the full SHA
    50d367e View commit details

Commits on Mar 6, 2024

  1. Copy the full SHA
    db73931 View commit details
  2. Copy the full SHA
    0af966b View commit details

Commits on Mar 12, 2024

  1. Bump com.fasterxml.jackson.core:jackson-databind from 2.16.1 to 2.16.2 (

    #407)
    
    Bumps [com.fasterxml.jackson.core:jackson-databind](https://github.com/FasterXML/jackson) from 2.16.1 to 2.16.2.
    - [Commits](https://github.com/FasterXML/jackson/commits)
    
    ---
    updated-dependencies:
    - dependency-name: com.fasterxml.jackson.core:jackson-databind
      dependency-type: direct:production
      update-type: version-update:semver-patch
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Mar 12, 2024
    Copy the full SHA
    a259fad View commit details

Commits on Mar 15, 2024

  1. Fix task input files capturing for Gradle 5.x in afterevaluate (#408)

    * Fix task input files capturing for Gradle 5.x in afterevaluate
    
    * Don't disable capturing task/goal input files
    
    * Extract capture task input files setting
    
    * Assert condition only for Gradle 5.x and higher
    welandaz authored Mar 15, 2024
    Copy the full SHA
    5785b8a View commit details

Commits on Mar 19, 2024

  1. Bump com.fasterxml.jackson.core:jackson-databind from 2.16.2 to 2.17.0 (

    #410)
    
    Bumps [com.fasterxml.jackson.core:jackson-databind](https://github.com/FasterXML/jackson) from 2.16.2 to 2.17.0.
    - [Commits](https://github.com/FasterXML/jackson/commits)
    
    ---
    updated-dependencies:
    - dependency-name: com.fasterxml.jackson.core:jackson-databind
      dependency-type: direct:production
      update-type: version-update:semver-minor
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Mar 19, 2024
    Copy the full SHA
    136d1c4 View commit details

Commits on Mar 26, 2024

  1. Bump io.netty:netty-bom from 4.1.107.Final to 4.1.108.Final (#413)

    Bumps [io.netty:netty-bom](https://github.com/netty/netty) from 4.1.107.Final to 4.1.108.Final.
    - [Commits](netty/netty@netty-4.1.107.Final...netty-4.1.108.Final)
    
    ---
    updated-dependencies:
    - dependency-name: io.netty:netty-bom
      dependency-type: direct:production
      update-type: version-update:semver-patch
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Mar 26, 2024
    Copy the full SHA
    02645cb View commit details
  2. Bump com.github.spotbugs from 6.0.8 to 6.0.9 (#414)

    Bumps com.github.spotbugs from 6.0.8 to 6.0.9.
    
    ---
    updated-dependencies:
    - dependency-name: com.github.spotbugs
      dependency-type: direct:production
      update-type: version-update:semver-patch
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Mar 26, 2024
    Copy the full SHA
    e6321df View commit details

Commits on Apr 2, 2024

  1. Bump net.bytebuddy:byte-buddy from 1.14.12 to 1.14.13 (#415)

    Bumps [net.bytebuddy:byte-buddy](https://github.com/raphw/byte-buddy) from 1.14.12 to 1.14.13.
    - [Release notes](https://github.com/raphw/byte-buddy/releases)
    - [Changelog](https://github.com/raphw/byte-buddy/blob/master/release-notes.md)
    - [Commits](raphw/byte-buddy@byte-buddy-1.14.12...byte-buddy-1.14.13)
    
    ---
    updated-dependencies:
    - dependency-name: net.bytebuddy:byte-buddy
      dependency-type: direct:production
      update-type: version-update:semver-patch
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Apr 2, 2024
    Copy the full SHA
    fdd23a2 View commit details

Commits on Apr 3, 2024

  1. Update Develocity injection for new Develocity plugin artifacts (#412)

    * Capture goal/task input files by default
    
    * Use the same init script as the GitHub action and template it
    
    * Inject both DEVELOCITY_ACCESS_KEY and GRADLE_ENTERPRISE_ACCESS_KEY
    
    * Improve closure handling
    
    * Test with develocity plugin 3.17
    
    ---------
    
    Co-authored-by: Iurii Ignatko <iignatko@gradle.com>
    Co-authored-by: Leonard Brünings <leonard.bruenings@gradle.com>
    3 people authored Apr 3, 2024
    Copy the full SHA
    3eb48e6 View commit details

Commits on Apr 5, 2024

  1. Copy the full SHA
    e9ff582 View commit details
  2. Copy the full SHA
    e310c4d View commit details
  3. Print only necessary variables for assertions (#418)

    * Print only necessary variables for assertions
    
    * Keep variable names for assertions
    
    * Remove unnecessary environment prints
    welandaz authored Apr 5, 2024
    Copy the full SHA
    37b9869 View commit details

Commits on Apr 9, 2024

  1. Bump com.gradle.enterprise from 3.16.2 to 3.17 (#419)

    Bumps com.gradle.enterprise from 3.16.2 to 3.17.
    
    ---
    updated-dependencies:
    - dependency-name: com.gradle.enterprise
      dependency-type: direct:production
      update-type: version-update:semver-minor
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Apr 9, 2024
    Copy the full SHA
    ae82dc9 View commit details
  2. Bump com.gradle.common-custom-user-data-gradle-plugin from 1.13 to 2.0 (

    #420)
    
    Bumps com.gradle.common-custom-user-data-gradle-plugin from 1.13 to 2.0.
    
    ---
    updated-dependencies:
    - dependency-name: com.gradle.common-custom-user-data-gradle-plugin
      dependency-type: direct:production
      update-type: version-update:semver-major
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Apr 9, 2024
    Copy the full SHA
    aa72e1b View commit details
  3. Copy the full SHA
    0bae30a View commit details
  4. Fix Develocity deprecation warnings triggered by init-scripts (#423)

    * Fix Develocity deprecation warnings triggered by init-scripts
    
    * Do do not assert on deprecation warnings
    
    There's still one deprecation warning left, due to setting the GRADLE_ENTERPRISE_ACCESS_KEY.
    
    * Bump acc tests Jenkins version to 2.388 since suddenly the Credentials plugin requires this version at least
    alextu authored Apr 9, 2024
    Copy the full SHA
    0632840 View commit details

Commits on Apr 10, 2024

  1. Bump com.gradle:develocity-maven-extension to 1.21.1 (#422)

    * Bump com.gradle:develocity-maven-extension to 1.21.1
    
    * Update compatibility matrix
    alextu authored Apr 10, 2024
    Copy the full SHA
    60bedc5 View commit details
  2. Copy the full SHA
    80dcc0b View commit details
  3. Copy the full SHA
    840cd9b View commit details
  4. Releasing 2.11

    alextu committed Apr 10, 2024
    Copy the full SHA
    d5a651e View commit details
Showing with 1,340 additions and 369 deletions.
  1. +2 −1 README.adoc
  2. +5 −5 acceptance-tests/build.gradle.kts
  3. +1 −1 acceptance-tests/src/test/java/hudson/plugins/gradle/GradleEnterpriseErrorsTest.java
  4. +1 −1 acceptance-tests/src/test/java/hudson/plugins/gradle/GradleInjectionTest.java
  5. +12 −8 build.gradle.kts
  6. +2 −2 configuration-maven-extension/build.gradle.kts
  7. +5 −5 ...nsion/src/main/java/com/gradle/jenkins/maven/extension/internal/DevelocityConfigurerListener.java
  8. +1 −1 configuration-maven-extension/src/main/resources/META-INF/plexus/components.xml
  9. +1 −1 gradle.properties
  10. +4 −4 settings.gradle.kts
  11. +5 −5 src/main/java/hudson/plugins/gradle/injection/BuildScanEnvironmentContributor.java
  12. +9 −0 src/main/java/hudson/plugins/gradle/injection/CopyUtil.java
  13. +8 −0 src/main/java/hudson/plugins/gradle/injection/DevelocityExceptionLogProcessor.java
  14. +11 −0 src/main/java/hudson/plugins/gradle/injection/EnvUtil.java
  15. +22 −50 src/main/java/hudson/plugins/gradle/injection/GitScmListener.java
  16. +24 −28 src/main/java/hudson/plugins/gradle/injection/GradleBuildScanInjection.java
  17. +0 −14 src/main/java/hudson/plugins/gradle/injection/GradleInjectionAware.java
  18. +37 −0 src/main/java/hudson/plugins/gradle/injection/InitScriptVariables.java
  19. +59 −0 src/main/java/hudson/plugins/gradle/injection/InjectionConfig.java
  20. +12 −19 src/main/java/hudson/plugins/gradle/injection/MavenBuildScanInjection.java
  21. +36 −1 src/main/java/hudson/plugins/gradle/injection/MavenCoordinates.java
  22. +35 −0 src/main/java/hudson/plugins/gradle/injection/MavenExtClasspathUtils.java
  23. +46 −0 src/main/java/hudson/plugins/gradle/injection/MavenExtension.java
  24. +1 −1 src/main/java/hudson/plugins/gradle/injection/MavenExtensions.java
  25. +45 −0 src/main/java/hudson/plugins/gradle/injection/MavenExtensionsDetector.java
  26. +0 −22 src/main/java/hudson/plugins/gradle/injection/MavenExtensionsHandler.java
  27. +11 −1 src/main/java/hudson/plugins/gradle/injection/MavenInjectionAware.java
  28. +75 −0 src/main/java/hudson/plugins/gradle/injection/MavenOptsDevelocityFilter.java
  29. +48 −0 src/main/java/hudson/plugins/gradle/injection/SystemProperty.java
  30. +2 −0 src/main/resources/hudson/plugins/gradle/Messages.properties
  31. +12 −0 src/main/resources/hudson/plugins/gradle/injection/InjectionConfig/config.jelly
  32. +3 −0 ...esources/hudson/plugins/gradle/injection/InjectionConfig/help-ccudExtensionCustomCoordinates.html
  33. +3 −0 ...n/resources/hudson/plugins/gradle/injection/InjectionConfig/help-gradleCaptureTaskInputFiles.html
  34. +1 −1 src/main/resources/hudson/plugins/gradle/injection/InjectionConfig/help-injectMavenExtension.html
  35. +3 −0 ...in/resources/hudson/plugins/gradle/injection/InjectionConfig/help-mavenCaptureGoalInputFiles.html
  36. +3 −0 ...sources/hudson/plugins/gradle/injection/InjectionConfig/help-mavenExtensionCustomCoordinates.html
  37. +221 −78 src/main/resources/hudson/plugins/gradle/injection/init-script.gradle
  38. +3 −6 src/test/groovy/hudson/plugins/gradle/AbstractIntegrationTest.groovy
  39. +9 −4 src/test/groovy/hudson/plugins/gradle/BaseGradleIntegrationTest.groovy
  40. +8 −6 src/test/groovy/hudson/plugins/gradle/injection/BuildScanEnvironmentContributorTest.groovy
  41. +82 −39 src/test/groovy/hudson/plugins/gradle/injection/BuildScanInjectionGradleIntegrationTest.groovy
  42. +208 −58 src/test/groovy/hudson/plugins/gradle/injection/BuildScanInjectionMavenIntegrationTest.groovy
  43. +2 −2 src/test/groovy/hudson/plugins/gradle/injection/GradleSnippets.groovy
  44. +25 −0 src/test/groovy/hudson/plugins/gradle/injection/MavenCoordinatesTest.groovy
  45. +97 −0 src/test/groovy/hudson/plugins/gradle/injection/MavenExtensionsDetectorTest.groovy
  46. +2 −3 src/test/groovy/hudson/plugins/gradle/injection/MavenExtensionsHandlerTest.groovy
  47. +1 −1 src/test/groovy/hudson/plugins/gradle/injection/MavenExtensionsTest.groovy
  48. +114 −0 src/test/groovy/hudson/plugins/gradle/injection/MavenOptsDevelocityFilterTest.groovy
  49. +2 −1 src/test/groovy/hudson/plugins/gradle/injection/MavenSnippets.groovy
  50. +21 −0 src/test/groovy/hudson/plugins/gradle/injection/SystemPropertyTest.groovy
3 changes: 2 additions & 1 deletion README.adoc
Original file line number Diff line number Diff line change
@@ -287,7 +287,8 @@ The following table shows the compatibility of the plugin version with Develocit

|===
|Jenkins Gradle Plugin version | Injected Develocity Maven extension version | Injected Common Custom User Data Maven extension version | Minimum supported Develocity version
|Next version | 1.20.1 | 1.12.5 | 2023.4
|Next version | 1.21.1 | 2.0 | 2024.1
|2.11 | 1.21.1 | 2.0 | 2024.1
|2.10 | 1.20.1 | 1.12.5 | 2023.4
|2.9 | 1.19.3 | 1.12.4 | 2023.3
|2.8.2 | 1.18.1 | 1.12.2 | 2023.2
10 changes: 5 additions & 5 deletions acceptance-tests/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@ import java.net.URL

plugins {
java
id("de.undercouch.download") version "5.5.0"
id("de.undercouch.download") version "5.6.0"
}

val ciJenkinsBuild: Boolean by (gradle as ExtensionAware).extra
@@ -34,7 +34,7 @@ dependencies {

implementation("org.jenkins-ci:acceptance-test-harness:5740.vd30f30408987")

testImplementation(platform("io.netty:netty-bom:4.1.106.Final"))
testImplementation(platform("io.netty:netty-bom:4.1.108.Final"))
testImplementation("io.ratpack:ratpack-test:2.0.0-rc-1")

add(gradlePlugin.name, project(path = ":", configuration = "gradlePluginJpi"))
@@ -113,7 +113,7 @@ data class JenkinsVersion(val version: String, val downloadUrl: URL, val javaVer

private const val LATEST_VERSION = "latest"
private const val LATEST_LTS_VERSION = "latest-lts"
private const val V2_375_VERSION = "2.375.4"
private const val V2_388_VERSION = "2.388"

private const val MIRROR = "https://updates.jenkins.io"

@@ -123,7 +123,7 @@ data class JenkinsVersion(val version: String, val downloadUrl: URL, val javaVer

val LATEST = of(LATEST_VERSION)
val LATEST_LTS = of(LATEST_LTS_VERSION)
val V2_375 = of(V2_375_VERSION)
val V2_375 = of(V2_388_VERSION)

private fun of(version: String, javaVersion: JavaLanguageVersion = JAVA_11): JenkinsVersion {
val downloadUrl =
@@ -145,7 +145,7 @@ data class JenkinsVersion(val version: String, val downloadUrl: URL, val javaVer
}

val isDefault: Boolean
get() = version == V2_375_VERSION
get() = version == V2_388_VERSION

val label: String
get() = if (isJenkinsVersion(version)) {
Original file line number Diff line number Diff line change
@@ -39,7 +39,7 @@ public void checkForGradleEnterpriseErrors() {
GradleStep gradle = job.addBuildStep(GradleStep.class);
gradle.setVersion(GRADLE_VERSION);
gradle.setSwitches("--no-daemon");
gradle.setTasks("helloWorld -Dcom.gradle.scan.trigger-synthetic-error=true");
gradle.setTasks("helloWorld -Dcom.gradle.scan.trigger-synthetic-error=true -Ddevelocity.scan.trigger-synthetic-error=true");
job.save();

// when
Original file line number Diff line number Diff line change
@@ -178,7 +178,7 @@ public void gradlePluginRepoPasswordIsMasked() {
// then
build.shouldSucceed();
assertBuildScanPublished(build);
build.action(EnvInjectAction.class).shouldContain("JENKINSGRADLEPLUGIN_GRADLE_PLUGIN_REPOSITORY_PASSWORD", "[*******]");
build.action(EnvInjectAction.class).shouldContain("GRADLE_PLUGIN_REPOSITORY_PASSWORD", "[*******]");
}

@Test
20 changes: 12 additions & 8 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@ import java.util.zip.ZipFile
plugins {
id("org.jenkins-ci.jpi") version "0.50.0"
id("ru.vyarus.animalsniffer") version "1.7.1"
id("com.github.spotbugs") version "6.0.7"
id("com.github.spotbugs") version "6.0.9"
id("codenarc")
id("buildlogic.reproducible-archives")
}
@@ -23,11 +23,15 @@ val coreBomVersion = "1500.ve4d05cd32975"

val gradleExt = (gradle as ExtensionAware).extra

val gradleEnterpriseMavenExtensionVersion: String by gradleExt
val develocityMavenExtensionVersion: String by gradleExt
val commonCustomUserDataMavenExtensionVersion: String by gradleExt
val ciJenkinsBuild: Boolean by gradleExt
val isCi: Boolean by gradleExt

repositories {
mavenCentral()
}

jenkinsPlugin {
// Version of Jenkins core this plugin depends on.
jenkinsVersion.set("${coreBaseVersion}.${corePatchVersion}")
@@ -110,9 +114,9 @@ dependencies {
exclude(group = "commons-logging", module = "commons-logging")
}

implementation("com.fasterxml.jackson.core:jackson-databind:2.16.1")
implementation("com.fasterxml.jackson.core:jackson-databind:2.17.0")

add(includedLibs.name, "com.gradle:gradle-enterprise-maven-extension:${gradleEnterpriseMavenExtensionVersion}")
add(includedLibs.name, "com.gradle:develocity-maven-extension:${develocityMavenExtensionVersion}")
add(includedLibs.name, "com.gradle:common-custom-user-data-maven-extension:${commonCustomUserDataMavenExtensionVersion}")
add(includedLibs.name, project(path = ":configuration-maven-extension", configuration = "mvnExtension"))

@@ -126,7 +130,7 @@ dependencies {
testImplementation("org.jenkins-ci.plugins:pipeline-maven:3.10.0")
testImplementation("org.spockframework:spock-core:2.3-groovy-2.5")
testImplementation("org.spockframework:spock-junit4:2.3-groovy-2.5")
testImplementation("net.bytebuddy:byte-buddy:1.14.11")
testImplementation("net.bytebuddy:byte-buddy:1.14.13")
testImplementation("org.objenesis:objenesis:3.3")

testImplementation("io.ratpack:ratpack-groovy-test:1.9.0") {
@@ -261,7 +265,7 @@ val localizeMessages: Task by tasks.getting(LocalizationTask::class) {
}

val generateExtensionsVersions: Task by tasks.creating {
inputs.property("gradleEnterpriseMavenExtensionVersion", gradleEnterpriseMavenExtensionVersion)
inputs.property("develocityMavenExtensionVersion", develocityMavenExtensionVersion)
inputs.property("commonCustomUserDataMavenExtensionVersion", commonCustomUserDataMavenExtensionVersion)

val srcDir = layout.buildDirectory.file("generated/sources/extensionsVersions/java/main")
@@ -282,7 +286,7 @@ val generateExtensionsVersions: Task by tasks.creating {
public final class ExtensionsVersions {
public static final String GE_EXTENSION_VERSION = "$gradleEnterpriseMavenExtensionVersion";
public static final String DEVELOCITY_EXTENSION_VERSION = "$develocityMavenExtensionVersion";
public static final String CCUD_EXTENSION_VERSION = "$commonCustomUserDataMavenExtensionVersion";
private ExtensionsVersions() {
@@ -317,7 +321,7 @@ tasks.processTestResources {

tasks.processResources {
filesMatching("hudson/plugins/gradle/injection/InjectionConfig/help-injectMavenExtension.html") {
expand("gradleEnterpriseMavenExtensionVersion" to gradleEnterpriseMavenExtensionVersion)
expand("develocityMavenExtensionVersion" to develocityMavenExtensionVersion)
}
filesMatching("hudson/plugins/gradle/injection/InjectionConfig/help-injectCcudExtension.html") {
expand("commonCustomUserDataMavenExtensionVersion" to commonCustomUserDataMavenExtensionVersion)
4 changes: 2 additions & 2 deletions configuration-maven-extension/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ group = "com.gradle"
description = "Maven extension to configure injected Gradle Enterprise Maven extension"
version = "1.0.0"

val gradleEnterpriseMavenExtensionVersion: String by (gradle as ExtensionAware).extra
val develocityMavenExtensionVersion: String by (gradle as ExtensionAware).extra

repositories {
mavenCentral()
@@ -23,7 +23,7 @@ val mvnExtension: Configuration by configurations.creating { isCanBeConsumed = t

dependencies {
compileOnly("org.apache.maven:maven-core:3.8.7")
compileOnly("com.gradle:gradle-enterprise-maven-extension:${gradleEnterpriseMavenExtensionVersion}")
compileOnly("com.gradle:develocity-maven-extension:${develocityMavenExtensionVersion}")
}

val jar by tasks.getting(Jar::class)
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
package com.gradle.jenkins.maven.extension.internal;

import com.gradle.maven.extension.api.GradleEnterpriseApi;
import com.gradle.maven.extension.api.GradleEnterpriseListener;
import com.gradle.develocity.agent.maven.api.DevelocityApi;
import com.gradle.develocity.agent.maven.api.DevelocityListener;
import org.apache.maven.execution.MavenSession;
import org.codehaus.plexus.component.annotations.Component;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@Component(
role = GradleEnterpriseListener.class,
role = DevelocityListener.class,
hint = "develocity-configurer"
)
public class DevelocityConfigurerListener implements GradleEnterpriseListener {
public class DevelocityConfigurerListener implements DevelocityListener {

private static final Logger LOGGER = LoggerFactory.getLogger(DevelocityConfigurerListener.class);

@@ -20,7 +20,7 @@ public class DevelocityConfigurerListener implements GradleEnterpriseListener {
private static final String JENKINSGRADLEPLUGIN_MAVEN_PLUGIN_CONFIG_ALLOW_UNTRUSTED_SERVER = "JENKINSGRADLEPLUGIN_MAVEN_PLUGIN_CONFIG_ALLOW_UNTRUSTED_SERVER";

@Override
public void configure(GradleEnterpriseApi api, MavenSession session) {
public void configure(DevelocityApi api, MavenSession session) {
if (api.getServer() != null) {
LOGGER.debug("Develocity server is already configured");
return;
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
<component-set>
<components>
<component>
<role>com.gradle.maven.extension.api.GradleEnterpriseListener</role>
<role>com.gradle.develocity.agent.maven.api.DevelocityListener</role>
<role-hint>develocity-configurer</role-hint>
<implementation>com.gradle.jenkins.maven.extension.internal.DevelocityConfigurerListener</implementation>
<isolated-realm>false</isolated-realm>
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
version = 2.10
version = 2.11
githubUser = jenkinsci
org.gradle.jvmargs=-Xmx1g -XX:MaxMetaspaceSize=512m
8 changes: 4 additions & 4 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id("com.gradle.enterprise") version "3.16.2"
id("com.gradle.common-custom-user-data-gradle-plugin") version "1.12.1"
id("com.gradle.enterprise") version "3.17"
id("com.gradle.common-custom-user-data-gradle-plugin") version "2.0"
id("org.gradle.toolchains.foojay-resolver-convention") version "0.8.0"
}

@@ -20,8 +20,8 @@ val gradleExt = (gradle as ExtensionAware).extra
val ciJenkinsBuild by gradleExt { System.getenv("JENKINS_URL") != null }
val ciTeamCityBuild by gradleExt { System.getenv("TEAMCITY_VERSION") != null }
val isCi by gradleExt { ciJenkinsBuild || ciTeamCityBuild }
val gradleEnterpriseMavenExtensionVersion by gradleExt { "1.20.1" }
val commonCustomUserDataMavenExtensionVersion by gradleExt { "1.12.5" }
val develocityMavenExtensionVersion by gradleExt { "1.21.1" }
val commonCustomUserDataMavenExtensionVersion by gradleExt { "2.0" }

gradleEnterprise {
projectId = "jenkinsci-gradle-plugin"
Original file line number Diff line number Diff line change
@@ -20,8 +20,6 @@
import java.util.stream.Collectors;
import java.util.stream.Stream;

import static hudson.plugins.gradle.injection.GradleInjectionAware.JENKINSGRADLEPLUGIN_GRADLE_PLUGIN_REPOSITORY_PASSWORD;

@Extension
public class BuildScanEnvironmentContributor extends EnvironmentContributor {

@@ -43,7 +41,8 @@ private static boolean alreadyExecuted(@Nonnull Run run) {
public static class DevelocityParametersAction extends ParametersAction {

private static final String GRADLE_ENTERPRISE_ACCESS_KEY = "GRADLE_ENTERPRISE_ACCESS_KEY";
private static final String GRADLE_ENTERPRISE_REPO_PASSWORD = JENKINSGRADLEPLUGIN_GRADLE_PLUGIN_REPOSITORY_PASSWORD;
private static final String DEVELOCITY_ACCESS_KEY = "DEVELOCITY_ACCESS_KEY";
private static final String GRADLE_PLUGIN_REPOSITORY_PASSWORD = InitScriptVariables.GRADLE_PLUGIN_REPOSITORY_PASSWORD.getEnvVar();

private static final DevelocityParametersAction EMPTY = new DevelocityParametersAction();

@@ -66,17 +65,18 @@ static DevelocityParametersAction of(DevelocityLogger logger, @Nullable Secret a
logger.error("Develocity access key format is not valid");
} else {
values.add(new PasswordParameterValue(GRADLE_ENTERPRISE_ACCESS_KEY, accessKey.getPlainText()));
values.add(new PasswordParameterValue(DEVELOCITY_ACCESS_KEY, accessKey.getPlainText()));
}
}
if (repoPassword != null) {
values.add(new PasswordParameterValue(GRADLE_ENTERPRISE_REPO_PASSWORD, repoPassword.getPlainText()));
values.add(new PasswordParameterValue(GRADLE_PLUGIN_REPOSITORY_PASSWORD, repoPassword.getPlainText()));
}
if (values.isEmpty()) {
return DevelocityParametersAction.empty();
}
return new DevelocityParametersAction(
values,
Stream.of(GRADLE_ENTERPRISE_ACCESS_KEY, GRADLE_ENTERPRISE_REPO_PASSWORD).collect(Collectors.toSet())
Stream.of(GRADLE_ENTERPRISE_ACCESS_KEY, DEVELOCITY_ACCESS_KEY, GRADLE_PLUGIN_REPOSITORY_PASSWORD).collect(Collectors.toSet())
);
}
}
9 changes: 9 additions & 0 deletions src/main/java/hudson/plugins/gradle/injection/CopyUtil.java
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@

import hudson.FilePath;
import hudson.Util;
import org.apache.commons.io.IOUtils;

import java.io.IOException;
import java.io.InputStream;
@@ -26,6 +27,14 @@ public static String unsafeResourceDigest(String resourceName) {
}
}

public static String readResource(String resourceName) {
try {
return doWithResource(resourceName, IOUtils::toString);
} catch (IOException | InterruptedException e) {
throw new IllegalStateException(e);
}
}

private static <T> T doWithResource(String resourceName, CheckedFunction<InputStream, T> action) throws IOException, InterruptedException {
try (InputStream is = CopyUtil.class.getResourceAsStream("/hudson/plugins/gradle/injection/" + resourceName)) {
if (is == null) {
Original file line number Diff line number Diff line change
@@ -16,6 +16,14 @@ public final class DevelocityExceptionLogProcessor extends AbstractGradleLogProc

private static final DevelocityExceptionDetector[] DETECTORS =
{
new DevelocityExceptionDetector.ByPrefix(
BuildToolType.GRADLE,
"Internal error in Develocity Gradle plugin:"
),
new DevelocityExceptionDetector.ByPrefix(
BuildToolType.MAVEN,
"[ERROR] Internal error in Develocity Maven extension:"
),
new DevelocityExceptionDetector.ByPrefix(
BuildToolType.GRADLE,
"Internal error in Gradle Enterprise Gradle plugin:"
11 changes: 11 additions & 0 deletions src/main/java/hudson/plugins/gradle/injection/EnvUtil.java
Original file line number Diff line number Diff line change
@@ -51,11 +51,22 @@ public static String getEnv(EnvVars env, String key) {
public static void removeEnvVars(Node node, Collection<String> keys) {
keys.forEach(key -> removeEnvVar(node, key));
}
public static void removeEnvVars(Node node, InitScriptVariables[] keys) {
for (InitScriptVariables key : keys) {
removeEnvVar(node, key);
}
}

public static void removeEnvVar(Node node, String key) {
setEnvVar(node, key, null);
}
public static void removeEnvVar(Node node, InitScriptVariables key) {
setEnvVar(node, key, null);
}

public static void setEnvVar(Node node, InitScriptVariables key, @Nullable String value) {
setEnvVar(node, key.getEnvVar(), value);
}
public static void setEnvVar(Node node, String key, @Nullable String value) {
List<EnvironmentVariablesNodeProperty> all =
node.getNodeProperties().getAll(EnvironmentVariablesNodeProperty.class);
Loading