mirror of
https://github.com/gradle/gradle-build-action.git
synced 2024-11-22 17:12:51 +00:00
3c11eee5f9
Fixes #796
17 lines
614 B
TypeScript
17 lines
614 B
TypeScript
import * as core from '@actions/core'
|
|
import * as exec from '@actions/exec'
|
|
import * as gradlew from './gradlew'
|
|
|
|
export async function executeGradleBuild(executable: string | undefined, root: string, args: string[]): Promise<void> {
|
|
// Use the provided executable, or look for a Gradle wrapper script to run
|
|
const toExecute = executable ?? gradlew.gradleWrapperScript(root)
|
|
|
|
const status: number = await exec.exec(toExecute, args, {
|
|
cwd: root,
|
|
ignoreReturnCode: true
|
|
})
|
|
|
|
if (status !== 0) {
|
|
core.setFailed(`Gradle build failed: see console output for details`)
|
|
}
|
|
}
|