mirror of
https://github.com/gradle/actions
synced 2024-11-24 02:12:12 +00:00
[bot] Update dist directory
Some checks failed
CI-integ-test-full / other-integ-tests (push) Has been cancelled
CI-integ-test / build-distribution (push) Has been cancelled
CI-update-dist / update-dist (push) Has been cancelled
CI-check-and-unit-test / check-format-and-unit-test (push) Has been cancelled
CI-codeql / Analyze (javascript-typescript) (push) Has been cancelled
CI-init-script-check / test-init-scripts (push) Has been cancelled
CI-integ-test-full / caching-integ-tests (push) Has been cancelled
CI-integ-test / caching-integ-tests (push) Has been cancelled
CI-integ-test / other-integ-tests (push) Has been cancelled
Some checks failed
CI-integ-test-full / other-integ-tests (push) Has been cancelled
CI-integ-test / build-distribution (push) Has been cancelled
CI-update-dist / update-dist (push) Has been cancelled
CI-check-and-unit-test / check-format-and-unit-test (push) Has been cancelled
CI-codeql / Analyze (javascript-typescript) (push) Has been cancelled
CI-init-script-check / test-init-scripts (push) Has been cancelled
CI-integ-test-full / caching-integ-tests (push) Has been cancelled
CI-integ-test / caching-integ-tests (push) Has been cancelled
CI-integ-test / other-integ-tests (push) Has been cancelled
This commit is contained in:
parent
7e0f050645
commit
5baa1ded34
8 changed files with 426 additions and 100 deletions
89
dist/dependency-submission/main/index.js
vendored
89
dist/dependency-submission/main/index.js
vendored
|
@ -179917,7 +179917,7 @@ class CacheCleaner {
|
||||||
}
|
}
|
||||||
`);
|
`);
|
||||||
fs_1.default.writeFileSync(path_1.default.resolve(cleanupProjectDir, 'build.gradle'), 'task("noop") {}');
|
fs_1.default.writeFileSync(path_1.default.resolve(cleanupProjectDir, 'build.gradle'), 'task("noop") {}');
|
||||||
const executable = await provisioner.provisionGradle('current');
|
const executable = await provisioner.provisionGradleAtLeast('8.9');
|
||||||
await core.group('Executing Gradle to clean up caches', async () => {
|
await core.group('Executing Gradle to clean up caches', async () => {
|
||||||
core.info(`Cleaning up caches last used before ${cleanTimestamp}`);
|
core.info(`Cleaning up caches last used before ${cleanTimestamp}`);
|
||||||
await this.executeCleanupBuild(executable, cleanupProjectDir);
|
await this.executeCleanupBuild(executable, cleanupProjectDir);
|
||||||
|
@ -180599,11 +180599,11 @@ const path_1 = __importDefault(__nccwpck_require__(71017));
|
||||||
const fs_1 = __importDefault(__nccwpck_require__(57147));
|
const fs_1 = __importDefault(__nccwpck_require__(57147));
|
||||||
const core = __importStar(__nccwpck_require__(42186));
|
const core = __importStar(__nccwpck_require__(42186));
|
||||||
const glob = __importStar(__nccwpck_require__(28090));
|
const glob = __importStar(__nccwpck_require__(28090));
|
||||||
const semver = __importStar(__nccwpck_require__(11383));
|
|
||||||
const cache_utils_1 = __nccwpck_require__(11044);
|
const cache_utils_1 = __nccwpck_require__(11044);
|
||||||
const build_results_1 = __nccwpck_require__(82107);
|
const build_results_1 = __nccwpck_require__(82107);
|
||||||
const configuration_1 = __nccwpck_require__(15778);
|
const configuration_1 = __nccwpck_require__(15778);
|
||||||
const cache_key_1 = __nccwpck_require__(50100);
|
const cache_key_1 = __nccwpck_require__(50100);
|
||||||
|
const gradle_1 = __nccwpck_require__(94475);
|
||||||
const SKIP_RESTORE_VAR = 'GRADLE_BUILD_ACTION_SKIP_RESTORE';
|
const SKIP_RESTORE_VAR = 'GRADLE_BUILD_ACTION_SKIP_RESTORE';
|
||||||
const CACHE_PROTOCOL_VERSION = 'v1';
|
const CACHE_PROTOCOL_VERSION = 'v1';
|
||||||
class ExtractedCacheEntry {
|
class ExtractedCacheEntry {
|
||||||
|
@ -180842,8 +180842,7 @@ class ConfigurationCacheEntryExtractor extends AbstractEntryExtractor {
|
||||||
return Object.entries(groupedResults).map(([configCachePath, pathResults]) => {
|
return Object.entries(groupedResults).map(([configCachePath, pathResults]) => {
|
||||||
const definition = new ExtractedCacheEntryDefinition('configuration-cache', configCachePath, true).withNonUniqueFileNames();
|
const definition = new ExtractedCacheEntryDefinition('configuration-cache', configCachePath, true).withNonUniqueFileNames();
|
||||||
if (pathResults.find(result => {
|
if (pathResults.find(result => {
|
||||||
const gradleVersion = semver.coerce(result.gradleVersion);
|
return !(0, gradle_1.versionIsAtLeast)(result.gradleVersion, '8.6.0');
|
||||||
return gradleVersion && semver.lt(gradleVersion, '8.6.0');
|
|
||||||
})) {
|
})) {
|
||||||
core.info(`Not saving config-cache data for ${configCachePath}. Configuration cache data is only saved for Gradle 8.6+`);
|
core.info(`Not saving config-cache data for ${configCachePath}. Configuration cache data is only saved for Gradle 8.6+`);
|
||||||
definition.notCacheableBecause('Configuration cache data only saved for Gradle 8.6+');
|
definition.notCacheableBecause('Configuration cache data only saved for Gradle 8.6+');
|
||||||
|
@ -182339,10 +182338,18 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
||||||
__setModuleDefault(result, mod);
|
__setModuleDefault(result, mod);
|
||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
|
};
|
||||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||||
exports.provisionAndMaybeExecute = provisionAndMaybeExecute;
|
exports.provisionAndMaybeExecute = provisionAndMaybeExecute;
|
||||||
|
exports.versionIsAtLeast = versionIsAtLeast;
|
||||||
|
exports.findGradleVersionOnPath = findGradleVersionOnPath;
|
||||||
|
exports.parseGradleVersionFromOutput = parseGradleVersionFromOutput;
|
||||||
const core = __importStar(__nccwpck_require__(42186));
|
const core = __importStar(__nccwpck_require__(42186));
|
||||||
const exec = __importStar(__nccwpck_require__(71514));
|
const exec = __importStar(__nccwpck_require__(71514));
|
||||||
|
const which_1 = __importDefault(__nccwpck_require__(6143));
|
||||||
|
const semver = __importStar(__nccwpck_require__(11383));
|
||||||
const provisioner = __importStar(__nccwpck_require__(14042));
|
const provisioner = __importStar(__nccwpck_require__(14042));
|
||||||
const gradlew = __importStar(__nccwpck_require__(46807));
|
const gradlew = __importStar(__nccwpck_require__(46807));
|
||||||
async function provisionAndMaybeExecute(gradleVersion, buildRootDirectory, args) {
|
async function provisionAndMaybeExecute(gradleVersion, buildRootDirectory, args) {
|
||||||
|
@ -182361,6 +182368,39 @@ async function executeGradleBuild(executable, root, args) {
|
||||||
core.setFailed(`Gradle build failed: see console output for details`);
|
core.setFailed(`Gradle build failed: see console output for details`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
function versionIsAtLeast(actualVersion, requiredVersion) {
|
||||||
|
const splitVersion = actualVersion.split('-');
|
||||||
|
const coreVersion = splitVersion[0];
|
||||||
|
const prerelease = splitVersion.length > 1;
|
||||||
|
const actualSemver = semver.coerce(coreVersion);
|
||||||
|
const comparisonSemver = semver.coerce(requiredVersion);
|
||||||
|
if (prerelease) {
|
||||||
|
return semver.gt(actualSemver, comparisonSemver);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return semver.gte(actualSemver, comparisonSemver);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
async function findGradleVersionOnPath() {
|
||||||
|
const gradleExecutable = await (0, which_1.default)('gradle', { nothrow: true });
|
||||||
|
if (gradleExecutable) {
|
||||||
|
const output = await exec.getExecOutput(gradleExecutable, ['-v'], { silent: true });
|
||||||
|
const version = parseGradleVersionFromOutput(output.stdout);
|
||||||
|
return version ? new GradleExecutable(version, gradleExecutable) : undefined;
|
||||||
|
}
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
function parseGradleVersionFromOutput(output) {
|
||||||
|
const regex = /Gradle (\d+\.\d+(\.\d+)?(-.*)?)/;
|
||||||
|
const versionString = output.match(regex)?.[1];
|
||||||
|
return versionString;
|
||||||
|
}
|
||||||
|
class GradleExecutable {
|
||||||
|
constructor(version, executable) {
|
||||||
|
this.version = version;
|
||||||
|
this.executable = executable;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
@ -182467,20 +182507,17 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
||||||
__setModuleDefault(result, mod);
|
__setModuleDefault(result, mod);
|
||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
||||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
||||||
};
|
|
||||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||||
exports.provisionGradle = provisionGradle;
|
exports.provisionGradle = provisionGradle;
|
||||||
|
exports.provisionGradleAtLeast = provisionGradleAtLeast;
|
||||||
const fs = __importStar(__nccwpck_require__(57147));
|
const fs = __importStar(__nccwpck_require__(57147));
|
||||||
const os = __importStar(__nccwpck_require__(22037));
|
const os = __importStar(__nccwpck_require__(22037));
|
||||||
const path = __importStar(__nccwpck_require__(71017));
|
const path = __importStar(__nccwpck_require__(71017));
|
||||||
const which_1 = __importDefault(__nccwpck_require__(6143));
|
|
||||||
const httpm = __importStar(__nccwpck_require__(96255));
|
const httpm = __importStar(__nccwpck_require__(96255));
|
||||||
const core = __importStar(__nccwpck_require__(42186));
|
const core = __importStar(__nccwpck_require__(42186));
|
||||||
const cache = __importStar(__nccwpck_require__(27799));
|
const cache = __importStar(__nccwpck_require__(27799));
|
||||||
const exec = __importStar(__nccwpck_require__(71514));
|
|
||||||
const toolCache = __importStar(__nccwpck_require__(27784));
|
const toolCache = __importStar(__nccwpck_require__(27784));
|
||||||
|
const gradle_1 = __nccwpck_require__(94475);
|
||||||
const gradlew = __importStar(__nccwpck_require__(46807));
|
const gradlew = __importStar(__nccwpck_require__(46807));
|
||||||
const cache_utils_1 = __nccwpck_require__(11044);
|
const cache_utils_1 = __nccwpck_require__(11044);
|
||||||
const configuration_1 = __nccwpck_require__(15778);
|
const configuration_1 = __nccwpck_require__(15778);
|
||||||
|
@ -182491,6 +182528,10 @@ async function provisionGradle(gradleVersion) {
|
||||||
}
|
}
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
async function provisionGradleAtLeast(gradleVersion) {
|
||||||
|
const installedVersion = await installGradleVersionAtLeast(await gradleRelease(gradleVersion));
|
||||||
|
return addToPath(installedVersion);
|
||||||
|
}
|
||||||
async function addToPath(executable) {
|
async function addToPath(executable) {
|
||||||
core.addPath(path.dirname(executable));
|
core.addPath(path.dirname(executable));
|
||||||
return executable;
|
return executable;
|
||||||
|
@ -182514,7 +182555,7 @@ async function resolveGradleVersion(version) {
|
||||||
case 'release-nightly':
|
case 'release-nightly':
|
||||||
return gradleReleaseNightly();
|
return gradleReleaseNightly();
|
||||||
default:
|
default:
|
||||||
return gradle(version);
|
return gradleRelease(version);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
async function gradleCurrent() {
|
async function gradleCurrent() {
|
||||||
|
@ -182534,7 +182575,7 @@ async function gradleNightly() {
|
||||||
async function gradleReleaseNightly() {
|
async function gradleReleaseNightly() {
|
||||||
return await gradleVersionDeclaration(`${gradleVersionsBaseUrl}/release-nightly`);
|
return await gradleVersionDeclaration(`${gradleVersionsBaseUrl}/release-nightly`);
|
||||||
}
|
}
|
||||||
async function gradle(version) {
|
async function gradleRelease(version) {
|
||||||
const versionInfo = await findGradleVersionDeclaration(version);
|
const versionInfo = await findGradleVersionDeclaration(version);
|
||||||
if (!versionInfo) {
|
if (!versionInfo) {
|
||||||
throw new Error(`Gradle version ${version} does not exists`);
|
throw new Error(`Gradle version ${version} does not exists`);
|
||||||
|
@ -182552,10 +182593,20 @@ async function findGradleVersionDeclaration(version) {
|
||||||
}
|
}
|
||||||
async function installGradleVersion(versionInfo) {
|
async function installGradleVersion(versionInfo) {
|
||||||
return core.group(`Provision Gradle ${versionInfo.version}`, async () => {
|
return core.group(`Provision Gradle ${versionInfo.version}`, async () => {
|
||||||
const preInstalledGradle = await findGradleVersionOnPath(versionInfo);
|
const gradleOnPath = await (0, gradle_1.findGradleVersionOnPath)();
|
||||||
if (preInstalledGradle !== undefined) {
|
if (gradleOnPath?.version === versionInfo.version) {
|
||||||
core.info(`Gradle version ${versionInfo.version} is already available on PATH. Not installing.`);
|
core.info(`Gradle version ${versionInfo.version} is already available on PATH. Not installing.`);
|
||||||
return preInstalledGradle;
|
return gradleOnPath.executable;
|
||||||
|
}
|
||||||
|
return locateGradleAndDownloadIfRequired(versionInfo);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
async function installGradleVersionAtLeast(versionInfo) {
|
||||||
|
return core.group(`Provision Gradle >= ${versionInfo.version}`, async () => {
|
||||||
|
const gradleOnPath = await (0, gradle_1.findGradleVersionOnPath)();
|
||||||
|
if (gradleOnPath && (0, gradle_1.versionIsAtLeast)(gradleOnPath.version, versionInfo.version)) {
|
||||||
|
core.info(`Gradle version ${gradleOnPath.version} is available on PATH and >= ${versionInfo.version}. Not installing.`);
|
||||||
|
return gradleOnPath.executable;
|
||||||
}
|
}
|
||||||
return locateGradleAndDownloadIfRequired(versionInfo);
|
return locateGradleAndDownloadIfRequired(versionInfo);
|
||||||
});
|
});
|
||||||
|
@ -182627,16 +182678,6 @@ async function httpGetString(url) {
|
||||||
const response = await httpClient.get(url);
|
const response = await httpClient.get(url);
|
||||||
return response.readBody();
|
return response.readBody();
|
||||||
}
|
}
|
||||||
async function findGradleVersionOnPath(versionInfo) {
|
|
||||||
const gradleExecutable = await (0, which_1.default)('gradle', { nothrow: true });
|
|
||||||
if (gradleExecutable) {
|
|
||||||
const output = await exec.getExecOutput(gradleExecutable, ['-v'], { silent: true });
|
|
||||||
if (output.stdout.includes(`\nGradle ${versionInfo.version}\n`)) {
|
|
||||||
return gradleExecutable;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
2
dist/dependency-submission/main/index.js.map
vendored
2
dist/dependency-submission/main/index.js.map
vendored
File diff suppressed because one or more lines are too long
143
dist/dependency-submission/post/index.js
vendored
143
dist/dependency-submission/post/index.js
vendored
|
@ -133523,7 +133523,7 @@ class CacheCleaner {
|
||||||
}
|
}
|
||||||
`);
|
`);
|
||||||
fs_1.default.writeFileSync(path_1.default.resolve(cleanupProjectDir, 'build.gradle'), 'task("noop") {}');
|
fs_1.default.writeFileSync(path_1.default.resolve(cleanupProjectDir, 'build.gradle'), 'task("noop") {}');
|
||||||
const executable = await provisioner.provisionGradle('current');
|
const executable = await provisioner.provisionGradleAtLeast('8.9');
|
||||||
await core.group('Executing Gradle to clean up caches', async () => {
|
await core.group('Executing Gradle to clean up caches', async () => {
|
||||||
core.info(`Cleaning up caches last used before ${cleanTimestamp}`);
|
core.info(`Cleaning up caches last used before ${cleanTimestamp}`);
|
||||||
await this.executeCleanupBuild(executable, cleanupProjectDir);
|
await this.executeCleanupBuild(executable, cleanupProjectDir);
|
||||||
|
@ -134205,11 +134205,11 @@ const path_1 = __importDefault(__nccwpck_require__(71017));
|
||||||
const fs_1 = __importDefault(__nccwpck_require__(57147));
|
const fs_1 = __importDefault(__nccwpck_require__(57147));
|
||||||
const core = __importStar(__nccwpck_require__(42186));
|
const core = __importStar(__nccwpck_require__(42186));
|
||||||
const glob = __importStar(__nccwpck_require__(28090));
|
const glob = __importStar(__nccwpck_require__(28090));
|
||||||
const semver = __importStar(__nccwpck_require__(11383));
|
|
||||||
const cache_utils_1 = __nccwpck_require__(11044);
|
const cache_utils_1 = __nccwpck_require__(11044);
|
||||||
const build_results_1 = __nccwpck_require__(82107);
|
const build_results_1 = __nccwpck_require__(82107);
|
||||||
const configuration_1 = __nccwpck_require__(15778);
|
const configuration_1 = __nccwpck_require__(15778);
|
||||||
const cache_key_1 = __nccwpck_require__(50100);
|
const cache_key_1 = __nccwpck_require__(50100);
|
||||||
|
const gradle_1 = __nccwpck_require__(94475);
|
||||||
const SKIP_RESTORE_VAR = 'GRADLE_BUILD_ACTION_SKIP_RESTORE';
|
const SKIP_RESTORE_VAR = 'GRADLE_BUILD_ACTION_SKIP_RESTORE';
|
||||||
const CACHE_PROTOCOL_VERSION = 'v1';
|
const CACHE_PROTOCOL_VERSION = 'v1';
|
||||||
class ExtractedCacheEntry {
|
class ExtractedCacheEntry {
|
||||||
|
@ -134448,8 +134448,7 @@ class ConfigurationCacheEntryExtractor extends AbstractEntryExtractor {
|
||||||
return Object.entries(groupedResults).map(([configCachePath, pathResults]) => {
|
return Object.entries(groupedResults).map(([configCachePath, pathResults]) => {
|
||||||
const definition = new ExtractedCacheEntryDefinition('configuration-cache', configCachePath, true).withNonUniqueFileNames();
|
const definition = new ExtractedCacheEntryDefinition('configuration-cache', configCachePath, true).withNonUniqueFileNames();
|
||||||
if (pathResults.find(result => {
|
if (pathResults.find(result => {
|
||||||
const gradleVersion = semver.coerce(result.gradleVersion);
|
return !(0, gradle_1.versionIsAtLeast)(result.gradleVersion, '8.6.0');
|
||||||
return gradleVersion && semver.lt(gradleVersion, '8.6.0');
|
|
||||||
})) {
|
})) {
|
||||||
core.info(`Not saving config-cache data for ${configCachePath}. Configuration cache data is only saved for Gradle 8.6+`);
|
core.info(`Not saving config-cache data for ${configCachePath}. Configuration cache data is only saved for Gradle 8.6+`);
|
||||||
definition.notCacheableBecause('Configuration cache data only saved for Gradle 8.6+');
|
definition.notCacheableBecause('Configuration cache data only saved for Gradle 8.6+');
|
||||||
|
@ -135646,6 +135645,101 @@ function handlePostActionError(error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ 94475:
|
||||||
|
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||||
|
if (k2 === undefined) k2 = k;
|
||||||
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||||
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||||
|
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||||
|
}
|
||||||
|
Object.defineProperty(o, k2, desc);
|
||||||
|
}) : (function(o, m, k, k2) {
|
||||||
|
if (k2 === undefined) k2 = k;
|
||||||
|
o[k2] = m[k];
|
||||||
|
}));
|
||||||
|
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||||
|
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||||
|
}) : function(o, v) {
|
||||||
|
o["default"] = v;
|
||||||
|
});
|
||||||
|
var __importStar = (this && this.__importStar) || function (mod) {
|
||||||
|
if (mod && mod.__esModule) return mod;
|
||||||
|
var result = {};
|
||||||
|
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||||
|
__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.provisionAndMaybeExecute = provisionAndMaybeExecute;
|
||||||
|
exports.versionIsAtLeast = versionIsAtLeast;
|
||||||
|
exports.findGradleVersionOnPath = findGradleVersionOnPath;
|
||||||
|
exports.parseGradleVersionFromOutput = parseGradleVersionFromOutput;
|
||||||
|
const core = __importStar(__nccwpck_require__(42186));
|
||||||
|
const exec = __importStar(__nccwpck_require__(71514));
|
||||||
|
const which_1 = __importDefault(__nccwpck_require__(6143));
|
||||||
|
const semver = __importStar(__nccwpck_require__(11383));
|
||||||
|
const provisioner = __importStar(__nccwpck_require__(14042));
|
||||||
|
const gradlew = __importStar(__nccwpck_require__(46807));
|
||||||
|
async function provisionAndMaybeExecute(gradleVersion, buildRootDirectory, args) {
|
||||||
|
const executable = await provisioner.provisionGradle(gradleVersion);
|
||||||
|
if (args.length > 0) {
|
||||||
|
await executeGradleBuild(executable, buildRootDirectory, args);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
async function executeGradleBuild(executable, root, args) {
|
||||||
|
const toExecute = executable ?? gradlew.gradleWrapperScript(root);
|
||||||
|
const status = await exec.exec(toExecute, args, {
|
||||||
|
cwd: root,
|
||||||
|
ignoreReturnCode: true
|
||||||
|
});
|
||||||
|
if (status !== 0) {
|
||||||
|
core.setFailed(`Gradle build failed: see console output for details`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function versionIsAtLeast(actualVersion, requiredVersion) {
|
||||||
|
const splitVersion = actualVersion.split('-');
|
||||||
|
const coreVersion = splitVersion[0];
|
||||||
|
const prerelease = splitVersion.length > 1;
|
||||||
|
const actualSemver = semver.coerce(coreVersion);
|
||||||
|
const comparisonSemver = semver.coerce(requiredVersion);
|
||||||
|
if (prerelease) {
|
||||||
|
return semver.gt(actualSemver, comparisonSemver);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return semver.gte(actualSemver, comparisonSemver);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
async function findGradleVersionOnPath() {
|
||||||
|
const gradleExecutable = await (0, which_1.default)('gradle', { nothrow: true });
|
||||||
|
if (gradleExecutable) {
|
||||||
|
const output = await exec.getExecOutput(gradleExecutable, ['-v'], { silent: true });
|
||||||
|
const version = parseGradleVersionFromOutput(output.stdout);
|
||||||
|
return version ? new GradleExecutable(version, gradleExecutable) : undefined;
|
||||||
|
}
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
function parseGradleVersionFromOutput(output) {
|
||||||
|
const regex = /Gradle (\d+\.\d+(\.\d+)?(-.*)?)/;
|
||||||
|
const versionString = output.match(regex)?.[1];
|
||||||
|
return versionString;
|
||||||
|
}
|
||||||
|
class GradleExecutable {
|
||||||
|
constructor(version, executable) {
|
||||||
|
this.version = version;
|
||||||
|
this.executable = executable;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
/***/ 46807:
|
/***/ 46807:
|
||||||
|
@ -135750,20 +135844,17 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
||||||
__setModuleDefault(result, mod);
|
__setModuleDefault(result, mod);
|
||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
||||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
||||||
};
|
|
||||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||||
exports.provisionGradle = provisionGradle;
|
exports.provisionGradle = provisionGradle;
|
||||||
|
exports.provisionGradleAtLeast = provisionGradleAtLeast;
|
||||||
const fs = __importStar(__nccwpck_require__(57147));
|
const fs = __importStar(__nccwpck_require__(57147));
|
||||||
const os = __importStar(__nccwpck_require__(22037));
|
const os = __importStar(__nccwpck_require__(22037));
|
||||||
const path = __importStar(__nccwpck_require__(71017));
|
const path = __importStar(__nccwpck_require__(71017));
|
||||||
const which_1 = __importDefault(__nccwpck_require__(6143));
|
|
||||||
const httpm = __importStar(__nccwpck_require__(96255));
|
const httpm = __importStar(__nccwpck_require__(96255));
|
||||||
const core = __importStar(__nccwpck_require__(42186));
|
const core = __importStar(__nccwpck_require__(42186));
|
||||||
const cache = __importStar(__nccwpck_require__(27799));
|
const cache = __importStar(__nccwpck_require__(27799));
|
||||||
const exec = __importStar(__nccwpck_require__(71514));
|
|
||||||
const toolCache = __importStar(__nccwpck_require__(27784));
|
const toolCache = __importStar(__nccwpck_require__(27784));
|
||||||
|
const gradle_1 = __nccwpck_require__(94475);
|
||||||
const gradlew = __importStar(__nccwpck_require__(46807));
|
const gradlew = __importStar(__nccwpck_require__(46807));
|
||||||
const cache_utils_1 = __nccwpck_require__(11044);
|
const cache_utils_1 = __nccwpck_require__(11044);
|
||||||
const configuration_1 = __nccwpck_require__(15778);
|
const configuration_1 = __nccwpck_require__(15778);
|
||||||
|
@ -135774,6 +135865,10 @@ async function provisionGradle(gradleVersion) {
|
||||||
}
|
}
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
async function provisionGradleAtLeast(gradleVersion) {
|
||||||
|
const installedVersion = await installGradleVersionAtLeast(await gradleRelease(gradleVersion));
|
||||||
|
return addToPath(installedVersion);
|
||||||
|
}
|
||||||
async function addToPath(executable) {
|
async function addToPath(executable) {
|
||||||
core.addPath(path.dirname(executable));
|
core.addPath(path.dirname(executable));
|
||||||
return executable;
|
return executable;
|
||||||
|
@ -135797,7 +135892,7 @@ async function resolveGradleVersion(version) {
|
||||||
case 'release-nightly':
|
case 'release-nightly':
|
||||||
return gradleReleaseNightly();
|
return gradleReleaseNightly();
|
||||||
default:
|
default:
|
||||||
return gradle(version);
|
return gradleRelease(version);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
async function gradleCurrent() {
|
async function gradleCurrent() {
|
||||||
|
@ -135817,7 +135912,7 @@ async function gradleNightly() {
|
||||||
async function gradleReleaseNightly() {
|
async function gradleReleaseNightly() {
|
||||||
return await gradleVersionDeclaration(`${gradleVersionsBaseUrl}/release-nightly`);
|
return await gradleVersionDeclaration(`${gradleVersionsBaseUrl}/release-nightly`);
|
||||||
}
|
}
|
||||||
async function gradle(version) {
|
async function gradleRelease(version) {
|
||||||
const versionInfo = await findGradleVersionDeclaration(version);
|
const versionInfo = await findGradleVersionDeclaration(version);
|
||||||
if (!versionInfo) {
|
if (!versionInfo) {
|
||||||
throw new Error(`Gradle version ${version} does not exists`);
|
throw new Error(`Gradle version ${version} does not exists`);
|
||||||
|
@ -135835,10 +135930,20 @@ async function findGradleVersionDeclaration(version) {
|
||||||
}
|
}
|
||||||
async function installGradleVersion(versionInfo) {
|
async function installGradleVersion(versionInfo) {
|
||||||
return core.group(`Provision Gradle ${versionInfo.version}`, async () => {
|
return core.group(`Provision Gradle ${versionInfo.version}`, async () => {
|
||||||
const preInstalledGradle = await findGradleVersionOnPath(versionInfo);
|
const gradleOnPath = await (0, gradle_1.findGradleVersionOnPath)();
|
||||||
if (preInstalledGradle !== undefined) {
|
if (gradleOnPath?.version === versionInfo.version) {
|
||||||
core.info(`Gradle version ${versionInfo.version} is already available on PATH. Not installing.`);
|
core.info(`Gradle version ${versionInfo.version} is already available on PATH. Not installing.`);
|
||||||
return preInstalledGradle;
|
return gradleOnPath.executable;
|
||||||
|
}
|
||||||
|
return locateGradleAndDownloadIfRequired(versionInfo);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
async function installGradleVersionAtLeast(versionInfo) {
|
||||||
|
return core.group(`Provision Gradle >= ${versionInfo.version}`, async () => {
|
||||||
|
const gradleOnPath = await (0, gradle_1.findGradleVersionOnPath)();
|
||||||
|
if (gradleOnPath && (0, gradle_1.versionIsAtLeast)(gradleOnPath.version, versionInfo.version)) {
|
||||||
|
core.info(`Gradle version ${gradleOnPath.version} is available on PATH and >= ${versionInfo.version}. Not installing.`);
|
||||||
|
return gradleOnPath.executable;
|
||||||
}
|
}
|
||||||
return locateGradleAndDownloadIfRequired(versionInfo);
|
return locateGradleAndDownloadIfRequired(versionInfo);
|
||||||
});
|
});
|
||||||
|
@ -135910,16 +136015,6 @@ async function httpGetString(url) {
|
||||||
const response = await httpClient.get(url);
|
const response = await httpClient.get(url);
|
||||||
return response.readBody();
|
return response.readBody();
|
||||||
}
|
}
|
||||||
async function findGradleVersionOnPath(versionInfo) {
|
|
||||||
const gradleExecutable = await (0, which_1.default)('gradle', { nothrow: true });
|
|
||||||
if (gradleExecutable) {
|
|
||||||
const output = await exec.getExecOutput(gradleExecutable, ['-v'], { silent: true });
|
|
||||||
if (output.stdout.includes(`\nGradle ${versionInfo.version}\n`)) {
|
|
||||||
return gradleExecutable;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
2
dist/dependency-submission/post/index.js.map
vendored
2
dist/dependency-submission/post/index.js.map
vendored
File diff suppressed because one or more lines are too long
143
dist/setup-gradle/main/index.js
vendored
143
dist/setup-gradle/main/index.js
vendored
|
@ -179902,7 +179902,7 @@ class CacheCleaner {
|
||||||
}
|
}
|
||||||
`);
|
`);
|
||||||
fs_1.default.writeFileSync(path_1.default.resolve(cleanupProjectDir, 'build.gradle'), 'task("noop") {}');
|
fs_1.default.writeFileSync(path_1.default.resolve(cleanupProjectDir, 'build.gradle'), 'task("noop") {}');
|
||||||
const executable = await provisioner.provisionGradle('current');
|
const executable = await provisioner.provisionGradleAtLeast('8.9');
|
||||||
await core.group('Executing Gradle to clean up caches', async () => {
|
await core.group('Executing Gradle to clean up caches', async () => {
|
||||||
core.info(`Cleaning up caches last used before ${cleanTimestamp}`);
|
core.info(`Cleaning up caches last used before ${cleanTimestamp}`);
|
||||||
await this.executeCleanupBuild(executable, cleanupProjectDir);
|
await this.executeCleanupBuild(executable, cleanupProjectDir);
|
||||||
|
@ -180584,11 +180584,11 @@ const path_1 = __importDefault(__nccwpck_require__(71017));
|
||||||
const fs_1 = __importDefault(__nccwpck_require__(57147));
|
const fs_1 = __importDefault(__nccwpck_require__(57147));
|
||||||
const core = __importStar(__nccwpck_require__(42186));
|
const core = __importStar(__nccwpck_require__(42186));
|
||||||
const glob = __importStar(__nccwpck_require__(28090));
|
const glob = __importStar(__nccwpck_require__(28090));
|
||||||
const semver = __importStar(__nccwpck_require__(11383));
|
|
||||||
const cache_utils_1 = __nccwpck_require__(11044);
|
const cache_utils_1 = __nccwpck_require__(11044);
|
||||||
const build_results_1 = __nccwpck_require__(82107);
|
const build_results_1 = __nccwpck_require__(82107);
|
||||||
const configuration_1 = __nccwpck_require__(15778);
|
const configuration_1 = __nccwpck_require__(15778);
|
||||||
const cache_key_1 = __nccwpck_require__(50100);
|
const cache_key_1 = __nccwpck_require__(50100);
|
||||||
|
const gradle_1 = __nccwpck_require__(94475);
|
||||||
const SKIP_RESTORE_VAR = 'GRADLE_BUILD_ACTION_SKIP_RESTORE';
|
const SKIP_RESTORE_VAR = 'GRADLE_BUILD_ACTION_SKIP_RESTORE';
|
||||||
const CACHE_PROTOCOL_VERSION = 'v1';
|
const CACHE_PROTOCOL_VERSION = 'v1';
|
||||||
class ExtractedCacheEntry {
|
class ExtractedCacheEntry {
|
||||||
|
@ -180827,8 +180827,7 @@ class ConfigurationCacheEntryExtractor extends AbstractEntryExtractor {
|
||||||
return Object.entries(groupedResults).map(([configCachePath, pathResults]) => {
|
return Object.entries(groupedResults).map(([configCachePath, pathResults]) => {
|
||||||
const definition = new ExtractedCacheEntryDefinition('configuration-cache', configCachePath, true).withNonUniqueFileNames();
|
const definition = new ExtractedCacheEntryDefinition('configuration-cache', configCachePath, true).withNonUniqueFileNames();
|
||||||
if (pathResults.find(result => {
|
if (pathResults.find(result => {
|
||||||
const gradleVersion = semver.coerce(result.gradleVersion);
|
return !(0, gradle_1.versionIsAtLeast)(result.gradleVersion, '8.6.0');
|
||||||
return gradleVersion && semver.lt(gradleVersion, '8.6.0');
|
|
||||||
})) {
|
})) {
|
||||||
core.info(`Not saving config-cache data for ${configCachePath}. Configuration cache data is only saved for Gradle 8.6+`);
|
core.info(`Not saving config-cache data for ${configCachePath}. Configuration cache data is only saved for Gradle 8.6+`);
|
||||||
definition.notCacheableBecause('Configuration cache data only saved for Gradle 8.6+');
|
definition.notCacheableBecause('Configuration cache data only saved for Gradle 8.6+');
|
||||||
|
@ -182294,6 +182293,101 @@ function handlePostActionError(error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ 94475:
|
||||||
|
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||||
|
if (k2 === undefined) k2 = k;
|
||||||
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||||
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||||
|
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||||
|
}
|
||||||
|
Object.defineProperty(o, k2, desc);
|
||||||
|
}) : (function(o, m, k, k2) {
|
||||||
|
if (k2 === undefined) k2 = k;
|
||||||
|
o[k2] = m[k];
|
||||||
|
}));
|
||||||
|
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||||
|
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||||
|
}) : function(o, v) {
|
||||||
|
o["default"] = v;
|
||||||
|
});
|
||||||
|
var __importStar = (this && this.__importStar) || function (mod) {
|
||||||
|
if (mod && mod.__esModule) return mod;
|
||||||
|
var result = {};
|
||||||
|
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||||
|
__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.provisionAndMaybeExecute = provisionAndMaybeExecute;
|
||||||
|
exports.versionIsAtLeast = versionIsAtLeast;
|
||||||
|
exports.findGradleVersionOnPath = findGradleVersionOnPath;
|
||||||
|
exports.parseGradleVersionFromOutput = parseGradleVersionFromOutput;
|
||||||
|
const core = __importStar(__nccwpck_require__(42186));
|
||||||
|
const exec = __importStar(__nccwpck_require__(71514));
|
||||||
|
const which_1 = __importDefault(__nccwpck_require__(6143));
|
||||||
|
const semver = __importStar(__nccwpck_require__(11383));
|
||||||
|
const provisioner = __importStar(__nccwpck_require__(14042));
|
||||||
|
const gradlew = __importStar(__nccwpck_require__(46807));
|
||||||
|
async function provisionAndMaybeExecute(gradleVersion, buildRootDirectory, args) {
|
||||||
|
const executable = await provisioner.provisionGradle(gradleVersion);
|
||||||
|
if (args.length > 0) {
|
||||||
|
await executeGradleBuild(executable, buildRootDirectory, args);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
async function executeGradleBuild(executable, root, args) {
|
||||||
|
const toExecute = executable ?? gradlew.gradleWrapperScript(root);
|
||||||
|
const status = await exec.exec(toExecute, args, {
|
||||||
|
cwd: root,
|
||||||
|
ignoreReturnCode: true
|
||||||
|
});
|
||||||
|
if (status !== 0) {
|
||||||
|
core.setFailed(`Gradle build failed: see console output for details`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function versionIsAtLeast(actualVersion, requiredVersion) {
|
||||||
|
const splitVersion = actualVersion.split('-');
|
||||||
|
const coreVersion = splitVersion[0];
|
||||||
|
const prerelease = splitVersion.length > 1;
|
||||||
|
const actualSemver = semver.coerce(coreVersion);
|
||||||
|
const comparisonSemver = semver.coerce(requiredVersion);
|
||||||
|
if (prerelease) {
|
||||||
|
return semver.gt(actualSemver, comparisonSemver);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return semver.gte(actualSemver, comparisonSemver);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
async function findGradleVersionOnPath() {
|
||||||
|
const gradleExecutable = await (0, which_1.default)('gradle', { nothrow: true });
|
||||||
|
if (gradleExecutable) {
|
||||||
|
const output = await exec.getExecOutput(gradleExecutable, ['-v'], { silent: true });
|
||||||
|
const version = parseGradleVersionFromOutput(output.stdout);
|
||||||
|
return version ? new GradleExecutable(version, gradleExecutable) : undefined;
|
||||||
|
}
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
function parseGradleVersionFromOutput(output) {
|
||||||
|
const regex = /Gradle (\d+\.\d+(\.\d+)?(-.*)?)/;
|
||||||
|
const versionString = output.match(regex)?.[1];
|
||||||
|
return versionString;
|
||||||
|
}
|
||||||
|
class GradleExecutable {
|
||||||
|
constructor(version, executable) {
|
||||||
|
this.version = version;
|
||||||
|
this.executable = executable;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
/***/ 46807:
|
/***/ 46807:
|
||||||
|
@ -182398,20 +182492,17 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
||||||
__setModuleDefault(result, mod);
|
__setModuleDefault(result, mod);
|
||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
||||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
||||||
};
|
|
||||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||||
exports.provisionGradle = provisionGradle;
|
exports.provisionGradle = provisionGradle;
|
||||||
|
exports.provisionGradleAtLeast = provisionGradleAtLeast;
|
||||||
const fs = __importStar(__nccwpck_require__(57147));
|
const fs = __importStar(__nccwpck_require__(57147));
|
||||||
const os = __importStar(__nccwpck_require__(22037));
|
const os = __importStar(__nccwpck_require__(22037));
|
||||||
const path = __importStar(__nccwpck_require__(71017));
|
const path = __importStar(__nccwpck_require__(71017));
|
||||||
const which_1 = __importDefault(__nccwpck_require__(6143));
|
|
||||||
const httpm = __importStar(__nccwpck_require__(96255));
|
const httpm = __importStar(__nccwpck_require__(96255));
|
||||||
const core = __importStar(__nccwpck_require__(42186));
|
const core = __importStar(__nccwpck_require__(42186));
|
||||||
const cache = __importStar(__nccwpck_require__(27799));
|
const cache = __importStar(__nccwpck_require__(27799));
|
||||||
const exec = __importStar(__nccwpck_require__(71514));
|
|
||||||
const toolCache = __importStar(__nccwpck_require__(27784));
|
const toolCache = __importStar(__nccwpck_require__(27784));
|
||||||
|
const gradle_1 = __nccwpck_require__(94475);
|
||||||
const gradlew = __importStar(__nccwpck_require__(46807));
|
const gradlew = __importStar(__nccwpck_require__(46807));
|
||||||
const cache_utils_1 = __nccwpck_require__(11044);
|
const cache_utils_1 = __nccwpck_require__(11044);
|
||||||
const configuration_1 = __nccwpck_require__(15778);
|
const configuration_1 = __nccwpck_require__(15778);
|
||||||
|
@ -182422,6 +182513,10 @@ async function provisionGradle(gradleVersion) {
|
||||||
}
|
}
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
async function provisionGradleAtLeast(gradleVersion) {
|
||||||
|
const installedVersion = await installGradleVersionAtLeast(await gradleRelease(gradleVersion));
|
||||||
|
return addToPath(installedVersion);
|
||||||
|
}
|
||||||
async function addToPath(executable) {
|
async function addToPath(executable) {
|
||||||
core.addPath(path.dirname(executable));
|
core.addPath(path.dirname(executable));
|
||||||
return executable;
|
return executable;
|
||||||
|
@ -182445,7 +182540,7 @@ async function resolveGradleVersion(version) {
|
||||||
case 'release-nightly':
|
case 'release-nightly':
|
||||||
return gradleReleaseNightly();
|
return gradleReleaseNightly();
|
||||||
default:
|
default:
|
||||||
return gradle(version);
|
return gradleRelease(version);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
async function gradleCurrent() {
|
async function gradleCurrent() {
|
||||||
|
@ -182465,7 +182560,7 @@ async function gradleNightly() {
|
||||||
async function gradleReleaseNightly() {
|
async function gradleReleaseNightly() {
|
||||||
return await gradleVersionDeclaration(`${gradleVersionsBaseUrl}/release-nightly`);
|
return await gradleVersionDeclaration(`${gradleVersionsBaseUrl}/release-nightly`);
|
||||||
}
|
}
|
||||||
async function gradle(version) {
|
async function gradleRelease(version) {
|
||||||
const versionInfo = await findGradleVersionDeclaration(version);
|
const versionInfo = await findGradleVersionDeclaration(version);
|
||||||
if (!versionInfo) {
|
if (!versionInfo) {
|
||||||
throw new Error(`Gradle version ${version} does not exists`);
|
throw new Error(`Gradle version ${version} does not exists`);
|
||||||
|
@ -182483,10 +182578,20 @@ async function findGradleVersionDeclaration(version) {
|
||||||
}
|
}
|
||||||
async function installGradleVersion(versionInfo) {
|
async function installGradleVersion(versionInfo) {
|
||||||
return core.group(`Provision Gradle ${versionInfo.version}`, async () => {
|
return core.group(`Provision Gradle ${versionInfo.version}`, async () => {
|
||||||
const preInstalledGradle = await findGradleVersionOnPath(versionInfo);
|
const gradleOnPath = await (0, gradle_1.findGradleVersionOnPath)();
|
||||||
if (preInstalledGradle !== undefined) {
|
if (gradleOnPath?.version === versionInfo.version) {
|
||||||
core.info(`Gradle version ${versionInfo.version} is already available on PATH. Not installing.`);
|
core.info(`Gradle version ${versionInfo.version} is already available on PATH. Not installing.`);
|
||||||
return preInstalledGradle;
|
return gradleOnPath.executable;
|
||||||
|
}
|
||||||
|
return locateGradleAndDownloadIfRequired(versionInfo);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
async function installGradleVersionAtLeast(versionInfo) {
|
||||||
|
return core.group(`Provision Gradle >= ${versionInfo.version}`, async () => {
|
||||||
|
const gradleOnPath = await (0, gradle_1.findGradleVersionOnPath)();
|
||||||
|
if (gradleOnPath && (0, gradle_1.versionIsAtLeast)(gradleOnPath.version, versionInfo.version)) {
|
||||||
|
core.info(`Gradle version ${gradleOnPath.version} is available on PATH and >= ${versionInfo.version}. Not installing.`);
|
||||||
|
return gradleOnPath.executable;
|
||||||
}
|
}
|
||||||
return locateGradleAndDownloadIfRequired(versionInfo);
|
return locateGradleAndDownloadIfRequired(versionInfo);
|
||||||
});
|
});
|
||||||
|
@ -182558,16 +182663,6 @@ async function httpGetString(url) {
|
||||||
const response = await httpClient.get(url);
|
const response = await httpClient.get(url);
|
||||||
return response.readBody();
|
return response.readBody();
|
||||||
}
|
}
|
||||||
async function findGradleVersionOnPath(versionInfo) {
|
|
||||||
const gradleExecutable = await (0, which_1.default)('gradle', { nothrow: true });
|
|
||||||
if (gradleExecutable) {
|
|
||||||
const output = await exec.getExecOutput(gradleExecutable, ['-v'], { silent: true });
|
|
||||||
if (output.stdout.includes(`\nGradle ${versionInfo.version}\n`)) {
|
|
||||||
return gradleExecutable;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
2
dist/setup-gradle/main/index.js.map
vendored
2
dist/setup-gradle/main/index.js.map
vendored
File diff suppressed because one or more lines are too long
143
dist/setup-gradle/post/index.js
vendored
143
dist/setup-gradle/post/index.js
vendored
|
@ -179897,7 +179897,7 @@ class CacheCleaner {
|
||||||
}
|
}
|
||||||
`);
|
`);
|
||||||
fs_1.default.writeFileSync(path_1.default.resolve(cleanupProjectDir, 'build.gradle'), 'task("noop") {}');
|
fs_1.default.writeFileSync(path_1.default.resolve(cleanupProjectDir, 'build.gradle'), 'task("noop") {}');
|
||||||
const executable = await provisioner.provisionGradle('current');
|
const executable = await provisioner.provisionGradleAtLeast('8.9');
|
||||||
await core.group('Executing Gradle to clean up caches', async () => {
|
await core.group('Executing Gradle to clean up caches', async () => {
|
||||||
core.info(`Cleaning up caches last used before ${cleanTimestamp}`);
|
core.info(`Cleaning up caches last used before ${cleanTimestamp}`);
|
||||||
await this.executeCleanupBuild(executable, cleanupProjectDir);
|
await this.executeCleanupBuild(executable, cleanupProjectDir);
|
||||||
|
@ -180579,11 +180579,11 @@ const path_1 = __importDefault(__nccwpck_require__(71017));
|
||||||
const fs_1 = __importDefault(__nccwpck_require__(57147));
|
const fs_1 = __importDefault(__nccwpck_require__(57147));
|
||||||
const core = __importStar(__nccwpck_require__(42186));
|
const core = __importStar(__nccwpck_require__(42186));
|
||||||
const glob = __importStar(__nccwpck_require__(28090));
|
const glob = __importStar(__nccwpck_require__(28090));
|
||||||
const semver = __importStar(__nccwpck_require__(11383));
|
|
||||||
const cache_utils_1 = __nccwpck_require__(11044);
|
const cache_utils_1 = __nccwpck_require__(11044);
|
||||||
const build_results_1 = __nccwpck_require__(82107);
|
const build_results_1 = __nccwpck_require__(82107);
|
||||||
const configuration_1 = __nccwpck_require__(15778);
|
const configuration_1 = __nccwpck_require__(15778);
|
||||||
const cache_key_1 = __nccwpck_require__(50100);
|
const cache_key_1 = __nccwpck_require__(50100);
|
||||||
|
const gradle_1 = __nccwpck_require__(94475);
|
||||||
const SKIP_RESTORE_VAR = 'GRADLE_BUILD_ACTION_SKIP_RESTORE';
|
const SKIP_RESTORE_VAR = 'GRADLE_BUILD_ACTION_SKIP_RESTORE';
|
||||||
const CACHE_PROTOCOL_VERSION = 'v1';
|
const CACHE_PROTOCOL_VERSION = 'v1';
|
||||||
class ExtractedCacheEntry {
|
class ExtractedCacheEntry {
|
||||||
|
@ -180822,8 +180822,7 @@ class ConfigurationCacheEntryExtractor extends AbstractEntryExtractor {
|
||||||
return Object.entries(groupedResults).map(([configCachePath, pathResults]) => {
|
return Object.entries(groupedResults).map(([configCachePath, pathResults]) => {
|
||||||
const definition = new ExtractedCacheEntryDefinition('configuration-cache', configCachePath, true).withNonUniqueFileNames();
|
const definition = new ExtractedCacheEntryDefinition('configuration-cache', configCachePath, true).withNonUniqueFileNames();
|
||||||
if (pathResults.find(result => {
|
if (pathResults.find(result => {
|
||||||
const gradleVersion = semver.coerce(result.gradleVersion);
|
return !(0, gradle_1.versionIsAtLeast)(result.gradleVersion, '8.6.0');
|
||||||
return gradleVersion && semver.lt(gradleVersion, '8.6.0');
|
|
||||||
})) {
|
})) {
|
||||||
core.info(`Not saving config-cache data for ${configCachePath}. Configuration cache data is only saved for Gradle 8.6+`);
|
core.info(`Not saving config-cache data for ${configCachePath}. Configuration cache data is only saved for Gradle 8.6+`);
|
||||||
definition.notCacheableBecause('Configuration cache data only saved for Gradle 8.6+');
|
definition.notCacheableBecause('Configuration cache data only saved for Gradle 8.6+');
|
||||||
|
@ -182289,6 +182288,101 @@ function handlePostActionError(error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ 94475:
|
||||||
|
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||||
|
if (k2 === undefined) k2 = k;
|
||||||
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||||
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||||
|
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||||
|
}
|
||||||
|
Object.defineProperty(o, k2, desc);
|
||||||
|
}) : (function(o, m, k, k2) {
|
||||||
|
if (k2 === undefined) k2 = k;
|
||||||
|
o[k2] = m[k];
|
||||||
|
}));
|
||||||
|
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||||
|
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||||
|
}) : function(o, v) {
|
||||||
|
o["default"] = v;
|
||||||
|
});
|
||||||
|
var __importStar = (this && this.__importStar) || function (mod) {
|
||||||
|
if (mod && mod.__esModule) return mod;
|
||||||
|
var result = {};
|
||||||
|
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||||
|
__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.provisionAndMaybeExecute = provisionAndMaybeExecute;
|
||||||
|
exports.versionIsAtLeast = versionIsAtLeast;
|
||||||
|
exports.findGradleVersionOnPath = findGradleVersionOnPath;
|
||||||
|
exports.parseGradleVersionFromOutput = parseGradleVersionFromOutput;
|
||||||
|
const core = __importStar(__nccwpck_require__(42186));
|
||||||
|
const exec = __importStar(__nccwpck_require__(71514));
|
||||||
|
const which_1 = __importDefault(__nccwpck_require__(6143));
|
||||||
|
const semver = __importStar(__nccwpck_require__(11383));
|
||||||
|
const provisioner = __importStar(__nccwpck_require__(14042));
|
||||||
|
const gradlew = __importStar(__nccwpck_require__(46807));
|
||||||
|
async function provisionAndMaybeExecute(gradleVersion, buildRootDirectory, args) {
|
||||||
|
const executable = await provisioner.provisionGradle(gradleVersion);
|
||||||
|
if (args.length > 0) {
|
||||||
|
await executeGradleBuild(executable, buildRootDirectory, args);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
async function executeGradleBuild(executable, root, args) {
|
||||||
|
const toExecute = executable ?? gradlew.gradleWrapperScript(root);
|
||||||
|
const status = await exec.exec(toExecute, args, {
|
||||||
|
cwd: root,
|
||||||
|
ignoreReturnCode: true
|
||||||
|
});
|
||||||
|
if (status !== 0) {
|
||||||
|
core.setFailed(`Gradle build failed: see console output for details`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function versionIsAtLeast(actualVersion, requiredVersion) {
|
||||||
|
const splitVersion = actualVersion.split('-');
|
||||||
|
const coreVersion = splitVersion[0];
|
||||||
|
const prerelease = splitVersion.length > 1;
|
||||||
|
const actualSemver = semver.coerce(coreVersion);
|
||||||
|
const comparisonSemver = semver.coerce(requiredVersion);
|
||||||
|
if (prerelease) {
|
||||||
|
return semver.gt(actualSemver, comparisonSemver);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return semver.gte(actualSemver, comparisonSemver);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
async function findGradleVersionOnPath() {
|
||||||
|
const gradleExecutable = await (0, which_1.default)('gradle', { nothrow: true });
|
||||||
|
if (gradleExecutable) {
|
||||||
|
const output = await exec.getExecOutput(gradleExecutable, ['-v'], { silent: true });
|
||||||
|
const version = parseGradleVersionFromOutput(output.stdout);
|
||||||
|
return version ? new GradleExecutable(version, gradleExecutable) : undefined;
|
||||||
|
}
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
function parseGradleVersionFromOutput(output) {
|
||||||
|
const regex = /Gradle (\d+\.\d+(\.\d+)?(-.*)?)/;
|
||||||
|
const versionString = output.match(regex)?.[1];
|
||||||
|
return versionString;
|
||||||
|
}
|
||||||
|
class GradleExecutable {
|
||||||
|
constructor(version, executable) {
|
||||||
|
this.version = version;
|
||||||
|
this.executable = executable;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
/***/ 46807:
|
/***/ 46807:
|
||||||
|
@ -182393,20 +182487,17 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
||||||
__setModuleDefault(result, mod);
|
__setModuleDefault(result, mod);
|
||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
||||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
||||||
};
|
|
||||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||||
exports.provisionGradle = provisionGradle;
|
exports.provisionGradle = provisionGradle;
|
||||||
|
exports.provisionGradleAtLeast = provisionGradleAtLeast;
|
||||||
const fs = __importStar(__nccwpck_require__(57147));
|
const fs = __importStar(__nccwpck_require__(57147));
|
||||||
const os = __importStar(__nccwpck_require__(22037));
|
const os = __importStar(__nccwpck_require__(22037));
|
||||||
const path = __importStar(__nccwpck_require__(71017));
|
const path = __importStar(__nccwpck_require__(71017));
|
||||||
const which_1 = __importDefault(__nccwpck_require__(6143));
|
|
||||||
const httpm = __importStar(__nccwpck_require__(96255));
|
const httpm = __importStar(__nccwpck_require__(96255));
|
||||||
const core = __importStar(__nccwpck_require__(42186));
|
const core = __importStar(__nccwpck_require__(42186));
|
||||||
const cache = __importStar(__nccwpck_require__(27799));
|
const cache = __importStar(__nccwpck_require__(27799));
|
||||||
const exec = __importStar(__nccwpck_require__(71514));
|
|
||||||
const toolCache = __importStar(__nccwpck_require__(27784));
|
const toolCache = __importStar(__nccwpck_require__(27784));
|
||||||
|
const gradle_1 = __nccwpck_require__(94475);
|
||||||
const gradlew = __importStar(__nccwpck_require__(46807));
|
const gradlew = __importStar(__nccwpck_require__(46807));
|
||||||
const cache_utils_1 = __nccwpck_require__(11044);
|
const cache_utils_1 = __nccwpck_require__(11044);
|
||||||
const configuration_1 = __nccwpck_require__(15778);
|
const configuration_1 = __nccwpck_require__(15778);
|
||||||
|
@ -182417,6 +182508,10 @@ async function provisionGradle(gradleVersion) {
|
||||||
}
|
}
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
async function provisionGradleAtLeast(gradleVersion) {
|
||||||
|
const installedVersion = await installGradleVersionAtLeast(await gradleRelease(gradleVersion));
|
||||||
|
return addToPath(installedVersion);
|
||||||
|
}
|
||||||
async function addToPath(executable) {
|
async function addToPath(executable) {
|
||||||
core.addPath(path.dirname(executable));
|
core.addPath(path.dirname(executable));
|
||||||
return executable;
|
return executable;
|
||||||
|
@ -182440,7 +182535,7 @@ async function resolveGradleVersion(version) {
|
||||||
case 'release-nightly':
|
case 'release-nightly':
|
||||||
return gradleReleaseNightly();
|
return gradleReleaseNightly();
|
||||||
default:
|
default:
|
||||||
return gradle(version);
|
return gradleRelease(version);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
async function gradleCurrent() {
|
async function gradleCurrent() {
|
||||||
|
@ -182460,7 +182555,7 @@ async function gradleNightly() {
|
||||||
async function gradleReleaseNightly() {
|
async function gradleReleaseNightly() {
|
||||||
return await gradleVersionDeclaration(`${gradleVersionsBaseUrl}/release-nightly`);
|
return await gradleVersionDeclaration(`${gradleVersionsBaseUrl}/release-nightly`);
|
||||||
}
|
}
|
||||||
async function gradle(version) {
|
async function gradleRelease(version) {
|
||||||
const versionInfo = await findGradleVersionDeclaration(version);
|
const versionInfo = await findGradleVersionDeclaration(version);
|
||||||
if (!versionInfo) {
|
if (!versionInfo) {
|
||||||
throw new Error(`Gradle version ${version} does not exists`);
|
throw new Error(`Gradle version ${version} does not exists`);
|
||||||
|
@ -182478,10 +182573,20 @@ async function findGradleVersionDeclaration(version) {
|
||||||
}
|
}
|
||||||
async function installGradleVersion(versionInfo) {
|
async function installGradleVersion(versionInfo) {
|
||||||
return core.group(`Provision Gradle ${versionInfo.version}`, async () => {
|
return core.group(`Provision Gradle ${versionInfo.version}`, async () => {
|
||||||
const preInstalledGradle = await findGradleVersionOnPath(versionInfo);
|
const gradleOnPath = await (0, gradle_1.findGradleVersionOnPath)();
|
||||||
if (preInstalledGradle !== undefined) {
|
if (gradleOnPath?.version === versionInfo.version) {
|
||||||
core.info(`Gradle version ${versionInfo.version} is already available on PATH. Not installing.`);
|
core.info(`Gradle version ${versionInfo.version} is already available on PATH. Not installing.`);
|
||||||
return preInstalledGradle;
|
return gradleOnPath.executable;
|
||||||
|
}
|
||||||
|
return locateGradleAndDownloadIfRequired(versionInfo);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
async function installGradleVersionAtLeast(versionInfo) {
|
||||||
|
return core.group(`Provision Gradle >= ${versionInfo.version}`, async () => {
|
||||||
|
const gradleOnPath = await (0, gradle_1.findGradleVersionOnPath)();
|
||||||
|
if (gradleOnPath && (0, gradle_1.versionIsAtLeast)(gradleOnPath.version, versionInfo.version)) {
|
||||||
|
core.info(`Gradle version ${gradleOnPath.version} is available on PATH and >= ${versionInfo.version}. Not installing.`);
|
||||||
|
return gradleOnPath.executable;
|
||||||
}
|
}
|
||||||
return locateGradleAndDownloadIfRequired(versionInfo);
|
return locateGradleAndDownloadIfRequired(versionInfo);
|
||||||
});
|
});
|
||||||
|
@ -182553,16 +182658,6 @@ async function httpGetString(url) {
|
||||||
const response = await httpClient.get(url);
|
const response = await httpClient.get(url);
|
||||||
return response.readBody();
|
return response.readBody();
|
||||||
}
|
}
|
||||||
async function findGradleVersionOnPath(versionInfo) {
|
|
||||||
const gradleExecutable = await (0, which_1.default)('gradle', { nothrow: true });
|
|
||||||
if (gradleExecutable) {
|
|
||||||
const output = await exec.getExecOutput(gradleExecutable, ['-v'], { silent: true });
|
|
||||||
if (output.stdout.includes(`\nGradle ${versionInfo.version}\n`)) {
|
|
||||||
return gradleExecutable;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
2
dist/setup-gradle/post/index.js.map
vendored
2
dist/setup-gradle/post/index.js.map
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue