Unverified Commit 2e02e662 authored by Daz DeBoer's avatar Daz DeBoer Committed by GitHub
Browse files

Allow a task name to be specified for dependency-submission (#135)

Fixes #125 
parents e235596c c9822ff5
Loading
Loading
Loading
Loading
+1 −1
Changes for .github/workflows/integ-test-dependency-submission.yml: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -112,7 +112,7 @@ jobs:
      uses: ./dependency-submission
      with:
        build-root-directory: .github/workflow-samples/groovy-dsl
        additional-arguments: --no-build-cache
        dependency-resolution-task: assemble
    - name: Check generated dependency graphs
      shell: bash
      run: |
+7
Changes for dependency-submission/action.yml: 7 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@ name: Gradle Dependency Submission
description: Generates a dependency graph for a Gradle project and submits it via the Dependency Submission API

inputs:
  # Gradle execution configuration
  gradle-version:
    description: |
      Gradle version to use. If specified, this Gradle version will be downloaded, added to the PATH and used for invoking Gradle.
@@ -12,6 +13,12 @@ inputs:
    description: Path to the root directory of the build. Default is the root of the GitHub workspace.
    required: false

  dependency-resolution-task:
    description: |
      Task(s) that should be executed in order to resolve all project dependencies. 
      By default, the built-in `:ForceDependencyResolutionPlugin_resolveAllDependencies` task is executed.
    required: false

  additional-arguments:
    description: |
      Additional arguments to pass to Gradle when generating the dependency graph. 
+32 −28
Changes for dist/dependency-submission/main/index.js: 32 added lines, 28 removed lines.
Original line number Diff line number Diff line
@@ -141501,16 +141501,18 @@ function run() {
            if (config.getDependencyGraphOption() === input_params_1.DependencyGraphOption.DownloadAndSubmit) {
                return;
            }
            const additionalArgs = core.getInput('additional-arguments');
            const executionConfig = new input_params_1.GradleExecutionConfig();
            const taskList = executionConfig.getDependencyResolutionTask();
            const additionalArgs = executionConfig.getAdditionalArguments();
            const executionArgs = `
              -Dorg.gradle.configureondemand=false
              -Dorg.gradle.dependency.verification=off
              -Dorg.gradle.unsafe.isolated-projects=false
              :ForceDependencyResolutionPlugin_resolveAllDependencies
              ${taskList}
              ${additionalArgs}
        `;
            const args = (0, string_argv_1.parseArgsStringToArgv)(executionArgs);
            yield gradle.provisionAndMaybeExecute(args);
            yield gradle.provisionAndMaybeExecute(executionConfig.getGradleVersion(), executionConfig.getBuildRootDirectory(), args);
            yield dependencyGraph.complete(config);
        }
        catch (error) {
@@ -141593,16 +141595,13 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.provisionAndMaybeExecute = void 0;
const core = __importStar(__nccwpck_require__(42186));
const exec = __importStar(__nccwpck_require__(71514));
const path = __importStar(__nccwpck_require__(71017));
const params = __importStar(__nccwpck_require__(23885));
const provisioner = __importStar(__nccwpck_require__(14042));
const gradlew = __importStar(__nccwpck_require__(46807));
const input_params_1 = __nccwpck_require__(23885);
function provisionAndMaybeExecute(args) {
function provisionAndMaybeExecute(gradleVersion, buildRootDirectory, args) {
    return __awaiter(this, void 0, void 0, function* () {
        const executable = yield provisioner.provisionGradle();
        const executable = yield provisioner.provisionGradle(gradleVersion);
        if (args.length > 0) {
            yield executeGradleBuild(executable, buildRootDirectory(), args);
            yield executeGradleBuild(executable, buildRootDirectory, args);
        }
    });
}
@@ -141619,14 +141618,6 @@ function executeGradleBuild(executable, root, args) {
        }
    });
}
function buildRootDirectory() {
    const baseDirectory = (0, input_params_1.getWorkspaceDirectory)();
    const buildRootDirectoryInput = params.getBuildRootDirectory();
    const resolvedBuildRootDirectory = buildRootDirectoryInput === ''
        ? path.resolve(baseDirectory)
        : path.resolve(baseDirectory, buildRootDirectoryInput);
    return resolvedBuildRootDirectory;
}
/***/ }),
@@ -141753,13 +141744,11 @@ const core = __importStar(__nccwpck_require__(42186));
const cache = __importStar(__nccwpck_require__(27799));
const toolCache = __importStar(__nccwpck_require__(27784));
const gradlew = __importStar(__nccwpck_require__(46807));
const params = __importStar(__nccwpck_require__(23885));
const cache_utils_1 = __nccwpck_require__(11044);
const input_params_1 = __nccwpck_require__(23885);
const gradleVersionsBaseUrl = 'https://services.gradle.org/versions';
function provisionGradle() {
function provisionGradle(gradleVersion) {
    return __awaiter(this, void 0, void 0, function* () {
        const gradleVersion = params.getGradleVersion();
        if (gradleVersion !== '' && gradleVersion !== 'wrapper') {
            return addToPath(yield installGradle(gradleVersion));
        }
@@ -141960,13 +141949,17 @@ var __importStar = (this && this.__importStar) || function (mod) {
    __setModuleDefault(result, mod);
    return result;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.parseNumericInput = exports.getWorkspaceDirectory = exports.getGithubToken = exports.getJobMatrix = exports.getArguments = exports.getBuildRootDirectory = exports.getGradleVersion = exports.BuildScanConfig = exports.JobSummaryOption = exports.SummaryConfig = exports.CacheConfig = exports.DependencyGraphOption = exports.DependencyGraphConfig = void 0;
exports.parseNumericInput = exports.getWorkspaceDirectory = exports.getGithubToken = exports.getJobMatrix = exports.GradleExecutionConfig = exports.BuildScanConfig = exports.JobSummaryOption = exports.SummaryConfig = exports.CacheConfig = exports.DependencyGraphOption = exports.DependencyGraphConfig = void 0;
const core = __importStar(__nccwpck_require__(42186));
const github = __importStar(__nccwpck_require__(95438));
const cache = __importStar(__nccwpck_require__(27799));
const summary_1 = __nccwpck_require__(81327);
const string_argv_1 = __nccwpck_require__(19663);
const path_1 = __importDefault(__nccwpck_require__(71017));
class DependencyGraphConfig {
    getDependencyGraphOption() {
        const val = core.getInput('dependency-graph');
@@ -142139,19 +142132,30 @@ class BuildScanConfig {
    }
}
exports.BuildScanConfig = BuildScanConfig;
function getGradleVersion() {
class GradleExecutionConfig {
    getGradleVersion() {
        return core.getInput('gradle-version');
    }
exports.getGradleVersion = getGradleVersion;
function getBuildRootDirectory() {
    return core.getInput('build-root-directory');
    getBuildRootDirectory() {
        const baseDirectory = getWorkspaceDirectory();
        const buildRootDirectoryInput = core.getInput('build-root-directory');
        const resolvedBuildRootDirectory = buildRootDirectoryInput === ''
            ? path_1.default.resolve(baseDirectory)
            : path_1.default.resolve(baseDirectory, buildRootDirectoryInput);
        return resolvedBuildRootDirectory;
    }
exports.getBuildRootDirectory = getBuildRootDirectory;
function getArguments() {
    getArguments() {
        const input = core.getInput('arguments');
        return (0, string_argv_1.parseArgsStringToArgv)(input);
    }
exports.getArguments = getArguments;
    getDependencyResolutionTask() {
        return core.getInput('dependency-resolution-task') || ':ForceDependencyResolutionPlugin_resolveAllDependencies';
    }
    getAdditionalArguments() {
        return core.getInput('additional-arguments');
    }
}
exports.GradleExecutionConfig = GradleExecutionConfig;
function getJobMatrix() {
    return core.getInput('workflow-job-context');
}
+1 −1

File changed.

Preview size limit exceeded, changes collapsed.

+23 −8
Changes for dist/dependency-submission/post/index.js: 23 added lines, 8 removed lines.
Original line number Diff line number Diff line
@@ -92728,13 +92728,17 @@ var __importStar = (this && this.__importStar) || function (mod) {
    __setModuleDefault(result, mod);
    return result;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.parseNumericInput = exports.getWorkspaceDirectory = exports.getGithubToken = exports.getJobMatrix = exports.getArguments = exports.getBuildRootDirectory = exports.getGradleVersion = exports.BuildScanConfig = exports.JobSummaryOption = exports.SummaryConfig = exports.CacheConfig = exports.DependencyGraphOption = exports.DependencyGraphConfig = void 0;
exports.parseNumericInput = exports.getWorkspaceDirectory = exports.getGithubToken = exports.getJobMatrix = exports.GradleExecutionConfig = exports.BuildScanConfig = exports.JobSummaryOption = exports.SummaryConfig = exports.CacheConfig = exports.DependencyGraphOption = exports.DependencyGraphConfig = void 0;
const core = __importStar(__nccwpck_require__(2186));
const github = __importStar(__nccwpck_require__(5438));
const cache = __importStar(__nccwpck_require__(7799));
const summary_1 = __nccwpck_require__(1327);
const string_argv_1 = __nccwpck_require__(9663);
const path_1 = __importDefault(__nccwpck_require__(1017));
class DependencyGraphConfig {
    getDependencyGraphOption() {
        const val = core.getInput('dependency-graph');
@@ -92907,19 +92911,30 @@ class BuildScanConfig {
    }
}
exports.BuildScanConfig = BuildScanConfig;
function getGradleVersion() {
class GradleExecutionConfig {
    getGradleVersion() {
        return core.getInput('gradle-version');
    }
exports.getGradleVersion = getGradleVersion;
function getBuildRootDirectory() {
    return core.getInput('build-root-directory');
    getBuildRootDirectory() {
        const baseDirectory = getWorkspaceDirectory();
        const buildRootDirectoryInput = core.getInput('build-root-directory');
        const resolvedBuildRootDirectory = buildRootDirectoryInput === ''
            ? path_1.default.resolve(baseDirectory)
            : path_1.default.resolve(baseDirectory, buildRootDirectoryInput);
        return resolvedBuildRootDirectory;
    }
exports.getBuildRootDirectory = getBuildRootDirectory;
function getArguments() {
    getArguments() {
        const input = core.getInput('arguments');
        return (0, string_argv_1.parseArgsStringToArgv)(input);
    }
exports.getArguments = getArguments;
    getDependencyResolutionTask() {
        return core.getInput('dependency-resolution-task') || ':ForceDependencyResolutionPlugin_resolveAllDependencies';
    }
    getAdditionalArguments() {
        return core.getInput('additional-arguments');
    }
}
exports.GradleExecutionConfig = GradleExecutionConfig;
function getJobMatrix() {
    return core.getInput('workflow-job-context');
}
Loading