mirror of
https://github.com/gradle/actions.git
synced 2025-12-08 17:15:46 +08:00
Move execution-related code into subpackage
This commit is contained in:
@@ -1,9 +1,7 @@
|
||||
import * as core from '@actions/core'
|
||||
|
||||
import * as setupGradle from '../setup-gradle'
|
||||
import * as execution from '../execution'
|
||||
import * as provisioner from '../provision'
|
||||
import * as layout from '../repository-layout'
|
||||
import * as gradle from '../execution/gradle'
|
||||
import * as dependencyGraph from '../dependency-graph'
|
||||
import {BuildScanConfig, CacheConfig, DependencyGraphConfig, getArguments} from '../input-params'
|
||||
|
||||
@@ -18,15 +16,8 @@ export async function run(): Promise<void> {
|
||||
// Configure the dependency graph submission
|
||||
await dependencyGraph.setup(new DependencyGraphConfig())
|
||||
|
||||
// Download and install Gradle if required
|
||||
const executable = await provisioner.provisionGradle()
|
||||
|
||||
// Only execute if arguments have been provided
|
||||
const args: string[] = getArguments()
|
||||
if (args.length > 0) {
|
||||
const buildRootDirectory = layout.buildRootDirectory()
|
||||
await execution.executeGradleBuild(executable, buildRootDirectory, args)
|
||||
}
|
||||
await gradle.provisionAndMaybeExecute(args)
|
||||
} catch (error) {
|
||||
core.setFailed(String(error))
|
||||
if (error instanceof Error && error.stack) {
|
||||
|
||||
Reference in New Issue
Block a user