Skip to content

Commit

Permalink
[bot] Update dist directory
Browse files Browse the repository at this point in the history
  • Loading branch information
bigdaz authored and github-actions[bot] committed Aug 31, 2024
1 parent 7e0f050 commit 5baa1de
Show file tree
Hide file tree
Showing 8 changed files with 426 additions and 100 deletions.
89 changes: 65 additions & 24 deletions dist/dependency-submission/main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -179917,7 +179917,7 @@ class CacheCleaner {
}
`);
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 () => {
core.info(`Cleaning up caches last used before ${cleanTimestamp}`);
await this.executeCleanupBuild(executable, cleanupProjectDir);
Expand Down Expand Up @@ -180599,11 +180599,11 @@ const path_1 = __importDefault(__nccwpck_require__(71017));
const fs_1 = __importDefault(__nccwpck_require__(57147));
const core = __importStar(__nccwpck_require__(42186));
const glob = __importStar(__nccwpck_require__(28090));
const semver = __importStar(__nccwpck_require__(11383));
const cache_utils_1 = __nccwpck_require__(11044);
const build_results_1 = __nccwpck_require__(82107);
const configuration_1 = __nccwpck_require__(15778);
const cache_key_1 = __nccwpck_require__(50100);
const gradle_1 = __nccwpck_require__(94475);
const SKIP_RESTORE_VAR = 'GRADLE_BUILD_ACTION_SKIP_RESTORE';
const CACHE_PROTOCOL_VERSION = 'v1';
class ExtractedCacheEntry {
Expand Down Expand Up @@ -180842,8 +180842,7 @@ class ConfigurationCacheEntryExtractor extends AbstractEntryExtractor {
return Object.entries(groupedResults).map(([configCachePath, pathResults]) => {
const definition = new ExtractedCacheEntryDefinition('configuration-cache', configCachePath, true).withNonUniqueFileNames();
if (pathResults.find(result => {
const gradleVersion = semver.coerce(result.gradleVersion);
return gradleVersion && semver.lt(gradleVersion, '8.6.0');
return !(0, gradle_1.versionIsAtLeast)(result.gradleVersion, '8.6.0');
})) {
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+');
Expand Down Expand Up @@ -182339,10 +182338,18 @@ 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.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) {
Expand All @@ -182361,6 +182368,39 @@ async function executeGradleBuild(executable, root, args) {
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;
}
}


/***/ }),
Expand Down Expand Up @@ -182467,20 +182507,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.provisionGradle = provisionGradle;
exports.provisionGradleAtLeast = provisionGradleAtLeast;
const fs = __importStar(__nccwpck_require__(57147));
const os = __importStar(__nccwpck_require__(22037));
const path = __importStar(__nccwpck_require__(71017));
const which_1 = __importDefault(__nccwpck_require__(6143));
const httpm = __importStar(__nccwpck_require__(96255));
const core = __importStar(__nccwpck_require__(42186));
const cache = __importStar(__nccwpck_require__(27799));
const exec = __importStar(__nccwpck_require__(71514));
const toolCache = __importStar(__nccwpck_require__(27784));
const gradle_1 = __nccwpck_require__(94475);
const gradlew = __importStar(__nccwpck_require__(46807));
const cache_utils_1 = __nccwpck_require__(11044);
const configuration_1 = __nccwpck_require__(15778);
Expand All @@ -182491,6 +182528,10 @@ async function provisionGradle(gradleVersion) {
}
return undefined;
}
async function provisionGradleAtLeast(gradleVersion) {
const installedVersion = await installGradleVersionAtLeast(await gradleRelease(gradleVersion));
return addToPath(installedVersion);
}
async function addToPath(executable) {
core.addPath(path.dirname(executable));
return executable;
Expand All @@ -182514,7 +182555,7 @@ async function resolveGradleVersion(version) {
case 'release-nightly':
return gradleReleaseNightly();
default:
return gradle(version);
return gradleRelease(version);
}
}
async function gradleCurrent() {
Expand All @@ -182534,7 +182575,7 @@ async function gradleNightly() {
async function gradleReleaseNightly() {
return await gradleVersionDeclaration(`${gradleVersionsBaseUrl}/release-nightly`);
}
async function gradle(version) {
async function gradleRelease(version) {
const versionInfo = await findGradleVersionDeclaration(version);
if (!versionInfo) {
throw new Error(`Gradle version ${version} does not exists`);
Expand All @@ -182552,10 +182593,20 @@ async function findGradleVersionDeclaration(version) {
}
async function installGradleVersion(versionInfo) {
return core.group(`Provision Gradle ${versionInfo.version}`, async () => {
const preInstalledGradle = await findGradleVersionOnPath(versionInfo);
if (preInstalledGradle !== undefined) {
const gradleOnPath = await (0, gradle_1.findGradleVersionOnPath)();
if (gradleOnPath?.version === versionInfo.version) {
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);
});
Expand Down Expand Up @@ -182627,16 +182678,6 @@ async function httpGetString(url) {
const response = await httpClient.get(url);
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;
}


/***/ }),
Expand Down
2 changes: 1 addition & 1 deletion dist/dependency-submission/main/index.js.map

Large diffs are not rendered by default.

Loading

0 comments on commit 5baa1de

Please sign in to comment.