mirror of
https://github.com/gradle/actions
synced 2024-11-23 18:02:13 +00:00
[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
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:
parent
dad038d88d
commit
cdbbabd09c
8 changed files with 5860 additions and 116 deletions
64
dist/dependency-submission/main/index.js
vendored
64
dist/dependency-submission/main/index.js
vendored
|
@ -143001,48 +143001,56 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||||
exports.CacheCleaner = void 0;
|
exports.CacheCleaner = void 0;
|
||||||
const core = __importStar(__nccwpck_require__(42186));
|
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 fs_1 = __importDefault(__nccwpck_require__(57147));
|
||||||
const path_1 = __importDefault(__nccwpck_require__(71017));
|
const path_1 = __importDefault(__nccwpck_require__(71017));
|
||||||
|
const gradle_1 = __nccwpck_require__(94475);
|
||||||
class CacheCleaner {
|
class CacheCleaner {
|
||||||
constructor(gradleUserHome, tmpDir) {
|
constructor(gradleUserHome, tmpDir) {
|
||||||
this.gradleUserHome = gradleUserHome;
|
this.gradleUserHome = gradleUserHome;
|
||||||
this.tmpDir = tmpDir;
|
this.tmpDir = tmpDir;
|
||||||
}
|
}
|
||||||
async prepare() {
|
async prepare() {
|
||||||
fs_1.default.rmSync(path_1.default.resolve(this.gradleUserHome, 'caches/journal-1'), { recursive: true, force: true });
|
const timestamp = Date.now().toString();
|
||||||
fs_1.default.mkdirSync(path_1.default.resolve(this.gradleUserHome, 'caches/journal-1'), { recursive: true });
|
core.saveState('clean-timestamp', timestamp);
|
||||||
fs_1.default.writeFileSync(path_1.default.resolve(this.gradleUserHome, 'caches/journal-1/file-access.properties'), 'inceptionTimestamp=0');
|
return timestamp;
|
||||||
await this.ageAllFiles();
|
|
||||||
await this.touchAllFiles('gc.properties');
|
|
||||||
}
|
}
|
||||||
async forceCleanup() {
|
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');
|
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, '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") {}');
|
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 (0, gradle_1.provisionAndMaybeExecute)('current', cleanupProjectDir, [
|
||||||
await exec.exec(gradleCommand, [], {
|
'-g',
|
||||||
cwd: cleanupProjectDir
|
this.gradleUserHome,
|
||||||
});
|
'-I',
|
||||||
}
|
'init.gradle',
|
||||||
async ageAllFiles(fileName = '*') {
|
'--info',
|
||||||
core.debug(`Aging all files in Gradle User Home with name ${fileName}`);
|
'--no-daemon',
|
||||||
await this.setUtimes(`${this.gradleUserHome}/**/${fileName}`, new Date(0));
|
'--no-scan',
|
||||||
}
|
'--build-cache',
|
||||||
async touchAllFiles(fileName = '*') {
|
'-DGITHUB_DEPENDENCY_GRAPH_ENABLED=false',
|
||||||
core.debug(`Touching all files in Gradle User Home with name ${fileName}`);
|
'noop'
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
exports.CacheCleaner = CacheCleaner;
|
exports.CacheCleaner = CacheCleaner;
|
||||||
|
|
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
2920
dist/dependency-submission/post/index.js
vendored
2920
dist/dependency-submission/post/index.js
vendored
File diff suppressed because it is too large
Load diff
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
64
dist/setup-gradle/main/index.js
vendored
64
dist/setup-gradle/main/index.js
vendored
|
@ -143001,48 +143001,56 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||||
exports.CacheCleaner = void 0;
|
exports.CacheCleaner = void 0;
|
||||||
const core = __importStar(__nccwpck_require__(42186));
|
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 fs_1 = __importDefault(__nccwpck_require__(57147));
|
||||||
const path_1 = __importDefault(__nccwpck_require__(71017));
|
const path_1 = __importDefault(__nccwpck_require__(71017));
|
||||||
|
const gradle_1 = __nccwpck_require__(94475);
|
||||||
class CacheCleaner {
|
class CacheCleaner {
|
||||||
constructor(gradleUserHome, tmpDir) {
|
constructor(gradleUserHome, tmpDir) {
|
||||||
this.gradleUserHome = gradleUserHome;
|
this.gradleUserHome = gradleUserHome;
|
||||||
this.tmpDir = tmpDir;
|
this.tmpDir = tmpDir;
|
||||||
}
|
}
|
||||||
async prepare() {
|
async prepare() {
|
||||||
fs_1.default.rmSync(path_1.default.resolve(this.gradleUserHome, 'caches/journal-1'), { recursive: true, force: true });
|
const timestamp = Date.now().toString();
|
||||||
fs_1.default.mkdirSync(path_1.default.resolve(this.gradleUserHome, 'caches/journal-1'), { recursive: true });
|
core.saveState('clean-timestamp', timestamp);
|
||||||
fs_1.default.writeFileSync(path_1.default.resolve(this.gradleUserHome, 'caches/journal-1/file-access.properties'), 'inceptionTimestamp=0');
|
return timestamp;
|
||||||
await this.ageAllFiles();
|
|
||||||
await this.touchAllFiles('gc.properties');
|
|
||||||
}
|
}
|
||||||
async forceCleanup() {
|
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');
|
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, '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") {}');
|
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 (0, gradle_1.provisionAndMaybeExecute)('current', cleanupProjectDir, [
|
||||||
await exec.exec(gradleCommand, [], {
|
'-g',
|
||||||
cwd: cleanupProjectDir
|
this.gradleUserHome,
|
||||||
});
|
'-I',
|
||||||
}
|
'init.gradle',
|
||||||
async ageAllFiles(fileName = '*') {
|
'--info',
|
||||||
core.debug(`Aging all files in Gradle User Home with name ${fileName}`);
|
'--no-daemon',
|
||||||
await this.setUtimes(`${this.gradleUserHome}/**/${fileName}`, new Date(0));
|
'--no-scan',
|
||||||
}
|
'--build-cache',
|
||||||
async touchAllFiles(fileName = '*') {
|
'-DGITHUB_DEPENDENCY_GRAPH_ENABLED=false',
|
||||||
core.debug(`Touching all files in Gradle User Home with name ${fileName}`);
|
'noop'
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
exports.CacheCleaner = CacheCleaner;
|
exports.CacheCleaner = CacheCleaner;
|
||||||
|
|
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
2920
dist/setup-gradle/post/index.js
vendored
2920
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
Loading…
Reference in a new issue