mirror of
https://github.com/gradle/gradle-build-action.git
synced 2025-07-17 12:45:48 +02:00
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:
parent
76a33e31af
commit
5c01db8918
4 changed files with 16 additions and 23 deletions
16
src/main.ts
16
src/main.ts
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue