[bot] Update dist directory
Some checks failed
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 / determine-suite (push) Has been cancelled
CI-integ-test / build-distribution (push) Has been cancelled
CI-integ-test / action-inputs (push) Has been cancelled
CI-integ-test / build-scan-publish (push) Has been cancelled
CI-integ-test / cache-cleanup (push) Has been cancelled
CI-integ-test / caching-config (push) Has been cancelled
CI-integ-test / dependency-graph (push) Has been cancelled
CI-integ-test / dependency-submission (push) Has been cancelled
CI-integ-test / dependency-submission-failures (push) Has been cancelled
CI-integ-test / execution-with-caching (push) Has been cancelled
CI-integ-test / execution (push) Has been cancelled
CI-integ-test / develocity-injection (push) Has been cancelled
CI-integ-test / provision-gradle-versions (push) Has been cancelled
CI-integ-test / restore-configuration-cache (push) Has been cancelled
CI-integ-test / restore-containerized-gradle-home (push) Has been cancelled
CI-integ-test / restore-custom-gradle-home (push) Has been cancelled
CI-integ-test / restore-gradle-home (push) Has been cancelled
CI-integ-test / restore-java-toolchain (push) Has been cancelled
CI-integ-test / sample-kotlin-dsl (push) Has been cancelled
CI-integ-test / sample-gradle-plugin (push) Has been cancelled
CI-integ-test / toolchain-detection (push) Has been cancelled
CI-integ-test / wrapper-validation (push) Has been cancelled
CI-update-dist / update-dist (push) Has been cancelled

This commit is contained in:
bigdaz 2024-06-28 19:47:07 +00:00 committed by github-actions[bot]
parent dad038d88d
commit cdbbabd09c
8 changed files with 5860 additions and 116 deletions

View file

