Cache wrapper install when gradle-executable points to a wrapper

This commit is contained in:
Paul Merlin 2020-06-13 18:47:57 +02:00
parent e8885a31b8
commit 692fda9de7
4 changed files with 14 additions and 7 deletions

View file

@ -40,18 +40,23 @@ async function resolveGradleExecutable(baseDirectory: string): Promise<string> {
const gradleExecutable = inputOrNull('gradle-executable')
if (gradleExecutable !== null) {
if (gradleExecutable.endsWith(gradlew.wrapperFilename())) {
await cache.restoreCachedWrapperDist(
path.resolve(gradleExecutable, '..')
)
}
return path.resolve(baseDirectory, gradleExecutable)
}
const wrapperDirectory = inputOrNull('wrapper-directory')
const executableDirectory =
const gradlewDirectory =
wrapperDirectory !== null
? path.join(baseDirectory, wrapperDirectory)
: baseDirectory
await cache.restoreCachedWrapperDist(executableDirectory)
await cache.restoreCachedWrapperDist(gradlewDirectory)
return path.resolve(executableDirectory, gradlew.wrapperFilename())
return path.resolve(gradlewDirectory, gradlew.wrapperFilename())
}
function resolveBuildRootDirectory(baseDirectory: string): string {