Remove support for wrapper-directory

In the (rare) case where using a non-default Gradle wrapper is required,
the `gradle-executable` paramater can be used.
This commit is contained in:
Daz DeBoer 2021-06-24 13:33:39 -07:00
parent 76a33e31af
commit 5c01db8918
No known key found for this signature in database
GPG key ID: 70F584A28F2230E8
4 changed files with 16 additions and 23 deletions

View file

@ -41,11 +41,13 @@ async function resolveGradleExecutable(
workspaceDirectory: string,
buildRootDirectory: string
): Promise<string> {
// Download and use a specified Gradle version
const gradleVersion = github.inputOrNull('gradle-version')
if (gradleVersion !== null && gradleVersion !== 'wrapper') {
return path.resolve(await provision.gradleVersion(gradleVersion))
}
// Use a Gradle executable if defined
const gradleExecutable = github.inputOrNull('gradle-executable')
if (gradleExecutable !== null) {
if (gradleExecutable.endsWith(gradlew.wrapperFilename())) {
@ -56,16 +58,10 @@ async function resolveGradleExecutable(
return path.resolve(workspaceDirectory, gradleExecutable)
}
const wrapperDirectory = github.inputOrNull('wrapper-directory')
const gradlewDirectory =
wrapperDirectory !== null
? path.resolve(workspaceDirectory, wrapperDirectory)
: buildRootDirectory
gradlew.validateGradleWrapper(gradlewDirectory)
await cacheWrapper.restoreCachedWrapperDist(gradlewDirectory)
return path.resolve(gradlewDirectory, gradlew.wrapperFilename())
// By default, use the Gradle wrapper declared for the build
gradlew.validateGradleWrapper(buildRootDirectory)
await cacheWrapper.restoreCachedWrapperDist(buildRootDirectory)
return path.resolve(buildRootDirectory, gradlew.wrapperFilename())
}
function resolveBuildRootDirectory(baseDirectory: string): string {