Compare commits

..

18 Commits

Author SHA1 Message Date
Daz DeBoer
356abb47e7 Merge pull request #414 from gradle/dd/cache-cleanup-windows
Implement cache-cleanup on Windows
2022-08-26 09:04:41 -06:00
Daz DeBoer
fc9e8feb61 Build outputs 2022-08-26 09:04:11 -06:00
Daz DeBoer
0e4b100458 Use node to set file timestamps
Using `find` and `touch` will not work on windows, so this provides a
cross-platform mechanism.
2022-08-26 09:04:11 -06:00
Daz DeBoer
82bc72e1e7 Re-enable cache-cleanup on Windows 2022-08-26 09:03:58 -06:00
Daz DeBoer
8be955ee80 Update dev dependencies 2022-08-25 20:33:04 -06:00
Daz DeBoer
531cc21aeb Clarify comment 2022-08-25 20:26:16 -06:00
Daz DeBoer
164712adb1 Publish build scans for test-init-script build 2022-08-25 20:24:18 -06:00
Daz DeBoer
535b494721 Merge branch 'dd/cache-cleanup-test-fix'
Disable cache-cleanup on Windows
  Fix OSX by avoiding GNU-specific touch options
2022-08-25 20:21:59 -06:00
Daz DeBoer
d6110ecac2 Build outputs 2022-08-25 20:06:13 -06:00
Daz DeBoer
cc60593845 Disable cache-cleanup on Windows
It does not seem possible to use `find .. -exec ..` on Windows,
so a node-only solution may be required.
2022-08-25 20:06:13 -06:00
Daz DeBoer
fb549a8417 Avoid using GNU-specific touch options
This makes cache-cleaner work correctly on MacOS.
2022-08-25 20:03:04 -06:00
Daz DeBoer
c64fe31590 Fix tests that run on Windows
- Properly escape sysprop values
- Use bash for file existence checks
2022-08-25 20:02:31 -06:00
Daz DeBoer
6e56b59601 Fix test sysprop name to work on Windows 2022-08-24 08:19:52 -06:00
Daz DeBoer
c77676cc69 Fix copy-paste error 2022-08-24 08:03:39 -06:00
Daz DeBoer
f39ea084f9 Merge pull request #410 from gradle/dependabot/npm_and_yarn/eslint-plugin-jest-26.8.7
Bump eslint-plugin-jest from 26.8.3 to 26.8.7
2022-08-22 19:35:31 -06:00
Daz DeBoer
27a2f232f6 Merge pull request #411 from gradle/dependabot/npm_and_yarn/typescript-eslint/parser-5.34.0
Bump @typescript-eslint/parser from 5.33.1 to 5.34.0
2022-08-22 19:35:18 -06:00
dependabot[bot]
b4c3d51488 Bump @typescript-eslint/parser from 5.33.1 to 5.34.0
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 5.33.1 to 5.34.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.34.0/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-22 22:10:29 +00:00
dependabot[bot]
99ec710825 Bump eslint-plugin-jest from 26.8.3 to 26.8.7
Bumps [eslint-plugin-jest](https://github.com/jest-community/eslint-plugin-jest) from 26.8.3 to 26.8.7.
- [Release notes](https://github.com/jest-community/eslint-plugin-jest/releases)
- [Changelog](https://github.com/jest-community/eslint-plugin-jest/blob/main/CHANGELOG.md)
- [Commits](https://github.com/jest-community/eslint-plugin-jest/compare/v26.8.3...v26.8.7)

---
updated-dependencies:
- dependency-name: eslint-plugin-jest
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-22 22:09:52 +00:00
14 changed files with 178 additions and 85 deletions

View File

@@ -49,3 +49,9 @@ updates:
- gradle-plugin-portal
schedule:
interval: "daily"
- package-ecosystem: "gradle"
directory: "test/init-scripts"
registries:
- gradle-plugin-portal
schedule:
interval: "daily"

View File

@@ -20,7 +20,6 @@ jobs:
cache-key-prefix: ${{github.run_number}}-
cache-cleanup:
needs: build-distribution
uses: ./.github/workflows/integ-test-cache-cleanup.yml
with:
cache-key-prefix: ${{github.run_number}}-

View File

@@ -34,7 +34,7 @@ jobs:
cache-read-only: false # For testing, allow writing cache entries on non-default branches
- name: Build with 3.1
working-directory: test/jest/resources/cache-cleanup
run: gradle --no-daemon --build-cache -Dcommons-math3.version=3.1 build
run: gradle --no-daemon --build-cache -Dcommons_math3_version="3.1" build
# Second build will use the cache from the first build, but cleanup should remove unused artifacts
assemble-build:
@@ -55,7 +55,7 @@ jobs:
gradle-home-cache-cleanup: true
- name: Build with 3.1.1
working-directory: test/jest/resources/cache-cleanup
run: gradle --no-daemon --build-cache -Dcommons-math3.version=3.1.1 build
run: gradle --no-daemon --build-cache -Dcommons_math3_version="3.1.1" build
check-clean-cache:
needs: assemble-build
@@ -75,6 +75,7 @@ jobs:
- name: Report Gradle User Home
run: du -hc ~/.gradle/caches/modules-2
- name: Verify cleaned cache
shell: bash
run: |
if [ ! -e ~/.gradle/caches/modules-2/files-2.1/org.apache.commons/commons-math3/3.1.1 ]; then
echo "::error ::Should find commons-math3 3.1.1 in cache"

36
dist/main/index.js vendored
View File

@@ -65860,12 +65860,21 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
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) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.CacheCleaner = void 0;
const core = __importStar(__nccwpck_require__(2186));
const exec = __importStar(__nccwpck_require__(1514));
const glob = __importStar(__nccwpck_require__(8090));
const fs_1 = __importDefault(__nccwpck_require__(7147));
const path_1 = __importDefault(__nccwpck_require__(1017));
class CacheCleaner {
@@ -65896,12 +65905,35 @@ class CacheCleaner {
}
ageAllFiles(fileName = '*') {
return __awaiter(this, void 0, void 0, function* () {
yield exec.exec('find', [this.gradleUserHome, '-name', fileName, '-exec', 'touch', '-m', '-d', '1970-01-01', '{}', '+'], {});
core.debug(`Aging all files in Gradle User Homee with name ${fileName}`);
yield this.setUtimes(`${this.gradleUserHome}/**/${fileName}`, new Date(0));
});
}
touchAllFiles(fileName = '*') {
return __awaiter(this, void 0, void 0, function* () {
yield exec.exec('find', [this.gradleUserHome, '-name', fileName, '-exec', 'touch', '-m', '{}', '+'], {});
core.debug(`Touching all files in Gradle User Home with name ${fileName}`);
yield this.setUtimes(`${this.gradleUserHome}/**/${fileName}`, new Date());
});
}
setUtimes(pattern, timestamp) {
var e_1, _a;
return __awaiter(this, void 0, void 0, function* () {
const globber = yield glob.create(pattern, {
implicitDescendants: false
});
try {
for (var _b = __asyncValues(globber.globGenerator()), _c; _c = yield _b.next(), !_c.done;) {
const file = _c.value;
fs_1.default.utimesSync(file, timestamp, timestamp);
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try {
if (_c && !_c.done && (_a = _b.return)) yield _a.call(_b);
}
finally { if (e_1) throw e_1.error; }
}
});
}
}

File diff suppressed because one or more lines are too long

36
dist/post/index.js vendored
View File

@@ -64911,12 +64911,21 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
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) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.CacheCleaner = void 0;
const core = __importStar(__nccwpck_require__(2186));
const exec = __importStar(__nccwpck_require__(1514));
const glob = __importStar(__nccwpck_require__(8090));
const fs_1 = __importDefault(__nccwpck_require__(7147));
const path_1 = __importDefault(__nccwpck_require__(1017));
class CacheCleaner {
@@ -64947,12 +64956,35 @@ class CacheCleaner {
}
ageAllFiles(fileName = '*') {
return __awaiter(this, void 0, void 0, function* () {
yield exec.exec('find', [this.gradleUserHome, '-name', fileName, '-exec', 'touch', '-m', '-d', '1970-01-01', '{}', '+'], {});
core.debug(`Aging all files in Gradle User Homee with name ${fileName}`);
yield this.setUtimes(`${this.gradleUserHome}/**/${fileName}`, new Date(0));
});
}
touchAllFiles(fileName = '*') {
return __awaiter(this, void 0, void 0, function* () {
yield exec.exec('find', [this.gradleUserHome, '-name', fileName, '-exec', 'touch', '-m', '{}', '+'], {});
core.debug(`Touching all files in Gradle User Home with name ${fileName}`);
yield this.setUtimes(`${this.gradleUserHome}/**/${fileName}`, new Date());
});
}
setUtimes(pattern, timestamp) {
var e_1, _a;
return __awaiter(this, void 0, void 0, function* () {
const globber = yield glob.create(pattern, {
implicitDescendants: false
});
try {
for (var _b = __asyncValues(globber.globGenerator()), _c; _c = yield _b.next(), !_c.done;) {
const file = _c.value;
fs_1.default.utimesSync(file, timestamp, timestamp);
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try {
if (_c && !_c.done && (_a = _b.return)) yield _a.call(_b);
}
finally { if (e_1) throw e_1.error; }
}
});
}
}

File diff suppressed because one or more lines are too long

122
package-lock.json generated
View File

@@ -23,17 +23,17 @@
"@types/jest": "28.1.7",
"@types/node": "16.11.21",
"@types/unzipper": "0.10.5",
"@typescript-eslint/parser": "5.33.1",
"@typescript-eslint/parser": "5.35.1",
"@vercel/ncc": "0.34.0",
"eslint": "8.22.0",
"eslint-plugin-github": "4.3.7",
"eslint-plugin-jest": "26.8.3",
"eslint-plugin-jest": "26.8.7",
"jest": "28.1.3",
"js-yaml": "4.1.0",
"patch-package": "6.4.7",
"prettier": "2.7.1",
"ts-jest": "28.0.8",
"typescript": "4.7.4"
"typescript": "4.8.2"
}
},
"node_modules/@actions/cache": {
@@ -1815,14 +1815,14 @@
}
},
"node_modules/@typescript-eslint/parser": {
"version": "5.33.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.33.1.tgz",
"integrity": "sha512-IgLLtW7FOzoDlmaMoXdxG8HOCByTBXrB1V2ZQYSEV1ggMmJfAkMWTwUjjzagS6OkfpySyhKFkBw7A9jYmcHpZA==",
"version": "5.35.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.35.1.tgz",
"integrity": "sha512-XL2TBTSrh3yWAsMYpKseBYTVpvudNf69rPOWXWVBI08My2JVT5jR66eTt4IgQFHA/giiKJW5dUD4x/ZviCKyGg==",
"dev": true,
"dependencies": {
"@typescript-eslint/scope-manager": "5.33.1",
"@typescript-eslint/types": "5.33.1",
"@typescript-eslint/typescript-estree": "5.33.1",
"@typescript-eslint/scope-manager": "5.35.1",
"@typescript-eslint/types": "5.35.1",
"@typescript-eslint/typescript-estree": "5.35.1",
"debug": "^4.3.4"
},
"engines": {
@@ -1842,13 +1842,13 @@
}
},
"node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/scope-manager": {
"version": "5.33.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.33.1.tgz",
"integrity": "sha512-8ibcZSqy4c5m69QpzJn8XQq9NnqAToC8OdH/W6IXPXv83vRyEDPYLdjAlUx8h/rbusq6MkW4YdQzURGOqsn3CA==",
"version": "5.35.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.35.1.tgz",
"integrity": "sha512-kCYRSAzIW9ByEIzmzGHE50NGAvAP3wFTaZevgWva7GpquDyFPFcmvVkFJGWJJktg/hLwmys/FZwqM9EKr2u24Q==",
"dev": true,
"dependencies": {
"@typescript-eslint/types": "5.33.1",
"@typescript-eslint/visitor-keys": "5.33.1"
"@typescript-eslint/types": "5.35.1",
"@typescript-eslint/visitor-keys": "5.35.1"
},
"engines": {
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
@@ -1859,9 +1859,9 @@
}
},
"node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/types": {
"version": "5.33.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.33.1.tgz",
"integrity": "sha512-7K6MoQPQh6WVEkMrMW5QOA5FO+BOwzHSNd0j3+BlBwd6vtzfZceJ8xJ7Um2XDi/O3umS8/qDX6jdy2i7CijkwQ==",
"version": "5.35.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.35.1.tgz",
"integrity": "sha512-FDaujtsH07VHzG0gQ6NDkVVhi1+rhq0qEvzHdJAQjysN+LHDCKDKCBRlZFFE0ec0jKxiv0hN63SNfExy0KrbQQ==",
"dev": true,
"engines": {
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
@@ -1872,13 +1872,13 @@
}
},
"node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/typescript-estree": {
"version": "5.33.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.33.1.tgz",
"integrity": "sha512-JOAzJ4pJ+tHzA2pgsWQi4804XisPHOtbvwUyqsuuq8+y5B5GMZs7lI1xDWs6V2d7gE/Ez5bTGojSK12+IIPtXA==",
"version": "5.35.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.35.1.tgz",
"integrity": "sha512-JUqE1+VRTGyoXlDWWjm6MdfpBYVq+hixytrv1oyjYIBEOZhBCwtpp5ZSvBt4wIA1MKWlnaC2UXl2XmYGC3BoQA==",
"dev": true,
"dependencies": {
"@typescript-eslint/types": "5.33.1",
"@typescript-eslint/visitor-keys": "5.33.1",
"@typescript-eslint/types": "5.35.1",
"@typescript-eslint/visitor-keys": "5.35.1",
"debug": "^4.3.4",
"globby": "^11.1.0",
"is-glob": "^4.0.3",
@@ -1899,12 +1899,12 @@
}
},
"node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/visitor-keys": {
"version": "5.33.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.33.1.tgz",
"integrity": "sha512-nwIxOK8Z2MPWltLKMLOEZwmfBZReqUdbEoHQXeCpa+sRVARe5twpJGHCB4dk9903Yaf0nMAlGbQfaAH92F60eg==",
"version": "5.35.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.35.1.tgz",
"integrity": "sha512-cEB1DvBVo1bxbW/S5axbGPE6b7FIMAbo3w+AGq6zNDA7+NYJOIkKj/sInfTv4edxd4PxJSgdN4t6/pbvgA+n5g==",
"dev": true,
"dependencies": {
"@typescript-eslint/types": "5.33.1",
"@typescript-eslint/types": "5.35.1",
"eslint-visitor-keys": "^3.3.0"
},
"engines": {
@@ -3139,9 +3139,9 @@
"dev": true
},
"node_modules/eslint-plugin-jest": {
"version": "26.8.3",
"resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-26.8.3.tgz",
"integrity": "sha512-2roWu1MkEiihQ/qEszPPoaoqVI1x2D8Jtadk5AmoXTdEeNVPMu01Dtz7jIuTOAmdW3L+tSkPZOtEtQroYJDt0A==",
"version": "26.8.7",
"resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-26.8.7.tgz",
"integrity": "sha512-nJJVv3VY6ZZvJGDMC8h1jN/TIGT4We1JkNn1lvstPURicr/eZPVnlFULQ4W2qL9ByCuCr1hPmlBOc2aZ1ktw4Q==",
"dev": true,
"dependencies": {
"@typescript-eslint/utils": "^5.10.0"
@@ -6701,9 +6701,9 @@
}
},
"node_modules/typescript": {
"version": "4.7.4",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.7.4.tgz",
"integrity": "sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ==",
"version": "4.8.2",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.8.2.tgz",
"integrity": "sha512-C0I1UsrrDHo2fYI5oaCGbSejwX4ch+9Y5jTQELvovfmFkK3HHSZJB8MSJcWLmCUBzQBchCrZ9rMRV6GuNrvGtw==",
"dev": true,
"bin": {
"tsc": "bin/tsc",
@@ -8410,41 +8410,41 @@
}
},
"@typescript-eslint/parser": {
"version": "5.33.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.33.1.tgz",
"integrity": "sha512-IgLLtW7FOzoDlmaMoXdxG8HOCByTBXrB1V2ZQYSEV1ggMmJfAkMWTwUjjzagS6OkfpySyhKFkBw7A9jYmcHpZA==",
"version": "5.35.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.35.1.tgz",
"integrity": "sha512-XL2TBTSrh3yWAsMYpKseBYTVpvudNf69rPOWXWVBI08My2JVT5jR66eTt4IgQFHA/giiKJW5dUD4x/ZviCKyGg==",
"dev": true,
"requires": {
"@typescript-eslint/scope-manager": "5.33.1",
"@typescript-eslint/types": "5.33.1",
"@typescript-eslint/typescript-estree": "5.33.1",
"@typescript-eslint/scope-manager": "5.35.1",
"@typescript-eslint/types": "5.35.1",
"@typescript-eslint/typescript-estree": "5.35.1",
"debug": "^4.3.4"
},
"dependencies": {
"@typescript-eslint/scope-manager": {
"version": "5.33.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.33.1.tgz",
"integrity": "sha512-8ibcZSqy4c5m69QpzJn8XQq9NnqAToC8OdH/W6IXPXv83vRyEDPYLdjAlUx8h/rbusq6MkW4YdQzURGOqsn3CA==",
"version": "5.35.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.35.1.tgz",
"integrity": "sha512-kCYRSAzIW9ByEIzmzGHE50NGAvAP3wFTaZevgWva7GpquDyFPFcmvVkFJGWJJktg/hLwmys/FZwqM9EKr2u24Q==",
"dev": true,
"requires": {
"@typescript-eslint/types": "5.33.1",
"@typescript-eslint/visitor-keys": "5.33.1"
"@typescript-eslint/types": "5.35.1",
"@typescript-eslint/visitor-keys": "5.35.1"
}
},
"@typescript-eslint/types": {
"version": "5.33.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.33.1.tgz",
"integrity": "sha512-7K6MoQPQh6WVEkMrMW5QOA5FO+BOwzHSNd0j3+BlBwd6vtzfZceJ8xJ7Um2XDi/O3umS8/qDX6jdy2i7CijkwQ==",
"version": "5.35.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.35.1.tgz",
"integrity": "sha512-FDaujtsH07VHzG0gQ6NDkVVhi1+rhq0qEvzHdJAQjysN+LHDCKDKCBRlZFFE0ec0jKxiv0hN63SNfExy0KrbQQ==",
"dev": true
},
"@typescript-eslint/typescript-estree": {
"version": "5.33.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.33.1.tgz",
"integrity": "sha512-JOAzJ4pJ+tHzA2pgsWQi4804XisPHOtbvwUyqsuuq8+y5B5GMZs7lI1xDWs6V2d7gE/Ez5bTGojSK12+IIPtXA==",
"version": "5.35.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.35.1.tgz",
"integrity": "sha512-JUqE1+VRTGyoXlDWWjm6MdfpBYVq+hixytrv1oyjYIBEOZhBCwtpp5ZSvBt4wIA1MKWlnaC2UXl2XmYGC3BoQA==",
"dev": true,
"requires": {
"@typescript-eslint/types": "5.33.1",
"@typescript-eslint/visitor-keys": "5.33.1",
"@typescript-eslint/types": "5.35.1",
"@typescript-eslint/visitor-keys": "5.35.1",
"debug": "^4.3.4",
"globby": "^11.1.0",
"is-glob": "^4.0.3",
@@ -8453,12 +8453,12 @@
}
},
"@typescript-eslint/visitor-keys": {
"version": "5.33.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.33.1.tgz",
"integrity": "sha512-nwIxOK8Z2MPWltLKMLOEZwmfBZReqUdbEoHQXeCpa+sRVARe5twpJGHCB4dk9903Yaf0nMAlGbQfaAH92F60eg==",
"version": "5.35.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.35.1.tgz",
"integrity": "sha512-cEB1DvBVo1bxbW/S5axbGPE6b7FIMAbo3w+AGq6zNDA7+NYJOIkKj/sInfTv4edxd4PxJSgdN4t6/pbvgA+n5g==",
"dev": true,
"requires": {
"@typescript-eslint/types": "5.33.1",
"@typescript-eslint/types": "5.35.1",
"eslint-visitor-keys": "^3.3.0"
}
},
@@ -9414,9 +9414,9 @@
}
},
"eslint-plugin-jest": {
"version": "26.8.3",
"resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-26.8.3.tgz",
"integrity": "sha512-2roWu1MkEiihQ/qEszPPoaoqVI1x2D8Jtadk5AmoXTdEeNVPMu01Dtz7jIuTOAmdW3L+tSkPZOtEtQroYJDt0A==",
"version": "26.8.7",
"resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-26.8.7.tgz",
"integrity": "sha512-nJJVv3VY6ZZvJGDMC8h1jN/TIGT4We1JkNn1lvstPURicr/eZPVnlFULQ4W2qL9ByCuCr1hPmlBOc2aZ1ktw4Q==",
"dev": true,
"requires": {
"@typescript-eslint/utils": "^5.10.0"
@@ -11959,9 +11959,9 @@
"dev": true
},
"typescript": {
"version": "4.7.4",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.7.4.tgz",
"integrity": "sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ==",
"version": "4.8.2",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.8.2.tgz",
"integrity": "sha512-C0I1UsrrDHo2fYI5oaCGbSejwX4ch+9Y5jTQELvovfmFkK3HHSZJB8MSJcWLmCUBzQBchCrZ9rMRV6GuNrvGtw==",
"dev": true
},
"unbox-primitive": {

View File

@@ -39,16 +39,16 @@
"@types/jest": "28.1.7",
"@types/node": "16.11.21",
"@types/unzipper": "0.10.5",
"@typescript-eslint/parser": "5.33.1",
"@typescript-eslint/parser": "5.35.1",
"@vercel/ncc": "0.34.0",
"eslint": "8.22.0",
"eslint-plugin-github": "4.3.7",
"eslint-plugin-jest": "26.8.3",
"eslint-plugin-jest": "26.8.7",
"jest": "28.1.3",
"js-yaml": "4.1.0",
"patch-package": "6.4.7",
"prettier": "2.7.1",
"ts-jest": "28.0.8",
"typescript": "4.7.4"
"typescript": "4.8.2"
}
}

View File

@@ -1,4 +1,6 @@
import * as core from '@actions/core'
import * as exec from '@actions/exec'
import * as glob from '@actions/glob'
import fs from 'fs'
import path from 'path'
@@ -46,14 +48,21 @@ export class CacheCleaner {
}
private async ageAllFiles(fileName = '*'): Promise<void> {
await exec.exec(
'find',
[this.gradleUserHome, '-name', fileName, '-exec', 'touch', '-m', '-d', '1970-01-01', '{}', '+'],
{}
)
core.debug(`Aging all files in Gradle User Homee with name ${fileName}`)
await this.setUtimes(`${this.gradleUserHome}/**/${fileName}`, new Date(0))
}
private async touchAllFiles(fileName = '*'): Promise<void> {
await exec.exec('find', [this.gradleUserHome, '-name', fileName, '-exec', 'touch', '-m', '{}', '+'], {})
core.debug(`Touching all files in Gradle User Home with name ${fileName}`)
await this.setUtimes(`${this.gradleUserHome}/**/${fileName}`, new Date())
}
private async setUtimes(pattern: string, timestamp: Date): Promise<void> {
const globber = await glob.create(pattern, {
implicitDescendants: false
})
for await (const file of globber.globGenerator()) {
fs.utimesSync(file, timestamp, timestamp)
}
}
}

View File

@@ -32,7 +32,8 @@ if (isTopLevelBuild) {
if (gradle.rootProject.pluginManager.hasPlugin("com.gradle.build-scan")) {
captureUsingBuildScanPublished(gradle.rootProject.extensions["buildScan"], gradle.rootProject, invocationId)
}
// We need to capture in buildFinished in case the plugin is applied but no build scan is published
// Always attempt to capture in buildFinished in case the plugin is applied but no build scan is published
// The `buildScanPublished` results will NOT be overwritten by this call
captureUsingBuildFinished(gradle, invocationId)
}
}

