Unverified Commit 5a171ce5 authored by Pavlo Shevchenko's avatar Pavlo Shevchenko Committed by GitHub
Browse files

Inject Develocity plugin for versions 3.17 and above (#62)

To handle the rebranding of the GE plugin, this PR updates the inject-develocity init script 
to apply the `com.gradle.develocity` plugin if `3.17+` version of the plugin is requested. 
parent 55124347
Loading
Loading
Loading
Loading
+6 −4
Changes for .github/workflows/integ-test-inject-develocity.yml: 6 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -24,13 +24,15 @@ jobs:
    env:
      DEVELOCITY_INJECTION_ENABLED: true
      DEVELOCITY_URL: https://ge.solutions-team.gradle.com
      DEVELOCITY_PLUGIN_VERSION: 3.16.2
      DEVELOCITY_PLUGIN_VERSION: ${{ matrix.plugin-version }}
      DEVELOCITY_CCUD_PLUGIN_VERSION: 1.13
      GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }} # This env var has not (yet) been renamed/aliased in GE plugin 3.16.2
      GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }} # required to test against GE plugin 3.16.2
      DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
    strategy:
      matrix:
        gradle: [current, 7.6.2, 6.9.4, 5.6.4]
        os: ${{fromJSON(inputs.runner-os)}}
        plugin-version: [3.16.2, 3.17]
    runs-on: ubuntu-latest
    steps:
    - name: Checkout sources
@@ -81,8 +83,8 @@ jobs:
        cache-read-only: false # For testing, allow writing cache entries on non-default branches
        gradle-version: ${{ matrix.gradle }}
        build-scan-publish: true
        build-scan-terms-of-service-url: "https://gradle.com/terms-of-service"
        build-scan-terms-of-service-agree: "yes"
        build-scan-terms-of-use-url: "https://gradle.com/terms-of-service"
        build-scan-terms-of-use-agree: "yes"
    - name: Run Gradle build
      id: gradle
      working-directory: .github/workflow-samples/no-ge
+3 −3
Changes for dependency-submission/README.md: 3 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -97,15 +97,15 @@ offending dependency.
### Publishing a Develocity Build Scan® from your dependency submission workflow

