mirror of
https://github.com/gradle/actions.git
synced 2025-12-08 17:15:46 +08:00
Combine all sources into a sub-directory
This commit is contained in:
17
sources/src/execution.ts
Normal file
17
sources/src/execution.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
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`)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user