Skip to content

Commit 45b7b13

Browse files
committed
only Versions.kt and Dependencies.kt as cache key
1 parent f560091 commit 45b7b13

File tree

5 files changed

+20
-5
lines changed

5 files changed

+20
-5
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ Currently, the following distributions are supported:
6767

6868
### Caching packages dependencies
6969
The action has a built-in functionality for caching and restoring dependencies. It uses [actions/cache](https://github.com/actions/cache) under hood for caching dependencies but requires less configuration settings. Supported package managers are gradle and maven. The format of the used cache key is `setup-java-${{ platform }}-${{ packageManager }}-${{ fileHash }}`, where the hash is based on the following files:
70-
- gradle: `**/*.gradle*`, `**/gradle-wrapper.properties`, `buildSrc/**/*.kt`
70+
- gradle: `**/*.gradle*`, `**/gradle-wrapper.properties`, `buildSrc/**/Versions.kt`, `buildSrc/**/Dependencies.kt`
7171
- maven: `**/pom.xml`
7272
- sbt: `**/build.sbt`
7373

__tests__/cache.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ describe('dependency cache', () => {
9898
await expect(restore('gradle')).rejects.toThrowError(
9999
`No file in ${projectRoot(
100100
workspace
101-
)} matched to [**/*.gradle*,**/gradle-wrapper.properties,buildSrc/**/*.kt], make sure you have checked out the target repository`
101+
)} matched to [**/*.gradle*,**/gradle-wrapper.properties,buildSrc/**/Versions.kt,buildSrc/**/Dependencies.kt], make sure you have checked out the target repository`
102102
);
103103
});
104104
it('downloads cache based on build.gradle', async () => {

dist/cleanup/index.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63299,7 +63299,12 @@ const supportedPackageManager = [
6329963299
id: 'gradle',
6330063300
path: [path_1.join(os_1.default.homedir(), '.gradle', 'caches'), path_1.join(os_1.default.homedir(), '.gradle', 'wrapper')],
6330163301
// https://github.com/actions/cache/blob/0638051e9af2c23d10bb70fa9beffcad6cff9ce3/examples.md#java---gradle
63302-
pattern: ['**/*.gradle*', '**/gradle-wrapper.properties', 'buildSrc/**/*.kt']
63302+
pattern: [
63303+
'**/*.gradle*',
63304+
'**/gradle-wrapper.properties',
63305+
'buildSrc/**/Versions.kt',
63306+
'buildSrc/**/Dependencies.kt'
63307+
]
6330363308
},
6330463309
{
6330563310
id: 'sbt',

dist/setup/index.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18631,7 +18631,12 @@ const supportedPackageManager = [
1863118631
id: 'gradle',
1863218632
path: [path_1.join(os_1.default.homedir(), '.gradle', 'caches'), path_1.join(os_1.default.homedir(), '.gradle', 'wrapper')],
1863318633
// https://github.com/actions/cache/blob/0638051e9af2c23d10bb70fa9beffcad6cff9ce3/examples.md#java---gradle
18634-
pattern: ['**/*.gradle*', '**/gradle-wrapper.properties', 'buildSrc/**/*.kt']
18634+
pattern: [
18635+
'**/*.gradle*',
18636+
'**/gradle-wrapper.properties',
18637+
'buildSrc/**/Versions.kt',
18638+
'buildSrc/**/Dependencies.kt'
18639+
]
1863518640
},
1863618641
{
1863718642
id: 'sbt',

src/cache.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,12 @@ const supportedPackageManager: PackageManager[] = [
3131
id: 'gradle',
3232
path: [join(os.homedir(), '.gradle', 'caches'), join(os.homedir(), '.gradle', 'wrapper')],
3333
// https://github.com/actions/cache/blob/0638051e9af2c23d10bb70fa9beffcad6cff9ce3/examples.md#java---gradle
34-
pattern: ['**/*.gradle*', '**/gradle-wrapper.properties', 'buildSrc/**/*.kt']
34+
pattern: [
35+
'**/*.gradle*',
36+
'**/gradle-wrapper.properties',
37+
'buildSrc/**/Versions.kt',
38+
'buildSrc/**/Dependencies.kt'
39+
]
3540
},
3641
{
3742
id: 'sbt',

0 commit comments

Comments
 (0)