mirror of
https://github.com/gradle/gradle-build-action.git
synced 2024-12-02 05:01:04 -05:00
5340f6e816
- For now, this is limited to configuration-cache directory
19 lines
650 B
TypeScript
19 lines
650 B
TypeScript
import * as cacheGradleUserHome from './cache-gradle-user-home'
|
|
import * as cacheProjectDotGradle from './cache-project-dot-gradle'
|
|
import * as core from '@actions/core'
|
|
|
|
const BUILD_ROOT_DIR = 'BUILD_ROOT_DIR'
|
|
|
|
export async function restore(buildRootDirectory: string): Promise<void> {
|
|
core.saveState(BUILD_ROOT_DIR, buildRootDirectory)
|
|
|
|
await cacheGradleUserHome.restore()
|
|
await cacheProjectDotGradle.restore(buildRootDirectory)
|
|
}
|
|
|
|
export async function save(): Promise<void> {
|
|
const buildRootDirectory = core.getState(BUILD_ROOT_DIR)
|
|
|
|
await cacheGradleUserHome.save()
|
|
await cacheProjectDotGradle.save(buildRootDirectory)
|
|
}
|