use of org.gradle.play.internal.run.DefaultPlayRunSpec in project gradle by gradle.
the class PlayRun method run.
@TaskAction
public void run() {
ProgressLoggerFactory progressLoggerFactory = getServices().get(ProgressLoggerFactory.class);
PlayApplicationDeploymentHandle deploymentHandle = registerOrFindDeploymentHandle(getPath());
if (!deploymentHandle.isRunning()) {
ProgressLogger progressLogger = progressLoggerFactory.newOperation(PlayRun.class).start("Start Play server", "Starting Play");
try {
int httpPort = getHttpPort();
PlayRunSpec spec = new DefaultPlayRunSpec(runtimeClasspath, changingClasspath, applicationJar, assetsJar, assetsDirs, getProject().getProjectDir(), getForkOptions(), httpPort);
PlayApplicationRunnerToken runnerToken = playToolProvider.get(PlayApplicationRunner.class).start(spec);
deploymentHandle.start(runnerToken);
} finally {
progressLogger.completed();
}
}
if (!getProject().getGradle().getStartParameter().isContinuous()) {
ProgressLogger progressLogger = progressLoggerFactory.newOperation(PlayRun.class).start("Run Play App at http://localhost:" + httpPort + "/", "Running at http://localhost:" + httpPort + "/");
try {
waitForCtrlD();
} finally {
progressLogger.completed();
}
} else {
LOGGER.warn("Running Play App ({}) at http://localhost:{}/", getPath(), httpPort);
}
}
Aggregations