Search in sources :

Example 1 with GradleLauncherFactory

use of org.gradle.initialization.GradleLauncherFactory in project gradle by gradle.

the class InProcessBuildActionExecuter method execute.

public Object execute(BuildAction action, BuildRequestContext buildRequestContext, BuildActionParameters actionParameters, ServiceRegistry contextServices) {
    GradleLauncherFactory gradleLauncherFactory = contextServices.get(GradleLauncherFactory.class);
    GradleLauncher gradleLauncher = gradleLauncherFactory.newInstance(action.getStartParameter(), buildRequestContext, contextServices);
    GradleBuildController buildController = new GradleBuildController(gradleLauncher);
    checkDeprecations(action.getStartParameter());
    try {
        RootBuildLifecycleListener buildLifecycleListener = contextServices.get(ListenerManager.class).getBroadcaster(RootBuildLifecycleListener.class);
        buildLifecycleListener.afterStart();
        try {
            buildActionRunner.run(action, buildController);
            return buildController.getResult();
        } finally {
            buildLifecycleListener.beforeComplete();
        }
    } finally {
        buildController.stop();
    }
}
Also used : GradleLauncherFactory(org.gradle.initialization.GradleLauncherFactory) GradleBuildController(org.gradle.internal.invocation.GradleBuildController) GradleLauncher(org.gradle.initialization.GradleLauncher) RootBuildLifecycleListener(org.gradle.initialization.RootBuildLifecycleListener) ListenerManager(org.gradle.internal.event.ListenerManager)

Aggregations

GradleLauncher (org.gradle.initialization.GradleLauncher)1 GradleLauncherFactory (org.gradle.initialization.GradleLauncherFactory)1 RootBuildLifecycleListener (org.gradle.initialization.RootBuildLifecycleListener)1 ListenerManager (org.gradle.internal.event.ListenerManager)1 GradleBuildController (org.gradle.internal.invocation.GradleBuildController)1