Skip to content

Commit a09a310

Browse files
authored
Develocity injection fixes (#448)
2 parents fb5165d + 333e9d9 commit a09a310

File tree

6 files changed

+19
-14
lines changed

6 files changed

+19
-14
lines changed

.github/workflow-samples/groovy-dsl/settings.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
plugins {
22
id "com.gradle.develocity" version "3.18.2"
3-
id "com.gradle.common-custom-user-data-gradle-plugin" version "2.0.1"
3+
id "com.gradle.common-custom-user-data-gradle-plugin" version "2.0.2"
44
}
55

66
develocity {

.github/workflow-samples/kotlin-dsl/settings.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
plugins {
22
id("com.gradle.develocity") version "3.18.2"
3-
id("com.gradle.common-custom-user-data-gradle-plugin") version "2.0.1"
3+
id("com.gradle.common-custom-user-data-gradle-plugin") version "2.0.2"
44
}
55

66
develocity {

.github/workflows/integ-test-inject-develocity.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
DEVELOCITY_INJECTION_ENABLED: true
3030
DEVELOCITY_URL: https://ge.solutions-team.gradle.com
3131
DEVELOCITY_PLUGIN_VERSION: ${{ matrix.plugin-version }}
32-
DEVELOCITY_CCUD_PLUGIN_VERSION: '2.0'
32+
DEVELOCITY_CCUD_PLUGIN_VERSION: '2.0.2'
3333
${{matrix.accessKeyEnv}}: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
3434
strategy:
3535
fail-fast: false
@@ -76,7 +76,7 @@ jobs:
7676
DEVELOCITY_INJECTION_ENABLED: true
7777
DEVELOCITY_URL: 'https://ge.solutions-team.gradle.com'
7878
DEVELOCITY_PLUGIN_VERSION: ${{ matrix.plugin-version }}
79-
DEVELOCITY_CCUD_PLUGIN_VERSION: '2.0'
79+
DEVELOCITY_CCUD_PLUGIN_VERSION: '2.0.2'
8080
strategy:
8181
fail-fast: false
8282
matrix:
@@ -117,7 +117,7 @@ jobs:
117117
DEVELOCITY_INJECTION_ENABLED: true
118118
DEVELOCITY_URL: 'https://localhost:3333/'
119119
DEVELOCITY_PLUGIN_VERSION: ${{ matrix.plugin-version }}
120-
DEVELOCITY_CCUD_PLUGIN_VERSION: '2.0'
120+
DEVELOCITY_CCUD_PLUGIN_VERSION: '2.0.2'
121121
# Access key also set as an env var, we want to check it does not leak
122122
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
123123
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}

sources/src/develocity/build-scan.ts

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,29 @@ import {setupToken} from './short-lived-token'
55
export async function setup(config: BuildScanConfig): Promise<void> {
66
maybeExportVariable('DEVELOCITY_INJECTION_INIT_SCRIPT_NAME', 'gradle-actions.inject-develocity.init.gradle')
77
maybeExportVariable('DEVELOCITY_AUTO_INJECTION_CUSTOM_VALUE', 'gradle-actions')
8-
if (config.getBuildScanPublishEnabled()) {
9-
maybeExportVariable('DEVELOCITY_INJECTION_ENABLED', 'true')
10-
maybeExportVariable('DEVELOCITY_PLUGIN_VERSION', '3.18.2')
11-
maybeExportVariable('DEVELOCITY_CCUD_PLUGIN_VERSION', '2.0')
12-
maybeExportVariable('DEVELOCITY_TERMS_OF_USE_URL', config.getBuildScanTermsOfUseUrl())
13-
maybeExportVariable('DEVELOCITY_TERMS_OF_USE_AGREE', config.getBuildScanTermsOfUseAgree())
14-
}
158

169
maybeExportVariableNotEmpty('DEVELOCITY_INJECTION_ENABLED', config.getDevelocityInjectionEnabled())
1710
maybeExportVariableNotEmpty('DEVELOCITY_URL', config.getDevelocityUrl())
1811
maybeExportVariableNotEmpty('DEVELOCITY_ALLOW_UNTRUSTED_SERVER', config.getDevelocityAllowUntrustedServer())
1912
maybeExportVariableNotEmpty('DEVELOCITY_CAPTURE_FILE_FINGERPRINTS', config.getDevelocityCaptureFileFingerprints())
2013
maybeExportVariableNotEmpty('DEVELOCITY_ENFORCE_URL', config.getDevelocityEnforceUrl())
2114
maybeExportVariableNotEmpty('DEVELOCITY_PLUGIN_VERSION', config.getDevelocityPluginVersion())
15+
maybeExportVariableNotEmpty('DEVELOCITY_CCUD_PLUGIN_VERSION', config.getDevelocityCcudPluginVersion())
2216
maybeExportVariableNotEmpty('GRADLE_PLUGIN_REPOSITORY_URL', config.getGradlePluginRepositoryUrl())
2317
maybeExportVariableNotEmpty('GRADLE_PLUGIN_REPOSITORY_USERNAME', config.getGradlePluginRepositoryUsername())
2418
maybeExportVariableNotEmpty('GRADLE_PLUGIN_REPOSITORY_PASSWORD', config.getGradlePluginRepositoryPassword())
2519

20+
// If build-scan-publish is enabled, ensure the environment variables are set
21+
// The DEVELOCITY_PLUGIN_VERSION and DEVELOCITY_CCUD_PLUGIN_VERSION are set to the latest versions
22+
// except if they are defined in the configuration
23+
if (config.getBuildScanPublishEnabled()) {
24+
maybeExportVariable('DEVELOCITY_INJECTION_ENABLED', 'true')
25+
maybeExportVariable('DEVELOCITY_PLUGIN_VERSION', '3.18.2')
26+
maybeExportVariable('DEVELOCITY_CCUD_PLUGIN_VERSION', '2.0.2')
27+
maybeExportVariable('DEVELOCITY_TERMS_OF_USE_URL', config.getBuildScanTermsOfUseUrl())
28+
maybeExportVariable('DEVELOCITY_TERMS_OF_USE_AGREE', config.getBuildScanTermsOfUseAgree())
29+
}
30+
2631
return setupToken(config.getDevelocityAccessKey(), config.getDevelocityTokenExpiry())
2732
}
2833

sources/test/init-scripts/settings.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
plugins {
22
id "com.gradle.develocity" version "3.18.2"
3-
id "com.gradle.common-custom-user-data-gradle-plugin" version "2.0.1"
3+
id "com.gradle.common-custom-user-data-gradle-plugin" version "2.0.2"
44
}
55

66
develocity {

sources/test/init-scripts/src/test/groovy/com/gradle/gradlebuildaction/BaseInitScriptTest.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import java.util.zip.GZIPOutputStream
1717

1818
class BaseInitScriptTest extends Specification {
1919
static final String DEVELOCITY_PLUGIN_VERSION = '3.18.2'
20-
static final String CCUD_PLUGIN_VERSION = '2.0.1'
20+
static final String CCUD_PLUGIN_VERSION = '2.0.2'
2121

2222
static final TestGradleVersion GRADLE_3_X = new TestGradleVersion(GradleVersion.version('3.5.1'), 7, 9)
2323
static final TestGradleVersion GRADLE_4_X = new TestGradleVersion(GradleVersion.version('4.10.3'), 7, 10)

0 commit comments

Comments
 (0)