mirror of
https://github.com/gradle/actions.git
synced 2025-08-27 13:03:38 +08:00
Update dist directory
This commit is contained in:
parent
3a234be20e
commit
1c25312b02
628
dist/dependency-submission/main/index.js
vendored
628
dist/dependency-submission/main/index.js
vendored
File diff suppressed because it is too large
Load Diff
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
407
dist/dependency-submission/post/index.js
vendored
407
dist/dependency-submission/post/index.js
vendored
@ -91225,22 +91225,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|||||||
__setModuleDefault(result, mod);
|
__setModuleDefault(result, mod);
|
||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
||||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
||||||
return new (P || (P = Promise))(function (resolve, reject) {
|
|
||||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
||||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
||||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
||||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
||||||
});
|
|
||||||
};
|
|
||||||
var __asyncValues = (this && this.__asyncValues) || function (o) {
|
|
||||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
||||||
var m = o[Symbol.asyncIterator], i;
|
|
||||||
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
|
||||||
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
|
||||||
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
|
|
||||||
};
|
|
||||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
};
|
};
|
||||||
@ -91256,63 +91240,40 @@ class CacheCleaner {
|
|||||||
this.gradleUserHome = gradleUserHome;
|
this.gradleUserHome = gradleUserHome;
|
||||||
this.tmpDir = tmpDir;
|
this.tmpDir = tmpDir;
|
||||||
}
|
}
|
||||||
prepare() {
|
async prepare() {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
|
||||||
fs_1.default.rmSync(path_1.default.resolve(this.gradleUserHome, 'caches/journal-1'), { recursive: true, force: true });
|
fs_1.default.rmSync(path_1.default.resolve(this.gradleUserHome, 'caches/journal-1'), { recursive: true, force: true });
|
||||||
fs_1.default.mkdirSync(path_1.default.resolve(this.gradleUserHome, 'caches/journal-1'), { recursive: true });
|
fs_1.default.mkdirSync(path_1.default.resolve(this.gradleUserHome, 'caches/journal-1'), { recursive: true });
|
||||||
fs_1.default.writeFileSync(path_1.default.resolve(this.gradleUserHome, 'caches/journal-1/file-access.properties'), 'inceptionTimestamp=0');
|
fs_1.default.writeFileSync(path_1.default.resolve(this.gradleUserHome, 'caches/journal-1/file-access.properties'), 'inceptionTimestamp=0');
|
||||||
yield this.ageAllFiles();
|
await this.ageAllFiles();
|
||||||
yield this.touchAllFiles('gc.properties');
|
await this.touchAllFiles('gc.properties');
|
||||||
});
|
|
||||||
}
|
}
|
||||||
forceCleanup() {
|
async forceCleanup() {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
await this.ageAllFiles('gc.properties');
|
||||||
yield this.ageAllFiles('gc.properties');
|
|
||||||
const cleanupProjectDir = path_1.default.resolve(this.tmpDir, 'dummy-cleanup-project');
|
const cleanupProjectDir = path_1.default.resolve(this.tmpDir, 'dummy-cleanup-project');
|
||||||
fs_1.default.mkdirSync(cleanupProjectDir, { recursive: true });
|
fs_1.default.mkdirSync(cleanupProjectDir, { recursive: true });
|
||||||
fs_1.default.writeFileSync(path_1.default.resolve(cleanupProjectDir, 'settings.gradle'), 'rootProject.name = "dummy-cleanup-project"');
|
fs_1.default.writeFileSync(path_1.default.resolve(cleanupProjectDir, 'settings.gradle'), 'rootProject.name = "dummy-cleanup-project"');
|
||||||
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 gradleCommand = `gradle -g ${this.gradleUserHome} --no-daemon --build-cache --no-scan --quiet -DGITHUB_DEPENDENCY_GRAPH_ENABLED=false noop`;
|
const gradleCommand = `gradle -g ${this.gradleUserHome} --no-daemon --build-cache --no-scan --quiet -DGITHUB_DEPENDENCY_GRAPH_ENABLED=false noop`;
|
||||||
yield exec.exec(gradleCommand, [], {
|
await exec.exec(gradleCommand, [], {
|
||||||
cwd: cleanupProjectDir
|
cwd: cleanupProjectDir
|
||||||
});
|
});
|
||||||
});
|
|
||||||
}
|
}
|
||||||
ageAllFiles() {
|
async ageAllFiles(fileName = '*') {
|
||||||
return __awaiter(this, arguments, void 0, function* (fileName = '*') {
|
|
||||||
core.debug(`Aging all files in Gradle User Home with name ${fileName}`);
|
core.debug(`Aging all files in Gradle User Home with name ${fileName}`);
|
||||||
yield this.setUtimes(`${this.gradleUserHome}/**/${fileName}`, new Date(0));
|
await this.setUtimes(`${this.gradleUserHome}/**/${fileName}`, new Date(0));
|
||||||
});
|
|
||||||
}
|
}
|
||||||
touchAllFiles() {
|
async touchAllFiles(fileName = '*') {
|
||||||
return __awaiter(this, arguments, void 0, function* (fileName = '*') {
|
|
||||||
core.debug(`Touching all files in Gradle User Home with name ${fileName}`);
|
core.debug(`Touching all files in Gradle User Home with name ${fileName}`);
|
||||||
yield this.setUtimes(`${this.gradleUserHome}/**/${fileName}`, new Date());
|
await this.setUtimes(`${this.gradleUserHome}/**/${fileName}`, new Date());
|
||||||
});
|
|
||||||
}
|
}
|
||||||
setUtimes(pattern, timestamp) {
|
async setUtimes(pattern, timestamp) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
const globber = await glob.create(pattern, {
|
||||||
var _a, e_1, _b, _c;
|
|
||||||
const globber = yield glob.create(pattern, {
|
|
||||||
implicitDescendants: false
|
implicitDescendants: false
|
||||||
});
|
});
|
||||||
try {
|
for await (const file of globber.globGenerator()) {
|
||||||
for (var _d = true, _e = __asyncValues(globber.globGenerator()), _f; _f = yield _e.next(), _a = _f.done, !_a; _d = true) {
|
|
||||||
_c = _f.value;
|
|
||||||
_d = false;
|
|
||||||
const file = _c;
|
|
||||||
fs_1.default.utimesSync(file, timestamp, timestamp);
|
fs_1.default.utimesSync(file, timestamp, timestamp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
||||||
finally {
|
|
||||||
try {
|
|
||||||
if (!_d && !_a && (_b = _e.return)) yield _b.call(_e);
|
|
||||||
}
|
|
||||||
finally { if (e_1) throw e_1.error; }
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
exports.CacheCleaner = CacheCleaner;
|
exports.CacheCleaner = CacheCleaner;
|
||||||
|
|
||||||
@ -91554,18 +91515,15 @@ function renderEntryTable(entries) {
|
|||||||
}
|
}
|
||||||
function renderEntryDetails(listener) {
|
function renderEntryDetails(listener) {
|
||||||
return listener.cacheEntries
|
return listener.cacheEntries
|
||||||
.map(entry => {
|
.map(entry => `Entry: ${entry.entryName}
|
||||||
var _a, _b, _c;
|
Requested Key : ${entry.requestedKey ?? ''}
|
||||||
return `Entry: ${entry.entryName}
|
Restored Key : ${entry.restoredKey ?? ''}
|
||||||
Requested Key : ${(_a = entry.requestedKey) !== null && _a !== void 0 ? _a : ''}
|
|
||||||
Restored Key : ${(_b = entry.restoredKey) !== null && _b !== void 0 ? _b : ''}
|
|
||||||
Size: ${formatSize(entry.restoredSize)}
|
Size: ${formatSize(entry.restoredSize)}
|
||||||
${getRestoredMessage(entry, listener.cacheWriteOnly)}
|
${getRestoredMessage(entry, listener.cacheWriteOnly)}
|
||||||
Saved Key : ${(_c = entry.savedKey) !== null && _c !== void 0 ? _c : ''}
|
Saved Key : ${entry.savedKey ?? ''}
|
||||||
Size: ${formatSize(entry.savedSize)}
|
Size: ${formatSize(entry.savedSize)}
|
||||||
${getSavedMessage(entry, listener.cacheReadOnly)}
|
${getSavedMessage(entry, listener.cacheReadOnly)}
|
||||||
`;
|
`)
|
||||||
})
|
|
||||||
.join('---\n');
|
.join('---\n');
|
||||||
}
|
}
|
||||||
function getRestoredMessage(entry, cacheWriteOnly) {
|
function getRestoredMessage(entry, cacheWriteOnly) {
|
||||||
@ -91608,7 +91566,7 @@ function getCount(cacheEntries, predicate) {
|
|||||||
return cacheEntries.filter(e => predicate(e)).length;
|
return cacheEntries.filter(e => predicate(e)).length;
|
||||||
}
|
}
|
||||||
function getSize(cacheEntries, predicate) {
|
function getSize(cacheEntries, predicate) {
|
||||||
const bytes = cacheEntries.map(e => { var _a; return (_a = predicate(e)) !== null && _a !== void 0 ? _a : 0; }).reduce((p, v) => p + v, 0);
|
const bytes = cacheEntries.map(e => predicate(e) ?? 0).reduce((p, v) => p + v, 0);
|
||||||
return Math.round(bytes / (1024 * 1024));
|
return Math.round(bytes / (1024 * 1024));
|
||||||
}
|
}
|
||||||
function formatSize(bytes) {
|
function formatSize(bytes) {
|
||||||
@ -91649,15 +91607,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|||||||
__setModuleDefault(result, mod);
|
__setModuleDefault(result, mod);
|
||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
||||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
||||||
return new (P || (P = Promise))(function (resolve, reject) {
|
|
||||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
||||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
||||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
||||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
||||||
});
|
|
||||||
};
|
|
||||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||||
exports.tryDelete = exports.handleCacheFailure = exports.cacheDebug = exports.saveCache = exports.restoreCache = exports.hashStrings = exports.hashFileNames = exports.isCacheDebuggingEnabled = void 0;
|
exports.tryDelete = exports.handleCacheFailure = exports.cacheDebug = exports.saveCache = exports.restoreCache = exports.hashStrings = exports.hashFileNames = exports.isCacheDebuggingEnabled = void 0;
|
||||||
const core = __importStar(__nccwpck_require__(2186));
|
const core = __importStar(__nccwpck_require__(2186));
|
||||||
@ -91687,14 +91636,13 @@ function hashStrings(values) {
|
|||||||
return hash.digest('hex');
|
return hash.digest('hex');
|
||||||
}
|
}
|
||||||
exports.hashStrings = hashStrings;
|
exports.hashStrings = hashStrings;
|
||||||
function restoreCache(cachePath, cacheKey, cacheRestoreKeys, listener) {
|
async function restoreCache(cachePath, cacheKey, cacheRestoreKeys, listener) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
|
||||||
listener.markRequested(cacheKey, cacheRestoreKeys);
|
listener.markRequested(cacheKey, cacheRestoreKeys);
|
||||||
try {
|
try {
|
||||||
const cacheRestoreOptions = process.env[SEGMENT_DOWNLOAD_TIMEOUT_VAR]
|
const cacheRestoreOptions = process.env[SEGMENT_DOWNLOAD_TIMEOUT_VAR]
|
||||||
? {}
|
? {}
|
||||||
: { segmentTimeoutInMs: SEGMENT_DOWNLOAD_TIMEOUT_DEFAULT };
|
: { segmentTimeoutInMs: SEGMENT_DOWNLOAD_TIMEOUT_DEFAULT };
|
||||||
const restoredEntry = yield cache.restoreCache(cachePath, cacheKey, cacheRestoreKeys, cacheRestoreOptions);
|
const restoredEntry = await cache.restoreCache(cachePath, cacheKey, cacheRestoreKeys, cacheRestoreOptions);
|
||||||
if (restoredEntry !== undefined) {
|
if (restoredEntry !== undefined) {
|
||||||
listener.markRestored(restoredEntry.key, restoredEntry.size);
|
listener.markRestored(restoredEntry.key, restoredEntry.size);
|
||||||
}
|
}
|
||||||
@ -91705,13 +91653,11 @@ function restoreCache(cachePath, cacheKey, cacheRestoreKeys, listener) {
|
|||||||
handleCacheFailure(error, `Failed to restore ${cacheKey}`);
|
handleCacheFailure(error, `Failed to restore ${cacheKey}`);
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
});
|
|
||||||
}
|
}
|
||||||
exports.restoreCache = restoreCache;
|
exports.restoreCache = restoreCache;
|
||||||
function saveCache(cachePath, cacheKey, listener) {
|
async function saveCache(cachePath, cacheKey, listener) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
|
||||||
try {
|
try {
|
||||||
const savedEntry = yield cache.saveCache(cachePath, cacheKey);
|
const savedEntry = await cache.saveCache(cachePath, cacheKey);
|
||||||
listener.markSaved(savedEntry.key, savedEntry.size);
|
listener.markSaved(savedEntry.key, savedEntry.size);
|
||||||
}
|
}
|
||||||
catch (error) {
|
catch (error) {
|
||||||
@ -91723,7 +91669,6 @@ function saveCache(cachePath, cacheKey, listener) {
|
|||||||
}
|
}
|
||||||
handleCacheFailure(error, `Failed to save cache entry with path '${cachePath}' and key: ${cacheKey}`);
|
handleCacheFailure(error, `Failed to save cache entry with path '${cachePath}' and key: ${cacheKey}`);
|
||||||
}
|
}
|
||||||
});
|
|
||||||
}
|
}
|
||||||
exports.saveCache = saveCache;
|
exports.saveCache = saveCache;
|
||||||
function cacheDebug(message) {
|
function cacheDebug(message) {
|
||||||
@ -91750,8 +91695,7 @@ function handleCacheFailure(error, message) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
exports.handleCacheFailure = handleCacheFailure;
|
exports.handleCacheFailure = handleCacheFailure;
|
||||||
function tryDelete(file) {
|
async function tryDelete(file) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
|
||||||
const maxAttempts = 5;
|
const maxAttempts = 5;
|
||||||
for (let attempt = 1; attempt <= maxAttempts; attempt++) {
|
for (let attempt = 1; attempt <= maxAttempts; attempt++) {
|
||||||
if (!fs.existsSync(file)) {
|
if (!fs.existsSync(file)) {
|
||||||
@ -91771,28 +91715,23 @@ function tryDelete(file) {
|
|||||||
if (attempt === maxAttempts) {
|
if (attempt === maxAttempts) {
|
||||||
core.warning(`Failed to delete ${file}, which will impact caching.
|
core.warning(`Failed to delete ${file}, which will impact caching.
|
||||||
It is likely locked by another process. Output of 'jps -ml':
|
It is likely locked by another process. Output of 'jps -ml':
|
||||||
${yield getJavaProcesses()}`);
|
${await getJavaProcesses()}`);
|
||||||
throw error;
|
throw error;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
cacheDebug(`Attempt to delete ${file} failed. Will try again.`);
|
cacheDebug(`Attempt to delete ${file} failed. Will try again.`);
|
||||||
yield delay(1000);
|
await delay(1000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
|
||||||
}
|
}
|
||||||
exports.tryDelete = tryDelete;
|
exports.tryDelete = tryDelete;
|
||||||
function delay(ms) {
|
async function delay(ms) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
|
||||||
return new Promise(resolve => setTimeout(resolve, ms));
|
return new Promise(resolve => setTimeout(resolve, ms));
|
||||||
});
|
|
||||||
}
|
}
|
||||||
function getJavaProcesses() {
|
async function getJavaProcesses() {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
const jpsOutput = await exec.getExecOutput('jps', ['-lm']);
|
||||||
const jpsOutput = yield exec.getExecOutput('jps', ['-lm']);
|
|
||||||
return jpsOutput.stdout;
|
return jpsOutput.stdout;
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -91826,23 +91765,13 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|||||||
__setModuleDefault(result, mod);
|
__setModuleDefault(result, mod);
|
||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
||||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
||||||
return new (P || (P = Promise))(function (resolve, reject) {
|
|
||||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
||||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
||||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
||||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
||||||
});
|
|
||||||
};
|
|
||||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||||
exports.save = exports.restore = void 0;
|
exports.save = exports.restore = void 0;
|
||||||
const core = __importStar(__nccwpck_require__(2186));
|
const core = __importStar(__nccwpck_require__(2186));
|
||||||
const gradle_user_home_cache_1 = __nccwpck_require__(7655);
|
const gradle_user_home_cache_1 = __nccwpck_require__(7655);
|
||||||
const cache_cleaner_1 = __nccwpck_require__(651);
|
const cache_cleaner_1 = __nccwpck_require__(651);
|
||||||
const CACHE_RESTORED_VAR = 'GRADLE_BUILD_ACTION_CACHE_RESTORED';
|
const CACHE_RESTORED_VAR = 'GRADLE_BUILD_ACTION_CACHE_RESTORED';
|
||||||
function restore(userHome, gradleUserHome, cacheListener, cacheConfig) {
|
async function restore(userHome, gradleUserHome, cacheListener, cacheConfig) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
|
||||||
if (process.env[CACHE_RESTORED_VAR]) {
|
if (process.env[CACHE_RESTORED_VAR]) {
|
||||||
core.info('Cache only restored on first action step.');
|
core.info('Cache only restored on first action step.');
|
||||||
return;
|
return;
|
||||||
@ -91872,19 +91801,17 @@ function restore(userHome, gradleUserHome, cacheListener, cacheConfig) {
|
|||||||
cacheListener.cacheWriteOnly = true;
|
cacheListener.cacheWriteOnly = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
yield core.group('Restore Gradle state from cache', () => __awaiter(this, void 0, void 0, function* () {
|
await core.group('Restore Gradle state from cache', async () => {
|
||||||
yield gradleStateCache.restore(cacheListener);
|
await gradleStateCache.restore(cacheListener);
|
||||||
}));
|
});
|
||||||
if (cacheConfig.isCacheCleanupEnabled()) {
|
if (cacheConfig.isCacheCleanupEnabled()) {
|
||||||
core.info('Preparing cache for cleanup.');
|
core.info('Preparing cache for cleanup.');
|
||||||
const cacheCleaner = new cache_cleaner_1.CacheCleaner(gradleUserHome, process.env['RUNNER_TEMP']);
|
const cacheCleaner = new cache_cleaner_1.CacheCleaner(gradleUserHome, process.env['RUNNER_TEMP']);
|
||||||
yield cacheCleaner.prepare();
|
await cacheCleaner.prepare();
|
||||||
}
|
}
|
||||||
});
|
|
||||||
}
|
}
|
||||||
exports.restore = restore;
|
exports.restore = restore;
|
||||||
function save(userHome, gradleUserHome, cacheListener, daemonController, cacheConfig) {
|
async function save(userHome, gradleUserHome, cacheListener, daemonController, cacheConfig) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
|
||||||
if (cacheConfig.isCacheDisabled()) {
|
if (cacheConfig.isCacheDisabled()) {
|
||||||
core.info('Cache is disabled: will not save state for later builds.');
|
core.info('Cache is disabled: will not save state for later builds.');
|
||||||
return;
|
return;
|
||||||
@ -91898,20 +91825,19 @@ function save(userHome, gradleUserHome, cacheListener, daemonController, cacheCo
|
|||||||
cacheListener.cacheReadOnly = true;
|
cacheListener.cacheReadOnly = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
yield daemonController.stopAllDaemons();
|
await daemonController.stopAllDaemons();
|
||||||
if (cacheConfig.isCacheCleanupEnabled()) {
|
if (cacheConfig.isCacheCleanupEnabled()) {
|
||||||
core.info('Forcing cache cleanup.');
|
core.info('Forcing cache cleanup.');
|
||||||
const cacheCleaner = new cache_cleaner_1.CacheCleaner(gradleUserHome, process.env['RUNNER_TEMP']);
|
const cacheCleaner = new cache_cleaner_1.CacheCleaner(gradleUserHome, process.env['RUNNER_TEMP']);
|
||||||
try {
|
try {
|
||||||
yield cacheCleaner.forceCleanup();
|
await cacheCleaner.forceCleanup();
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
core.warning(`Cache cleanup failed. Will continue. ${String(e)}`);
|
core.warning(`Cache cleanup failed. Will continue. ${String(e)}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
yield core.group('Caching Gradle state', () => __awaiter(this, void 0, void 0, function* () {
|
await core.group('Caching Gradle state', async () => {
|
||||||
return new gradle_user_home_cache_1.GradleUserHomeCache(userHome, gradleUserHome, cacheConfig).save(cacheListener);
|
return new gradle_user_home_cache_1.GradleUserHomeCache(userHome, gradleUserHome, cacheConfig).save(cacheListener);
|
||||||
}));
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
exports.save = save;
|
exports.save = save;
|
||||||
@ -91947,15 +91873,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|||||||
__setModuleDefault(result, mod);
|
__setModuleDefault(result, mod);
|
||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
||||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
||||||
return new (P || (P = Promise))(function (resolve, reject) {
|
|
||||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
||||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
||||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
||||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
||||||
});
|
|
||||||
};
|
|
||||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
};
|
};
|
||||||
@ -92006,8 +91923,7 @@ class AbstractEntryExtractor {
|
|||||||
this.extractorName = extractorName;
|
this.extractorName = extractorName;
|
||||||
this.cacheConfig = cacheConfig;
|
this.cacheConfig = cacheConfig;
|
||||||
}
|
}
|
||||||
restore(listener) {
|
async restore(listener) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
|
||||||
const previouslyExtractedCacheEntries = this.loadExtractedCacheEntries();
|
const previouslyExtractedCacheEntries = this.loadExtractedCacheEntries();
|
||||||
const processes = [];
|
const processes = [];
|
||||||
for (const cacheEntry of previouslyExtractedCacheEntries) {
|
for (const cacheEntry of previouslyExtractedCacheEntries) {
|
||||||
@ -92022,12 +91938,10 @@ class AbstractEntryExtractor {
|
|||||||
processes.push(this.awaitForDebugging(this.restoreExtractedCacheEntry(artifactType, cacheEntry.cacheKey, cacheEntry.pattern, entryListener)));
|
processes.push(this.awaitForDebugging(this.restoreExtractedCacheEntry(artifactType, cacheEntry.cacheKey, cacheEntry.pattern, entryListener)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.saveMetadataForCacheResults(yield Promise.all(processes));
|
this.saveMetadataForCacheResults(await Promise.all(processes));
|
||||||
});
|
|
||||||
}
|
}
|
||||||
restoreExtractedCacheEntry(artifactType, cacheKey, pattern, listener) {
|
async restoreExtractedCacheEntry(artifactType, cacheKey, pattern, listener) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
const restoredEntry = await (0, cache_utils_1.restoreCache)([pattern], cacheKey, [], listener);
|
||||||
const restoredEntry = yield (0, cache_utils_1.restoreCache)([pattern], cacheKey, [], listener);
|
|
||||||
if (restoredEntry) {
|
if (restoredEntry) {
|
||||||
core.info(`Restored ${artifactType} with key ${cacheKey} to ${pattern}`);
|
core.info(`Restored ${artifactType} with key ${cacheKey} to ${pattern}`);
|
||||||
return new ExtractedCacheEntry(artifactType, pattern, cacheKey);
|
return new ExtractedCacheEntry(artifactType, pattern, cacheKey);
|
||||||
@ -92036,10 +91950,8 @@ class AbstractEntryExtractor {
|
|||||||
core.info(`Did not restore ${artifactType} with key ${cacheKey} to ${pattern}`);
|
core.info(`Did not restore ${artifactType} with key ${cacheKey} to ${pattern}`);
|
||||||
return new ExtractedCacheEntry(artifactType, pattern, undefined);
|
return new ExtractedCacheEntry(artifactType, pattern, undefined);
|
||||||
}
|
}
|
||||||
});
|
|
||||||
}
|
}
|
||||||
extract(listener) {
|
async extract(listener) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
|
||||||
const cacheEntryDefinitions = this.getExtractedCacheEntryDefinitions();
|
const cacheEntryDefinitions = this.getExtractedCacheEntryDefinitions();
|
||||||
(0, cache_utils_1.cacheDebug)(`Extracting cache entries for ${this.extractorName}: ${JSON.stringify(cacheEntryDefinitions, null, 2)}`);
|
(0, cache_utils_1.cacheDebug)(`Extracting cache entries for ${this.extractorName}: ${JSON.stringify(cacheEntryDefinitions, null, 2)}`);
|
||||||
const previouslyRestoredEntries = this.loadExtractedCacheEntries();
|
const previouslyRestoredEntries = this.loadExtractedCacheEntries();
|
||||||
@ -92051,10 +91963,10 @@ class AbstractEntryExtractor {
|
|||||||
listener.entry(pattern).markNotSaved(cacheEntryDefinition.notCacheableReason);
|
listener.entry(pattern).markNotSaved(cacheEntryDefinition.notCacheableReason);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
const globber = yield glob.create(pattern, {
|
const globber = await glob.create(pattern, {
|
||||||
implicitDescendants: false
|
implicitDescendants: false
|
||||||
});
|
});
|
||||||
const matchingFiles = yield globber.glob();
|
const matchingFiles = await globber.glob();
|
||||||
if (matchingFiles.length === 0) {
|
if (matchingFiles.length === 0) {
|
||||||
(0, cache_utils_1.cacheDebug)(`No files found to cache for ${artifactType}`);
|
(0, cache_utils_1.cacheDebug)(`No files found to cache for ${artifactType}`);
|
||||||
continue;
|
continue;
|
||||||
@ -92068,29 +91980,25 @@ class AbstractEntryExtractor {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.saveMetadataForCacheResults(yield Promise.all(cacheActions));
|
this.saveMetadataForCacheResults(await Promise.all(cacheActions));
|
||||||
});
|
|
||||||
}
|
}
|
||||||
saveExtractedCacheEntry(matchingFiles, artifactType, pattern, uniqueFileNames, previouslyRestoredEntries, entryListener) {
|
async saveExtractedCacheEntry(matchingFiles, artifactType, pattern, uniqueFileNames, previouslyRestoredEntries, entryListener) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
|
||||||
var _a;
|
|
||||||
const cacheKey = uniqueFileNames
|
const cacheKey = uniqueFileNames
|
||||||
? this.createCacheKeyFromFileNames(artifactType, matchingFiles)
|
? this.createCacheKeyFromFileNames(artifactType, matchingFiles)
|
||||||
: yield this.createCacheKeyFromFileContents(artifactType, pattern);
|
: await this.createCacheKeyFromFileContents(artifactType, pattern);
|
||||||
const previouslyRestoredKey = (_a = previouslyRestoredEntries.find(x => x.artifactType === artifactType && x.pattern === pattern)) === null || _a === void 0 ? void 0 : _a.cacheKey;
|
const previouslyRestoredKey = previouslyRestoredEntries.find(x => x.artifactType === artifactType && x.pattern === pattern)?.cacheKey;
|
||||||
if (previouslyRestoredKey === cacheKey) {
|
if (previouslyRestoredKey === cacheKey) {
|
||||||
(0, cache_utils_1.cacheDebug)(`No change to previously restored ${artifactType}. Not saving.`);
|
(0, cache_utils_1.cacheDebug)(`No change to previously restored ${artifactType}. Not saving.`);
|
||||||
entryListener.markNotSaved('contents unchanged');
|
entryListener.markNotSaved('contents unchanged');
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
core.info(`Caching ${artifactType} with path '${pattern}' and cache key: ${cacheKey}`);
|
core.info(`Caching ${artifactType} with path '${pattern}' and cache key: ${cacheKey}`);
|
||||||
yield (0, cache_utils_1.saveCache)([pattern], cacheKey, entryListener);
|
await (0, cache_utils_1.saveCache)([pattern], cacheKey, entryListener);
|
||||||
}
|
}
|
||||||
for (const file of matchingFiles) {
|
for (const file of matchingFiles) {
|
||||||
(0, cache_utils_1.tryDelete)(file);
|
(0, cache_utils_1.tryDelete)(file);
|
||||||
}
|
}
|
||||||
return new ExtractedCacheEntry(artifactType, pattern, cacheKey);
|
return new ExtractedCacheEntry(artifactType, pattern, cacheKey);
|
||||||
});
|
|
||||||
}
|
}
|
||||||
createCacheKeyFromFileNames(artifactType, files) {
|
createCacheKeyFromFileNames(artifactType, files) {
|
||||||
const relativeFiles = files.map(x => path_1.default.relative(this.gradleUserHome, x));
|
const relativeFiles = files.map(x => path_1.default.relative(this.gradleUserHome, x));
|
||||||
@ -92098,20 +92006,16 @@ class AbstractEntryExtractor {
|
|||||||
(0, cache_utils_1.cacheDebug)(`Generating cache key for ${artifactType} from file names: ${relativeFiles}`);
|
(0, cache_utils_1.cacheDebug)(`Generating cache key for ${artifactType} from file names: ${relativeFiles}`);
|
||||||
return `${(0, cache_key_1.getCacheKeyBase)(artifactType, CACHE_PROTOCOL_VERSION)}-${key}`;
|
return `${(0, cache_key_1.getCacheKeyBase)(artifactType, CACHE_PROTOCOL_VERSION)}-${key}`;
|
||||||
}
|
}
|
||||||
createCacheKeyFromFileContents(artifactType, pattern) {
|
async createCacheKeyFromFileContents(artifactType, pattern) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
const key = await glob.hashFiles(pattern);
|
||||||
const key = yield glob.hashFiles(pattern);
|
|
||||||
(0, cache_utils_1.cacheDebug)(`Generating cache key for ${artifactType} from files matching: ${pattern}`);
|
(0, cache_utils_1.cacheDebug)(`Generating cache key for ${artifactType} from files matching: ${pattern}`);
|
||||||
return `${(0, cache_key_1.getCacheKeyBase)(artifactType, CACHE_PROTOCOL_VERSION)}-${key}`;
|
return `${(0, cache_key_1.getCacheKeyBase)(artifactType, CACHE_PROTOCOL_VERSION)}-${key}`;
|
||||||
});
|
|
||||||
}
|
}
|
||||||
awaitForDebugging(p) {
|
async awaitForDebugging(p) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
|
||||||
if ((0, cache_utils_1.isCacheDebuggingEnabled)()) {
|
if ((0, cache_utils_1.isCacheDebuggingEnabled)()) {
|
||||||
yield p;
|
await p;
|
||||||
}
|
}
|
||||||
return p;
|
return p;
|
||||||
});
|
|
||||||
}
|
}
|
||||||
loadExtractedCacheEntries() {
|
loadExtractedCacheEntries() {
|
||||||
const cacheMetadataFile = this.getCacheMetadataFile();
|
const cacheMetadataFile = this.getCacheMetadataFile();
|
||||||
@ -92140,26 +92044,19 @@ class GradleHomeEntryExtractor extends AbstractEntryExtractor {
|
|||||||
constructor(gradleUserHome, cacheConfig) {
|
constructor(gradleUserHome, cacheConfig) {
|
||||||
super(gradleUserHome, 'gradle-home', cacheConfig);
|
super(gradleUserHome, 'gradle-home', cacheConfig);
|
||||||
}
|
}
|
||||||
extract(listener) {
|
async extract(listener) {
|
||||||
const _super = Object.create(null, {
|
await this.deleteWrapperZips();
|
||||||
extract: { get: () => super.extract }
|
return super.extract(listener);
|
||||||
});
|
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
|
||||||
yield this.deleteWrapperZips();
|
|
||||||
return _super.extract.call(this, listener);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
deleteWrapperZips() {
|
async deleteWrapperZips() {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
|
||||||
const wrapperZips = path_1.default.resolve(this.gradleUserHome, 'wrapper/dists/*/*/*.zip');
|
const wrapperZips = path_1.default.resolve(this.gradleUserHome, 'wrapper/dists/*/*/*.zip');
|
||||||
const globber = yield glob.create(wrapperZips, {
|
const globber = await glob.create(wrapperZips, {
|
||||||
implicitDescendants: false
|
implicitDescendants: false
|
||||||
});
|
});
|
||||||
for (const wrapperZip of yield globber.glob()) {
|
for (const wrapperZip of await globber.glob()) {
|
||||||
(0, cache_utils_1.cacheDebug)(`Deleting wrapper zip: ${wrapperZip}`);
|
(0, cache_utils_1.cacheDebug)(`Deleting wrapper zip: ${wrapperZip}`);
|
||||||
yield (0, cache_utils_1.tryDelete)(wrapperZip);
|
await (0, cache_utils_1.tryDelete)(wrapperZip);
|
||||||
}
|
}
|
||||||
});
|
|
||||||
}
|
}
|
||||||
getExtractedCacheEntryDefinitions() {
|
getExtractedCacheEntryDefinitions() {
|
||||||
const entryDefinition = (artifactType, patterns, bundle) => {
|
const entryDefinition = (artifactType, patterns, bundle) => {
|
||||||
@ -92187,11 +92084,7 @@ class ConfigurationCacheEntryExtractor extends AbstractEntryExtractor {
|
|||||||
constructor(gradleUserHome, cacheConfig) {
|
constructor(gradleUserHome, cacheConfig) {
|
||||||
super(gradleUserHome, 'configuration-cache', cacheConfig);
|
super(gradleUserHome, 'configuration-cache', cacheConfig);
|
||||||
}
|
}
|
||||||
restore(listener) {
|
async restore(listener) {
|
||||||
const _super = Object.create(null, {
|
|
||||||
restore: { get: () => super.restore }
|
|
||||||
});
|
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
|
||||||
if (!listener.fullyRestored) {
|
if (!listener.fullyRestored) {
|
||||||
this.markNotRestored(listener, 'Gradle User Home was not fully restored');
|
this.markNotRestored(listener, 'Gradle User Home was not fully restored');
|
||||||
return;
|
return;
|
||||||
@ -92200,8 +92093,7 @@ class ConfigurationCacheEntryExtractor extends AbstractEntryExtractor {
|
|||||||
this.markNotRestored(listener, 'Encryption Key was not provided');
|
this.markNotRestored(listener, 'Encryption Key was not provided');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
return yield _super.restore.call(this, listener);
|
return await super.restore(listener);
|
||||||
});
|
|
||||||
}
|
}
|
||||||
markNotRestored(listener, reason) {
|
markNotRestored(listener, reason) {
|
||||||
const cacheEntries = this.loadExtractedCacheEntries();
|
const cacheEntries = this.loadExtractedCacheEntries();
|
||||||
@ -92213,11 +92105,7 @@ class ConfigurationCacheEntryExtractor extends AbstractEntryExtractor {
|
|||||||
this.saveMetadataForCacheResults([]);
|
this.saveMetadataForCacheResults([]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
extract(listener) {
|
async extract(listener) {
|
||||||
const _super = Object.create(null, {
|
|
||||||
extract: { get: () => super.extract }
|
|
||||||
});
|
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
|
||||||
if (!this.cacheConfig.getCacheEncryptionKey()) {
|
if (!this.cacheConfig.getCacheEncryptionKey()) {
|
||||||
const cacheEntryDefinitions = this.getExtractedCacheEntryDefinitions();
|
const cacheEntryDefinitions = this.getExtractedCacheEntryDefinitions();
|
||||||
if (cacheEntryDefinitions.length > 0) {
|
if (cacheEntryDefinitions.length > 0) {
|
||||||
@ -92228,8 +92116,7 @@ class ConfigurationCacheEntryExtractor extends AbstractEntryExtractor {
|
|||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
yield _super.extract.call(this, listener);
|
await super.extract(listener);
|
||||||
});
|
|
||||||
}
|
}
|
||||||
getExtractedCacheEntryDefinitions() {
|
getExtractedCacheEntryDefinitions() {
|
||||||
const groupedResults = this.getConfigCacheDirectoriesWithAssociatedBuildResults();
|
const groupedResults = this.getConfigCacheDirectoriesWithAssociatedBuildResults();
|
||||||
@ -92292,15 +92179,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|||||||
__setModuleDefault(result, mod);
|
__setModuleDefault(result, mod);
|
||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
||||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
||||||
return new (P || (P = Promise))(function (resolve, reject) {
|
|
||||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
||||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
||||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
||||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
||||||
});
|
|
||||||
};
|
|
||||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
};
|
};
|
||||||
@ -92340,14 +92218,13 @@ class GradleUserHomeCache {
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
restore(listener) {
|
async restore(listener) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
|
||||||
const entryListener = listener.entry(this.cacheDescription);
|
const entryListener = listener.entry(this.cacheDescription);
|
||||||
const cacheKey = (0, cache_key_1.generateCacheKey)(this.cacheName, this.cacheConfig);
|
const cacheKey = (0, cache_key_1.generateCacheKey)(this.cacheName, this.cacheConfig);
|
||||||
(0, cache_utils_1.cacheDebug)(`Requesting ${this.cacheDescription} with
|
(0, cache_utils_1.cacheDebug)(`Requesting ${this.cacheDescription} with
|
||||||
key:${cacheKey.key}
|
key:${cacheKey.key}
|
||||||
restoreKeys:[${cacheKey.restoreKeys}]`);
|
restoreKeys:[${cacheKey.restoreKeys}]`);
|
||||||
const cacheResult = yield (0, cache_utils_1.restoreCache)(this.getCachePath(), cacheKey.key, cacheKey.restoreKeys, entryListener);
|
const cacheResult = await (0, cache_utils_1.restoreCache)(this.getCachePath(), cacheKey.key, cacheKey.restoreKeys, entryListener);
|
||||||
if (!cacheResult) {
|
if (!cacheResult) {
|
||||||
core.info(`${this.cacheDescription} cache not found. Will initialize empty.`);
|
core.info(`${this.cacheDescription} cache not found. Will initialize empty.`);
|
||||||
return;
|
return;
|
||||||
@ -92355,23 +92232,19 @@ class GradleUserHomeCache {
|
|||||||
core.saveState(RESTORED_CACHE_KEY_KEY, cacheResult.key);
|
core.saveState(RESTORED_CACHE_KEY_KEY, cacheResult.key);
|
||||||
core.info(`Restored ${this.cacheDescription} from cache key: ${cacheResult.key}`);
|
core.info(`Restored ${this.cacheDescription} from cache key: ${cacheResult.key}`);
|
||||||
try {
|
try {
|
||||||
yield this.afterRestore(listener);
|
await this.afterRestore(listener);
|
||||||
}
|
}
|
||||||
catch (error) {
|
catch (error) {
|
||||||
core.warning(`Restore ${this.cacheDescription} failed in 'afterRestore': ${error}`);
|
core.warning(`Restore ${this.cacheDescription} failed in 'afterRestore': ${error}`);
|
||||||
}
|
}
|
||||||
});
|
|
||||||
}
|
}
|
||||||
afterRestore(listener) {
|
async afterRestore(listener) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
await this.debugReportGradleUserHomeSize('as restored from cache');
|
||||||
yield this.debugReportGradleUserHomeSize('as restored from cache');
|
await new gradle_home_extry_extractor_1.GradleHomeEntryExtractor(this.gradleUserHome, this.cacheConfig).restore(listener);
|
||||||
yield new gradle_home_extry_extractor_1.GradleHomeEntryExtractor(this.gradleUserHome, this.cacheConfig).restore(listener);
|
await new gradle_home_extry_extractor_1.ConfigurationCacheEntryExtractor(this.gradleUserHome, this.cacheConfig).restore(listener);
|
||||||
yield new gradle_home_extry_extractor_1.ConfigurationCacheEntryExtractor(this.gradleUserHome, this.cacheConfig).restore(listener);
|
await this.debugReportGradleUserHomeSize('after restoring common artifacts');
|
||||||
yield this.debugReportGradleUserHomeSize('after restoring common artifacts');
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
save(listener) {
|
async save(listener) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
|
||||||
const cacheKey = (0, cache_key_1.generateCacheKey)(this.cacheName, this.cacheConfig).key;
|
const cacheKey = (0, cache_key_1.generateCacheKey)(this.cacheName, this.cacheConfig).key;
|
||||||
const restoredCacheKey = core.getState(RESTORED_CACHE_KEY_KEY);
|
const restoredCacheKey = core.getState(RESTORED_CACHE_KEY_KEY);
|
||||||
const gradleHomeEntryListener = listener.entry(this.cacheDescription);
|
const gradleHomeEntryListener = listener.entry(this.cacheDescription);
|
||||||
@ -92388,7 +92261,7 @@ class GradleUserHomeCache {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
yield this.beforeSave(listener);
|
await this.beforeSave(listener);
|
||||||
}
|
}
|
||||||
catch (error) {
|
catch (error) {
|
||||||
core.warning(`Save ${this.cacheDescription} failed in 'beforeSave': ${error}`);
|
core.warning(`Save ${this.cacheDescription} failed in 'beforeSave': ${error}`);
|
||||||
@ -92396,37 +92269,32 @@ class GradleUserHomeCache {
|
|||||||
}
|
}
|
||||||
core.info(`Caching ${this.cacheDescription} with cache key: ${cacheKey}`);
|
core.info(`Caching ${this.cacheDescription} with cache key: ${cacheKey}`);
|
||||||
const cachePath = this.getCachePath();
|
const cachePath = this.getCachePath();
|
||||||
yield (0, cache_utils_1.saveCache)(cachePath, cacheKey, gradleHomeEntryListener);
|
await (0, cache_utils_1.saveCache)(cachePath, cacheKey, gradleHomeEntryListener);
|
||||||
return;
|
return;
|
||||||
});
|
|
||||||
}
|
}
|
||||||
beforeSave(listener) {
|
async beforeSave(listener) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
await this.debugReportGradleUserHomeSize('before saving common artifacts');
|
||||||
yield this.debugReportGradleUserHomeSize('before saving common artifacts');
|
await this.deleteExcludedPaths();
|
||||||
yield this.deleteExcludedPaths();
|
await Promise.all([
|
||||||
yield Promise.all([
|
|
||||||
new gradle_home_extry_extractor_1.GradleHomeEntryExtractor(this.gradleUserHome, this.cacheConfig).extract(listener),
|
new gradle_home_extry_extractor_1.GradleHomeEntryExtractor(this.gradleUserHome, this.cacheConfig).extract(listener),
|
||||||
new gradle_home_extry_extractor_1.ConfigurationCacheEntryExtractor(this.gradleUserHome, this.cacheConfig).extract(listener)
|
new gradle_home_extry_extractor_1.ConfigurationCacheEntryExtractor(this.gradleUserHome, this.cacheConfig).extract(listener)
|
||||||
]);
|
]);
|
||||||
yield this.debugReportGradleUserHomeSize("after extracting common artifacts (only 'caches' and 'notifications' will be stored)");
|
await this.debugReportGradleUserHomeSize("after extracting common artifacts (only 'caches' and 'notifications' will be stored)");
|
||||||
});
|
|
||||||
}
|
}
|
||||||
deleteExcludedPaths() {
|
async deleteExcludedPaths() {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
|
||||||
const rawPaths = this.cacheConfig.getCacheExcludes();
|
const rawPaths = this.cacheConfig.getCacheExcludes();
|
||||||
rawPaths.push('caches/*/cc-keystore');
|
rawPaths.push('caches/*/cc-keystore');
|
||||||
const resolvedPaths = rawPaths.map(x => path_1.default.resolve(this.gradleUserHome, x));
|
const resolvedPaths = rawPaths.map(x => path_1.default.resolve(this.gradleUserHome, x));
|
||||||
for (const p of resolvedPaths) {
|
for (const p of resolvedPaths) {
|
||||||
(0, cache_utils_1.cacheDebug)(`Removing excluded path: ${p}`);
|
(0, cache_utils_1.cacheDebug)(`Removing excluded path: ${p}`);
|
||||||
const globber = yield glob.create(p, {
|
const globber = await glob.create(p, {
|
||||||
implicitDescendants: false
|
implicitDescendants: false
|
||||||
});
|
});
|
||||||
for (const toDelete of yield globber.glob()) {
|
for (const toDelete of await globber.glob()) {
|
||||||
(0, cache_utils_1.cacheDebug)(`Removing excluded file: ${toDelete}`);
|
(0, cache_utils_1.cacheDebug)(`Removing excluded file: ${toDelete}`);
|
||||||
yield (0, cache_utils_1.tryDelete)(toDelete);
|
await (0, cache_utils_1.tryDelete)(toDelete);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
|
||||||
}
|
}
|
||||||
getCachePath() {
|
getCachePath() {
|
||||||
const rawPaths = this.cacheConfig.getCacheIncludes();
|
const rawPaths = this.cacheConfig.getCacheIncludes();
|
||||||
@ -92498,15 +92366,14 @@ class GradleUserHomeCache {
|
|||||||
fs_1.default.writeFileSync(propertiesFile, infoProperties);
|
fs_1.default.writeFileSync(propertiesFile, infoProperties);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
debugReportGradleUserHomeSize(label) {
|
async debugReportGradleUserHomeSize(label) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
|
||||||
if (!(0, cache_utils_1.isCacheDebuggingEnabled)() && !core.isDebug()) {
|
if (!(0, cache_utils_1.isCacheDebuggingEnabled)() && !core.isDebug()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!fs_1.default.existsSync(this.gradleUserHome)) {
|
if (!fs_1.default.existsSync(this.gradleUserHome)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const result = yield exec.getExecOutput('du', ['-h', '-c', '-t', '5M'], {
|
const result = await exec.getExecOutput('du', ['-h', '-c', '-t', '5M'], {
|
||||||
cwd: this.gradleUserHome,
|
cwd: this.gradleUserHome,
|
||||||
silent: true,
|
silent: true,
|
||||||
ignoreReturnCode: true
|
ignoreReturnCode: true
|
||||||
@ -92521,7 +92388,6 @@ class GradleUserHomeCache {
|
|||||||
})
|
})
|
||||||
.join('\n'));
|
.join('\n'));
|
||||||
core.info('-----------------------');
|
core.info('-----------------------');
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
exports.GradleUserHomeCache = GradleUserHomeCache;
|
exports.GradleUserHomeCache = GradleUserHomeCache;
|
||||||
@ -92547,7 +92413,6 @@ function readResourceFileAsString(...paths) {
|
|||||||
}
|
}
|
||||||
exports.readResourceFileAsString = readResourceFileAsString;
|
exports.readResourceFileAsString = readResourceFileAsString;
|
||||||
function getPredefinedToolchains() {
|
function getPredefinedToolchains() {
|
||||||
var _a;
|
|
||||||
const javaHomeEnvs = [];
|
const javaHomeEnvs = [];
|
||||||
for (const javaHomeEnvsKey in process.env) {
|
for (const javaHomeEnvsKey in process.env) {
|
||||||
if (javaHomeEnvsKey.startsWith('JAVA_HOME_')) {
|
if (javaHomeEnvsKey.startsWith('JAVA_HOME_')) {
|
||||||
@ -92562,7 +92427,7 @@ function getPredefinedToolchains() {
|
|||||||
<!-- JDK Toolchains installed by default on GitHub-hosted runners -->
|
<!-- JDK Toolchains installed by default on GitHub-hosted runners -->
|
||||||
`;
|
`;
|
||||||
for (const javaHomeEnv of javaHomeEnvs) {
|
for (const javaHomeEnv of javaHomeEnvs) {
|
||||||
const version = (_a = javaHomeEnv.match(/JAVA_HOME_(\d+)_/)) === null || _a === void 0 ? void 0 : _a[1];
|
const version = javaHomeEnv.match(/JAVA_HOME_(\d+)_/)?.[1];
|
||||||
toolchainsXml += ` <toolchain>
|
toolchainsXml += ` <toolchain>
|
||||||
<type>jdk</type>
|
<type>jdk</type>
|
||||||
<provides>
|
<provides>
|
||||||
@ -92906,15 +92771,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|||||||
__setModuleDefault(result, mod);
|
__setModuleDefault(result, mod);
|
||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
||||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
||||||
return new (P || (P = Promise))(function (resolve, reject) {
|
|
||||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
||||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
||||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
||||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
||||||
});
|
|
||||||
};
|
|
||||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||||
exports.DaemonController = void 0;
|
exports.DaemonController = void 0;
|
||||||
const core = __importStar(__nccwpck_require__(2186));
|
const core = __importStar(__nccwpck_require__(2186));
|
||||||
@ -92926,8 +92782,7 @@ class DaemonController {
|
|||||||
const allHomes = buildResults.map(buildResult => buildResult.gradleHomeDir);
|
const allHomes = buildResults.map(buildResult => buildResult.gradleHomeDir);
|
||||||
this.gradleHomes = Array.from(new Set(allHomes));
|
this.gradleHomes = Array.from(new Set(allHomes));
|
||||||
}
|
}
|
||||||
stopAllDaemons() {
|
async stopAllDaemons() {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
|
||||||
core.info('Stopping all Gradle daemons before saving Gradle User Home state');
|
core.info('Stopping all Gradle daemons before saving Gradle User Home state');
|
||||||
const executions = [];
|
const executions = [];
|
||||||
const args = ['--stop'];
|
const args = ['--stop'];
|
||||||
@ -92942,8 +92797,7 @@ class DaemonController {
|
|||||||
ignoreReturnCode: true
|
ignoreReturnCode: true
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
yield Promise.all(executions);
|
await Promise.all(executions);
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
exports.DaemonController = DaemonController;
|
exports.DaemonController = DaemonController;
|
||||||
@ -92979,15 +92833,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|||||||
__setModuleDefault(result, mod);
|
__setModuleDefault(result, mod);
|
||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
||||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
||||||
return new (P || (P = Promise))(function (resolve, reject) {
|
|
||||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
||||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
||||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
||||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
||||||
});
|
|
||||||
};
|
|
||||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||||
exports.run = void 0;
|
exports.run = void 0;
|
||||||
const core = __importStar(__nccwpck_require__(2186));
|
const core = __importStar(__nccwpck_require__(2186));
|
||||||
@ -92995,10 +92840,9 @@ const setupGradle = __importStar(__nccwpck_require__(8652));
|
|||||||
const configuration_1 = __nccwpck_require__(5778);
|
const configuration_1 = __nccwpck_require__(5778);
|
||||||
const errors_1 = __nccwpck_require__(6976);
|
const errors_1 = __nccwpck_require__(6976);
|
||||||
process.on('uncaughtException', e => handleFailure(e));
|
process.on('uncaughtException', e => handleFailure(e));
|
||||||
function run() {
|
async function run() {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
|
||||||
try {
|
try {
|
||||||
yield setupGradle.complete(new configuration_1.CacheConfig(), new configuration_1.SummaryConfig());
|
await setupGradle.complete(new configuration_1.CacheConfig(), new configuration_1.SummaryConfig());
|
||||||
}
|
}
|
||||||
catch (error) {
|
catch (error) {
|
||||||
if (error instanceof errors_1.PostActionJobFailure) {
|
if (error instanceof errors_1.PostActionJobFailure) {
|
||||||
@ -93009,7 +92853,6 @@ function run() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
process.exit();
|
process.exit();
|
||||||
});
|
|
||||||
}
|
}
|
||||||
exports.run = run;
|
exports.run = run;
|
||||||
function handleFailure(error) {
|
function handleFailure(error) {
|
||||||
@ -93159,15 +93002,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|||||||
__setModuleDefault(result, mod);
|
__setModuleDefault(result, mod);
|
||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
||||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
||||||
return new (P || (P = Promise))(function (resolve, reject) {
|
|
||||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
||||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
||||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
||||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
||||||
});
|
|
||||||
};
|
|
||||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||||
exports.generateJobSummary = void 0;
|
exports.generateJobSummary = void 0;
|
||||||
const core = __importStar(__nccwpck_require__(2186));
|
const core = __importStar(__nccwpck_require__(2186));
|
||||||
@ -93175,15 +93009,14 @@ const github = __importStar(__nccwpck_require__(5438));
|
|||||||
const request_error_1 = __nccwpck_require__(537);
|
const request_error_1 = __nccwpck_require__(537);
|
||||||
const configuration_1 = __nccwpck_require__(5778);
|
const configuration_1 = __nccwpck_require__(5778);
|
||||||
const deprecation_collector_1 = __nccwpck_require__(2572);
|
const deprecation_collector_1 = __nccwpck_require__(2572);
|
||||||
function generateJobSummary(buildResults, cachingReport, config) {
|
async function generateJobSummary(buildResults, cachingReport, config) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
|
||||||
const summaryTable = renderSummaryTable(buildResults);
|
const summaryTable = renderSummaryTable(buildResults);
|
||||||
const hasFailure = buildResults.some(result => result.buildFailed);
|
const hasFailure = buildResults.some(result => result.buildFailed);
|
||||||
if (config.shouldGenerateJobSummary(hasFailure)) {
|
if (config.shouldGenerateJobSummary(hasFailure)) {
|
||||||
core.info('Generating Job Summary');
|
core.info('Generating Job Summary');
|
||||||
core.summary.addRaw(summaryTable);
|
core.summary.addRaw(summaryTable);
|
||||||
core.summary.addRaw(cachingReport);
|
core.summary.addRaw(cachingReport);
|
||||||
yield core.summary.write();
|
await core.summary.write();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
core.info('============================');
|
core.info('============================');
|
||||||
@ -93193,13 +93026,11 @@ function generateJobSummary(buildResults, cachingReport, config) {
|
|||||||
core.info('============================');
|
core.info('============================');
|
||||||
}
|
}
|
||||||
if (config.shouldAddPRComment(hasFailure)) {
|
if (config.shouldAddPRComment(hasFailure)) {
|
||||||
yield addPRComment(summaryTable);
|
await addPRComment(summaryTable);
|
||||||
}
|
}
|
||||||
});
|
|
||||||
}
|
}
|
||||||
exports.generateJobSummary = generateJobSummary;
|
exports.generateJobSummary = generateJobSummary;
|
||||||
function addPRComment(jobSummary) {
|
async function addPRComment(jobSummary) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
|
||||||
const context = github.context;
|
const context = github.context;
|
||||||
if (context.payload.pull_request == null) {
|
if (context.payload.pull_request == null) {
|
||||||
core.info('No pull_request trigger: not adding PR comment');
|
core.info('No pull_request trigger: not adding PR comment');
|
||||||
@ -93216,7 +93047,11 @@ ${jobSummary}`;
|
|||||||
const github_token = (0, configuration_1.getGithubToken)();
|
const github_token = (0, configuration_1.getGithubToken)();
|
||||||
const octokit = github.getOctokit(github_token);
|
const octokit = github.getOctokit(github_token);
|
||||||
try {
|
try {
|
||||||
yield octokit.rest.issues.createComment(Object.assign(Object.assign({}, context.repo), { issue_number: pull_request_number, body: prComment }));
|
await octokit.rest.issues.createComment({
|
||||||
|
...context.repo,
|
||||||
|
issue_number: pull_request_number,
|
||||||
|
body: prComment
|
||||||
|
});
|
||||||
}
|
}
|
||||||
catch (error) {
|
catch (error) {
|
||||||
if (error instanceof request_error_1.RequestError) {
|
if (error instanceof request_error_1.RequestError) {
|
||||||
@ -93226,7 +93061,6 @@ ${jobSummary}`;
|
|||||||
throw error;
|
throw error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
|
||||||
}
|
}
|
||||||
function buildWarningMessage(error) {
|
function buildWarningMessage(error) {
|
||||||
const mainWarning = `Failed to generate PR comment.\n${String(error)}`;
|
const mainWarning = `Failed to generate PR comment.\n${String(error)}`;
|
||||||
@ -93341,15 +93175,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|||||||
__setModuleDefault(result, mod);
|
__setModuleDefault(result, mod);
|
||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
||||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
||||||
return new (P || (P = Promise))(function (resolve, reject) {
|
|
||||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
||||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
||||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
||||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
||||||
});
|
|
||||||
};
|
|
||||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||||
exports.complete = exports.setup = void 0;
|
exports.complete = exports.setup = void 0;
|
||||||
const core = __importStar(__nccwpck_require__(2186));
|
const core = __importStar(__nccwpck_require__(2186));
|
||||||
@ -93367,10 +93192,9 @@ const GRADLE_SETUP_VAR = 'GRADLE_BUILD_ACTION_SETUP_COMPLETED';
|
|||||||
const USER_HOME = 'USER_HOME';
|
const USER_HOME = 'USER_HOME';
|
||||||
const GRADLE_USER_HOME = 'GRADLE_USER_HOME';
|
const GRADLE_USER_HOME = 'GRADLE_USER_HOME';
|
||||||
const CACHE_LISTENER = 'CACHE_LISTENER';
|
const CACHE_LISTENER = 'CACHE_LISTENER';
|
||||||
function setup(cacheConfig, buildScanConfig) {
|
async function setup(cacheConfig, buildScanConfig) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
const userHome = await determineUserHome();
|
||||||
const userHome = yield determineUserHome();
|
const gradleUserHome = await determineGradleUserHome();
|
||||||
const gradleUserHome = yield determineGradleUserHome();
|
|
||||||
if (process.env[GRADLE_SETUP_VAR]) {
|
if (process.env[GRADLE_SETUP_VAR]) {
|
||||||
core.info('Gradle setup only performed on first gradle/actions step in workflow.');
|
core.info('Gradle setup only performed on first gradle/actions step in workflow.');
|
||||||
return false;
|
return false;
|
||||||
@ -93380,15 +93204,13 @@ function setup(cacheConfig, buildScanConfig) {
|
|||||||
core.saveState(USER_HOME, userHome);
|
core.saveState(USER_HOME, userHome);
|
||||||
core.saveState(GRADLE_USER_HOME, gradleUserHome);
|
core.saveState(GRADLE_USER_HOME, gradleUserHome);
|
||||||
const cacheListener = new cache_reporting_1.CacheListener();
|
const cacheListener = new cache_reporting_1.CacheListener();
|
||||||
yield caches.restore(userHome, gradleUserHome, cacheListener, cacheConfig);
|
await caches.restore(userHome, gradleUserHome, cacheListener, cacheConfig);
|
||||||
core.saveState(CACHE_LISTENER, cacheListener.stringify());
|
core.saveState(CACHE_LISTENER, cacheListener.stringify());
|
||||||
buildScan.setup(buildScanConfig);
|
buildScan.setup(buildScanConfig);
|
||||||
return true;
|
return true;
|
||||||
});
|
|
||||||
}
|
}
|
||||||
exports.setup = setup;
|
exports.setup = setup;
|
||||||
function complete(cacheConfig, summaryConfig) {
|
async function complete(cacheConfig, summaryConfig) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
|
||||||
if (!core.getState(GRADLE_SETUP_VAR)) {
|
if (!core.getState(GRADLE_SETUP_VAR)) {
|
||||||
core.info('Gradle setup post-action only performed for first gradle/actions step in workflow.');
|
core.info('Gradle setup post-action only performed for first gradle/actions step in workflow.');
|
||||||
return false;
|
return false;
|
||||||
@ -93399,28 +93221,24 @@ function complete(cacheConfig, summaryConfig) {
|
|||||||
const gradleUserHome = core.getState(GRADLE_USER_HOME);
|
const gradleUserHome = core.getState(GRADLE_USER_HOME);
|
||||||
const cacheListener = cache_reporting_1.CacheListener.rehydrate(core.getState(CACHE_LISTENER));
|
const cacheListener = cache_reporting_1.CacheListener.rehydrate(core.getState(CACHE_LISTENER));
|
||||||
const daemonController = new daemon_controller_1.DaemonController(buildResults);
|
const daemonController = new daemon_controller_1.DaemonController(buildResults);
|
||||||
yield caches.save(userHome, gradleUserHome, cacheListener, daemonController, cacheConfig);
|
await caches.save(userHome, gradleUserHome, cacheListener, daemonController, cacheConfig);
|
||||||
const cachingReport = (0, cache_reporting_1.generateCachingReport)(cacheListener);
|
const cachingReport = (0, cache_reporting_1.generateCachingReport)(cacheListener);
|
||||||
yield jobSummary.generateJobSummary(buildResults, cachingReport, summaryConfig);
|
await jobSummary.generateJobSummary(buildResults, cachingReport, summaryConfig);
|
||||||
(0, build_results_1.markBuildResultsProcessed)();
|
(0, build_results_1.markBuildResultsProcessed)();
|
||||||
core.info('Completed post-action step');
|
core.info('Completed post-action step');
|
||||||
return true;
|
return true;
|
||||||
});
|
|
||||||
}
|
}
|
||||||
exports.complete = complete;
|
exports.complete = complete;
|
||||||
function determineGradleUserHome() {
|
async function determineGradleUserHome() {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
|
||||||
const customGradleUserHome = process.env['GRADLE_USER_HOME'];
|
const customGradleUserHome = process.env['GRADLE_USER_HOME'];
|
||||||
if (customGradleUserHome) {
|
if (customGradleUserHome) {
|
||||||
const rootDir = (0, configuration_1.getWorkspaceDirectory)();
|
const rootDir = (0, configuration_1.getWorkspaceDirectory)();
|
||||||
return path.resolve(rootDir, customGradleUserHome);
|
return path.resolve(rootDir, customGradleUserHome);
|
||||||
}
|
}
|
||||||
return path.resolve(yield determineUserHome(), '.gradle');
|
return path.resolve(await determineUserHome(), '.gradle');
|
||||||
});
|
|
||||||
}
|
}
|
||||||
function determineUserHome() {
|
async function determineUserHome() {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
const output = await exec.getExecOutput('java', ['-XshowSettings:properties', '-version'], { silent: true });
|
||||||
const output = yield exec.getExecOutput('java', ['-XshowSettings:properties', '-version'], { silent: true });
|
|
||||||
const regex = /user\.home = (\S*)/i;
|
const regex = /user\.home = (\S*)/i;
|
||||||
const found = output.stderr.match(regex);
|
const found = output.stderr.match(regex);
|
||||||
if (found == null || found.length <= 1) {
|
if (found == null || found.length <= 1) {
|
||||||
@ -93430,7 +93248,6 @@ function determineUserHome() {
|
|||||||
const userHome = found[1];
|
const userHome = found[1];
|
||||||
core.debug(`Determined user.home from java -version output: '${userHome}'`);
|
core.debug(`Determined user.home from java -version output: '${userHome}'`);
|
||||||
return userHome;
|
return userHome;
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
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
626
dist/setup-gradle/main/index.js
vendored
626
dist/setup-gradle/main/index.js
vendored
File diff suppressed because it is too large
Load Diff
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
478
dist/setup-gradle/post/index.js
vendored
478
dist/setup-gradle/post/index.js
vendored
File diff suppressed because it is too large
Load Diff
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
30240
dist/wrapper-validation/main/index.js
vendored
Normal file
30240
dist/wrapper-validation/main/index.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
dist/wrapper-validation/main/index.js.map
vendored
Normal file
1
dist/wrapper-validation/main/index.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user