mirror of
https://github.com/gradle/gradle-build-action.git
synced 2025-04-05 21:04:15 +02:00
Avoid unnecessary resolve of installed Gradle
This commit is contained in:
parent
4dda5928c7
commit
70af846d72
1 changed files with 2 additions and 4 deletions
|
@ -8,7 +8,6 @@ import * as toolCache from '@actions/tool-cache'
|
||||||
|
|
||||||
import * as gradlew from './gradlew'
|
import * as gradlew from './gradlew'
|
||||||
import * as params from './input-params'
|
import * as params from './input-params'
|
||||||
import * as layout from './repository-layout'
|
|
||||||
import {handleCacheFailure, isCacheDisabled, isCacheReadOnly} from './cache-utils'
|
import {handleCacheFailure, isCacheDisabled, isCacheReadOnly} from './cache-utils'
|
||||||
|
|
||||||
const gradleVersionsBaseUrl = 'https://services.gradle.org/versions'
|
const gradleVersionsBaseUrl = 'https://services.gradle.org/versions'
|
||||||
|
@ -20,13 +19,12 @@ const gradleVersionsBaseUrl = 'https://services.gradle.org/versions'
|
||||||
export async function provisionGradle(): Promise<string | undefined> {
|
export async function provisionGradle(): Promise<string | undefined> {
|
||||||
const gradleVersion = params.getGradleVersion()
|
const gradleVersion = params.getGradleVersion()
|
||||||
if (gradleVersion !== '' && gradleVersion !== 'wrapper') {
|
if (gradleVersion !== '' && gradleVersion !== 'wrapper') {
|
||||||
return addToPath(path.resolve(await installGradle(gradleVersion)))
|
return addToPath(await installGradle(gradleVersion))
|
||||||
}
|
}
|
||||||
|
|
||||||
const gradleExecutable = params.getGradleExecutable()
|
const gradleExecutable = params.getGradleExecutable()
|
||||||
if (gradleExecutable !== '') {
|
if (gradleExecutable !== '') {
|
||||||
const workspaceDirectory = layout.workspaceDirectory()
|
return addToPath(gradleExecutable)
|
||||||
return addToPath(path.resolve(workspaceDirectory, gradleExecutable))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return undefined
|
return undefined
|
||||||
|
|
Loading…
Add table
Reference in a new issue