You can automatically publish a Build Scan on every run of `gradle/actions/dependency-submission`. Three input parameters are 
required, one to enable publishing and two more to accept the [Develocity terms of service](https://gradle.com/terms-of-service).
required, one to enable publishing and two more to accept the [Develocity terms of use](https://gradle.com/help/legal-terms-of-use).

```yaml
    - name: Generate and submit dependency graph
      uses: gradle/actions/dependency-submission@v3
      with:
        build-scan-publish: true
        build-scan-terms-of-service-url: "https://gradle.com/terms-of-service"
        build-scan-terms-of-service-agree: "yes"
        build-scan-terms-of-use-url: "https://gradle.com/terms-of-service"
        build-scan-terms-of-use-agree: "yes"
```

### When you cannot publish a Build Scan®
+7 −7
Changes for dependency-submission/action.yml: 7 added lines, 7 removed lines.
Original line number Diff line number Diff line
@@ -37,14 +37,14 @@ inputs:
  build-scan-publish:
    description: |
      Set to 'true' to automatically publish build results as a Build Scan on scans.gradle.com.
      For publication to succeed without user input, you must also provide values for `build-scan-terms-of-service-url` and 'build-scan-terms-of-service-agree'.
      For publication to succeed without user input, you must also provide values for `build-scan-terms-of-use-url` and 'build-scan-terms-of-use-agree'.
    required: false
    default: false
  build-scan-terms-of-service-url:
    description: The URL to the Build Scan® terms of service. This input must be set to 'https://gradle.com/terms-of-service'.
  build-scan-terms-of-use-url:
    description: The URL to the Build Scan® terms of use. This input must be set to 'https://gradle.com/help/legal-terms-of-use'.
    required: false
  build-scan-terms-of-service-agree:
    description: Indicate that you agree to the Build Scan® terms of service. This input value must be "yes".
  build-scan-terms-of-use-agree:
    description: Indicate that you agree to the Build Scan® terms of use. This input value must be "yes".
    required: false

runs:
@@ -67,8 +67,8 @@ runs:
        build-root-directory: ${{ inputs.build-root-directory }}
        cache-encryption-key: ${{ inputs.cache-encryption-key }}
        build-scan-publish: ${{ inputs.build-scan-publish }}
        build-scan-terms-of-service-url: ${{ inputs.build-scan-terms-of-service-url }}
        build-scan-terms-of-service-agree: ${{ inputs.build-scan-terms-of-service-agree }}
        build-scan-terms-of-use-url: ${{ inputs.build-scan-terms-of-use-url }}
        build-scan-terms-of-use-agree: ${{ inputs.build-scan-terms-of-use-agree }}
        artifact-retention-days: 1
        arguments: |
          -Dorg.gradle.configureondemand=false
+24 −14
Changes for dist/setup-gradle/main/index.js: 24 added lines, 14 removed lines.
Original line number Diff line number Diff line
@@ -139453,19 +139453,22 @@ exports.setup = void 0;
const core = __importStar(__nccwpck_require__(42186));
const input_params_1 = __nccwpck_require__(23885);
function setup() {
    if ((0, input_params_1.getBuildScanPublishEnabled)() && verifyTermsOfServiceAgreement()) {
    maybeExportVariable('DEVELOCITY_INJECTION_INIT_SCRIPT_NAME', 'gradle-actions.inject-develocity.init.gradle');
    maybeExportVariable('DEVELOCITY_AUTO_INJECTION_CUSTOM_VALUE', 'gradle-actions');
    if ((0, input_params_1.getBuildScanPublishEnabled)() && verifyTermsOfUseAgreement()) {
        maybeExportVariable('DEVELOCITY_INJECTION_ENABLED', 'true');
        maybeExportVariable('DEVELOCITY_PLUGIN_VERSION', '3.16.2');
        maybeExportVariable('DEVELOCITY_CCUD_PLUGIN_VERSION', '1.13');
        maybeExportVariable('BUILD_SCAN_TERMS_OF_SERVICE_URL', (0, input_params_1.getBuildScanTermsOfServiceUrl)());
        maybeExportVariable('BUILD_SCAN_TERMS_OF_SERVICE_AGREE', (0, input_params_1.getBuildScanTermsOfServiceAgree)());
        maybeExportVariable('DEVELOCITY_TERMS_OF_USE_URL', (0, input_params_1.getBuildScanTermsOfUseUrl)());
        maybeExportVariable('DEVELOCITY_TERMS_OF_USE_AGREE', (0, input_params_1.getBuildScanTermsOfUseAgree)());
    }
}
exports.setup = setup;
function verifyTermsOfServiceAgreement() {
    if ((0, input_params_1.getBuildScanTermsOfServiceUrl)() !== 'https://gradle.com/terms-of-service' ||
        (0, input_params_1.getBuildScanTermsOfServiceAgree)() !== 'yes') {
        core.warning(`Terms of service must be agreed in order to publish build scans.`);
function verifyTermsOfUseAgreement() {
    if (((0, input_params_1.getBuildScanTermsOfUseUrl)() !== 'https://gradle.com/terms-of-service' &&
        (0, input_params_1.getBuildScanTermsOfUseUrl)() !== 'https://gradle.com/help/legal-terms-of-use') ||
        (0, input_params_1.getBuildScanTermsOfUseAgree)() !== 'yes') {
        core.warning(`Terms of use must be agreed in order to publish build scans.`);
        return false;
    }
    return true;
@@ -141322,7 +141325,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
    return result;
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.JobSummaryOption = exports.DependencyGraphOption = exports.parseNumericInput = exports.getArtifactRetentionDays = exports.getDependencyGraphContinueOnFailure = exports.getDependencyGraphOption = exports.getBuildScanTermsOfServiceAgree = exports.getBuildScanTermsOfServiceUrl = exports.getBuildScanPublishEnabled = exports.getPRCommentOption = exports.getJobSummaryOption = exports.isJobSummaryEnabled = exports.getGithubToken = exports.getJobMatrix = exports.getArguments = exports.getGradleVersion = exports.getBuildRootDirectory = exports.getCacheExcludes = exports.getCacheIncludes = exports.getCacheEncryptionKey = exports.isCacheCleanupEnabled = exports.isCacheDebuggingEnabled = exports.isCacheStrictMatch = exports.isCacheOverwriteExisting = exports.isCacheWriteOnly = exports.isCacheReadOnly = exports.isCacheDisabled = void 0;
exports.JobSummaryOption = exports.DependencyGraphOption = exports.parseNumericInput = exports.getArtifactRetentionDays = exports.getDependencyGraphContinueOnFailure = exports.getDependencyGraphOption = exports.getBuildScanTermsOfUseAgree = exports.getBuildScanTermsOfUseUrl = exports.getBuildScanPublishEnabled = exports.getPRCommentOption = exports.getJobSummaryOption = exports.isJobSummaryEnabled = exports.getGithubToken = exports.getJobMatrix = exports.getArguments = exports.getGradleVersion = exports.getBuildRootDirectory = exports.getCacheExcludes = exports.getCacheIncludes = exports.getCacheEncryptionKey = exports.isCacheCleanupEnabled = exports.isCacheDebuggingEnabled = exports.isCacheStrictMatch = exports.isCacheOverwriteExisting = exports.isCacheWriteOnly = exports.isCacheReadOnly = exports.isCacheDisabled = void 0;
const core = __importStar(__nccwpck_require__(42186));
const string_argv_1 = __nccwpck_require__(19663);
function isCacheDisabled() {
@@ -141402,14 +141405,21 @@ function getBuildScanPublishEnabled() {
    return getBooleanInput('build-scan-publish');
}
exports.getBuildScanPublishEnabled = getBuildScanPublishEnabled;
function getBuildScanTermsOfServiceUrl() {
    return core.getInput('build-scan-terms-of-service-url');
function getBuildScanTermsOfUseUrl() {
    return getTermsOfUseProp('build-scan-terms-of-use-url', 'build-scan-terms-of-service-url');
}
exports.getBuildScanTermsOfServiceUrl = getBuildScanTermsOfServiceUrl;
function getBuildScanTermsOfServiceAgree() {
    return core.getInput('build-scan-terms-of-service-agree');
exports.getBuildScanTermsOfUseUrl = getBuildScanTermsOfUseUrl;
function getBuildScanTermsOfUseAgree() {
    return getTermsOfUseProp('build-scan-terms-of-use-agree', 'build-scan-terms-of-service-agree');
}
exports.getBuildScanTermsOfUseAgree = getBuildScanTermsOfUseAgree;
function getTermsOfUseProp(newPropName, oldPropName) {
    const newProp = core.getInput(newPropName);
    if (newProp !== '') {
        return newProp;
    }
    return core.getInput(oldPropName);
}
exports.getBuildScanTermsOfServiceAgree = getBuildScanTermsOfServiceAgree;
function parseJobSummaryOption(paramName) {
    const val = core.getInput(paramName);
    switch (val.toLowerCase().trim()) {
+1 −1

File changed.

Preview size limit exceeded, changes collapsed.

Loading