@ -143001,48 +143001,56 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.CacheCleaner = void 0;
const core = __importStar(__nccwpck_require__(42186));
const exec = __importStar(__nccwpck_require__(71514));
const glob = __importStar(__nccwpck_require__(28090));
const fs_1 = __importDefault(__nccwpck_require__(57147));
const path_1 = __importDefault(__nccwpck_require__(71017));
const gradle_1 = __nccwpck_require__(94475);
class CacheCleaner {
constructor(gradleUserHome, tmpDir) {
this.gradleUserHome = gradleUserHome;
this.tmpDir = tmpDir;
}
async prepare() {
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.writeFileSync(path_1.default.resolve(this.gradleUserHome, 'caches/journal-1/file-access.properties'), 'inceptionTimestamp=0');
await this.ageAllFiles();
await this.touchAllFiles('gc.properties');
const timestamp = Date.now().toString();
core.saveState('clean-timestamp', timestamp);
return timestamp;
}
async forceCleanup() {
await this.ageAllFiles('gc.properties');
const cleanTimestamp = core.getState('clean-timestamp');
await this.forceCleanupFilesOlderThan(cleanTimestamp);
}
async forceCleanupFilesOlderThan(cleanTimestamp) {
core.info(`Cleaning up caches before ${cleanTimestamp}`);
const cleanupProjectDir = path_1.default.resolve(this.tmpDir, 'dummy-cleanup-project');
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, 'init.gradle'), `
beforeSettings { settings ->
def cleanupTime = ${cleanTimestamp}
settings.caches {
cleanup = Cleanup.ALWAYS
releasedWrappers.removeUnusedEntriesOlderThan.set(cleanupTime)
snapshotWrappers.removeUnusedEntriesOlderThan.set(cleanupTime)
downloadedResources.removeUnusedEntriesOlderThan.set(cleanupTime)
createdResources.removeUnusedEntriesOlderThan.set(cleanupTime)
buildCache.removeUnusedEntriesOlderThan.set(cleanupTime)
}
}
`);
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`;
await exec.exec(gradleCommand, [], {
cwd: cleanupProjectDir
});
}
async ageAllFiles(fileName = '*') {
core.debug(`Aging all files in Gradle User Home with name ${fileName}`);
await this.setUtimes(`${this.gradleUserHome}/**/${fileName}`, new Date(0));
}
async touchAllFiles(fileName = '*') {
core.debug(`Touching all files in Gradle User Home with name ${fileName}`);
await this.setUtimes(`${this.gradleUserHome}/**/${fileName}`, new Date());
}
async setUtimes(pattern, timestamp) {
const globber = await glob.create(pattern, {
implicitDescendants: false
});
for await (const file of globber.globGenerator()) {
fs_1.default.utimesSync(file, timestamp, timestamp);
}
await (0, gradle_1.provisionAndMaybeExecute)('current', cleanupProjectDir, [
'-g',
this.gradleUserHome,
'-I',
'init.gradle',
'--info',
'--no-daemon',
'--no-scan',
'--build-cache',
'-DGITHUB_DEPENDENCY_GRAPH_ENABLED=false',
'noop'
]);
}
}
exports.CacheCleaner = CacheCleaner;

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load diff

File diff suppressed because one or more lines are too long

View file

@ -143001,48 +143001,56 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.CacheCleaner = void 0;
const core = __importStar(__nccwpck_require__(42186));
const exec = __importStar(__nccwpck_require__(71514));
const glob = __importStar(__nccwpck_require__(28090));
const fs_1 = __importDefault(__nccwpck_require__(57147));
const path_1 = __importDefault(__nccwpck_require__(71017));
const gradle_1 = __nccwpck_require__(94475);
class CacheCleaner {
constructor(gradleUserHome, tmpDir) {
this.gradleUserHome = gradleUserHome;
this.tmpDir = tmpDir;
}
async prepare() {
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.writeFileSync(path_1.default.resolve(this.gradleUserHome, 'caches/journal-1/file-access.properties'), 'inceptionTimestamp=0');
await this.ageAllFiles();
await this.touchAllFiles('gc.properties');
const timestamp = Date.now().toString();
core.saveState('clean-timestamp', timestamp);
return timestamp;
}
async forceCleanup() {
await this.ageAllFiles('gc.properties');
const cleanTimestamp = core.getState('clean-timestamp');
await this.forceCleanupFilesOlderThan(cleanTimestamp);
}
async forceCleanupFilesOlderThan(cleanTimestamp) {
core.info(`Cleaning up caches before ${cleanTimestamp}`);
const cleanupProjectDir = path_1.default.resolve(this.tmpDir, 'dummy-cleanup-project');
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, 'init.gradle'), `
beforeSettings { settings ->
def cleanupTime = ${cleanTimestamp}
settings.caches {
cleanup = Cleanup.ALWAYS
releasedWrappers.removeUnusedEntriesOlderThan.set(cleanupTime)
snapshotWrappers.removeUnusedEntriesOlderThan.set(cleanupTime)
downloadedResources.removeUnusedEntriesOlderThan.set(cleanupTime)
createdResources.removeUnusedEntriesOlderThan.set(cleanupTime)
buildCache.removeUnusedEntriesOlderThan.set(cleanupTime)
}
}
`);
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`;
await exec.exec(gradleCommand, [], {
cwd: cleanupProjectDir
});
}
async ageAllFiles(fileName = '*') {
core.debug(`Aging all files in Gradle User Home with name ${fileName}`);
await this.setUtimes(`${this.gradleUserHome}/**/${fileName}`, new Date(0));
}
async touchAllFiles(fileName = '*') {
core.debug(`Touching all files in Gradle User Home with name ${fileName}`);
await this.setUtimes(`${this.gradleUserHome}/**/${fileName}`, new Date());
}
async setUtimes(pattern, timestamp) {
const globber = await glob.create(pattern, {
implicitDescendants: false
});
for await (const file of globber.globGenerator()) {
fs_1.default.utimesSync(file, timestamp, timestamp);
}
await (0, gradle_1.provisionAndMaybeExecute)('current', cleanupProjectDir, [
'-g',
this.gradleUserHome,
'-I',
'init.gradle',
'--info',
'--no-daemon',
'--no-scan',
'--build-cache',
'-DGITHUB_DEPENDENCY_GRAPH_ENABLED=false',
'noop'
]);
}
}
exports.CacheCleaner = CacheCleaner;

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load diff

File diff suppressed because one or more lines are too long