View File

@@ -1 +1,14 @@
plugins {
id "com.gradle.enterprise" version "3.11.1"
id "com.gradle.common-custom-user-data-gradle-plugin" version "1.8"
}
gradleEnterprise {
buildScan {
termsOfServiceUrl = "https://gradle.com/terms-of-service"
termsOfServiceAgree = "yes"
publishAlways()
uploadInBackground = false
}
}
rootProject.name = 'test-init-scripts'

View File

@@ -63,17 +63,17 @@ test('will cleanup unused gradle versions', async () => {
})
async function runGradleBuild(projectRoot: string, args: string, version: string = '3.1'): Promise<void> {
const status31 = await exec.exec(`gradle -g HOME --no-daemon --build-cache -Dcommons-math3.version=${version} ${args}`, [], {
const status31 = await exec.exec(`gradle -g HOME --no-daemon --build-cache -Dcommons_math3_version="${version}" ${args}`, [], {
cwd: projectRoot
})
console.log(`Gradle User Home initialized with commons-math3.version=${version} ${args}`)
console.log(`Gradle User Home initialized with commons_math3_version=${version} ${args}`)
}
async function runGradleWrapperBuild(projectRoot: string, args: string, version: string = '3.1'): Promise<void> {
const status31 = await exec.exec(`./gradlew -g HOME --no-daemon --build-cache -Dcommons-math3.version=${version} ${args}`, [], {
const status31 = await exec.exec(`./gradlew -g HOME --no-daemon --build-cache -Dcommons_math3_version="${version}" ${args}`, [], {
cwd: projectRoot
})
console.log(`Gradle User Home initialized with commons-math3.version=${version} ${args}`)
console.log(`Gradle User Home initialized with commons_math3_version="${version}" ${args}`)
}
function prepareTestProject(): string {

View File

@@ -7,5 +7,5 @@ repositories {
}
dependencies {
api "org.apache.commons:commons-math3:${System.properties['commons-math3.version']}"
api "org.apache.commons:commons-math3:${System.properties['commons_math3_version']}"
}