use of org.gradle.internal.logging.progress.ProgressLogger in project gradle by gradle.
the class DefaultDaemonConnector method startDaemon.
public DaemonClientConnection startDaemon(ExplainingSpec<DaemonContext> constraint) {
ProgressLogger progressLogger = progressLoggerFactory.newOperation(DefaultDaemonConnector.class).start("Starting Gradle Daemon", "Starting Daemon");
final DaemonStartupInfo startupInfo = daemonStarter.startDaemon();
LOGGER.debug("Started Gradle daemon {}", startupInfo);
CountdownTimer timer = Timers.startTimer(connectTimeout);
try {
do {
DaemonClientConnection daemonConnection = connectToDaemonWithId(startupInfo, constraint);
if (daemonConnection != null) {
startListener.daemonStarted(daemonConnection.getDaemon());
return daemonConnection;
}
try {
sleep(200L);
} catch (InterruptedException e) {
throw UncheckedException.throwAsUncheckedException(e);
}
} while (!timer.hasExpired());
} finally {
progressLogger.completed();
}
throw new DaemonConnectionException("Timeout waiting to connect to the Gradle daemon.\n" + startupInfo.describe());
}
use of org.gradle.internal.logging.progress.ProgressLogger in project gradle by gradle.
the class AbstractJettyRunTask method startJettyInternal.
public void startJettyInternal() {
ProgressLoggerFactory progressLoggerFactory = getServices().get(ProgressLoggerFactory.class);
ProgressLogger progressLogger = progressLoggerFactory.newOperation(AbstractJettyRunTask.class).start("Start Jetty server", "Starting Jetty");
try {
setServer(createServer());
applyJettyXml();
JettyPluginServer plugin = getServer();
Object[] configuredConnectors = getConnectors();
plugin.setConnectors(configuredConnectors);
Object[] connectors = plugin.getConnectors();
if (connectors == null || connectors.length == 0) {
configuredConnectors = new Object[] { plugin.createDefaultConnector(getHttpPort()) };
plugin.setConnectors(configuredConnectors);
}
//set up a RequestLog if one is provided
if (getRequestLog() != null) {
getServer().setRequestLog(getRequestLog());
}
//set up the webapp and any context provided
getServer().configureHandlers();
configureWebApplication();
getServer().addWebApplication(webAppConfig);
// set up security realms
Object[] configuredRealms = getUserRealms();
for (int i = 0; (configuredRealms != null) && i < configuredRealms.length; i++) {
LOGGER.debug(configuredRealms[i].getClass().getName() + ": " + configuredRealms[i].toString());
}
plugin.setUserRealms(configuredRealms);
//do any other configuration required by the
//particular Jetty version
finishConfigurationBeforeStart();
// start Jetty
server.start();
if (getStopPort() != null && getStopPort() > 0 && getStopKey() != null) {
Monitor monitor = new Monitor(getStopPort(), getStopKey(), (Server) server.getProxiedObject());
monitor.start();
}
if (daemon) {
return;
}
// start the scanner thread (if necessary) on the main webapp
configureScanner();
startScanner();
// start the new line scanner thread if necessary
startConsoleScanner();
} catch (Exception e) {
throw new GradleException("Could not start the Jetty server.", e);
} finally {
progressLogger.completed();
}
progressLogger = progressLoggerFactory.newOperation(AbstractJettyRunTask.class).start("Run Jetty at http://localhost:" + getHttpPort() + "/" + getContextPath(), "Running at http://localhost:" + getHttpPort() + "/" + getContextPath());
try {
// keep the thread going if not in daemon mode
server.join();
} catch (Exception e) {
throw new GradleException("Failed to wait for the Jetty server to stop.", e);
} finally {
progressLogger.completed();
}
}
use of org.gradle.internal.logging.progress.ProgressLogger in project gradle by gradle.
the class DependencyResolutionLogger method beforeResolve.
public void beforeResolve(ResolvableDependencies dependencies) {
LinkedList<ProgressLogger> loggers = progressLoggers.get();
progressLoggers.set(loggers);
ProgressLogger logger = loggerFactory.newOperation(DependencyResolutionLogger.class);
logger.start("Resolve " + dependencies, "Resolving " + dependencies);
loggers.add(logger);
}
use of org.gradle.internal.logging.progress.ProgressLogger in project gradle by gradle.
the class RuntimeShadedJarCreator method create.
public void create(final File outputJar, final Iterable<? extends File> files) {
LOGGER.info("Generating JAR file: " + outputJar.getAbsolutePath());
ProgressLogger progressLogger = progressLoggerFactory.newOperation(RuntimeShadedJarCreator.class);
progressLogger.setDescription("Gradle JARs generation");
progressLogger.setLoggingHeader("Generating JAR file '" + outputJar.getName() + "'");
progressLogger.started();
try {
createFatJar(outputJar, files, progressLogger);
} finally {
progressLogger.completed();
}
}
use of org.gradle.internal.logging.progress.ProgressLogger in project gradle by gradle.
the class AbstractProgressLoggingHandler method startProgress.
private ProgressLogger startProgress(String description, Class loggingClass) {
ProgressLogger progressLogger = progressLoggerFactory.newOperation(loggingClass != null ? loggingClass : getClass());
progressLogger.setDescription(description);
progressLogger.setLoggingHeader(description);
progressLogger.started();
return progressLogger;
}
Aggregations