mirror of
https://github.com/gradle/gradle-build-action.git
synced 2025-06-05 07:46:11 +02:00
Make artifact bundle definitions an input parameter
This commit is contained in:
parent
29b14c7fca
commit
da64595ccc
2 changed files with 16 additions and 8 deletions
|
@ -10,13 +10,6 @@ import {AbstractCache, hashFileNames, tryDelete} from './cache-utils'
|
|||
// Which paths under Gradle User Home should be cached
|
||||
const CACHE_PATH = ['caches', 'notifications']
|
||||
|
||||
const CACHE_ARTIFACT_BUNDLES = [
|
||||
['generated-gradle-jars', 'caches/*/generated-gradle-jars/*.jar'],
|
||||
['wrapper-zips', 'wrapper/dists/*/*/*.zip'],
|
||||
['dependency-jars', 'caches/modules-*/files-*/**/*.jar'],
|
||||
['instrumented-jars', 'caches/jars-*/*/*.jar']
|
||||
]
|
||||
|
||||
export class GradleUserHomeCache extends AbstractCache {
|
||||
private gradleUserHome: string
|
||||
|
||||
|
@ -171,8 +164,13 @@ export class GradleUserHomeCache extends AbstractCache {
|
|||
}
|
||||
|
||||
private getArtifactBundles(): Map<string, string> {
|
||||
const artifactBundleDefinition = core.getInput('cache-artifact-bundles')
|
||||
this.debug(
|
||||
`Using artifact bundle definition: ${artifactBundleDefinition}`
|
||||
)
|
||||
const artifactBundles = JSON.parse(artifactBundleDefinition)
|
||||
return new Map(
|
||||
Array.from(CACHE_ARTIFACT_BUNDLES, ([key, value]) => [
|
||||
Array.from(artifactBundles, ([key, value]) => [
|
||||
key,
|
||||
path.resolve(this.gradleUserHome, value)
|
||||
])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue