use of org.gradle.internal.time.TrueTimeProvider in project gradle by gradle.
the class SynchronizedLogging method services.
private ThreadLoggingServices services() {
ThreadLoggingServices threadServices = services.get();
if (threadServices == null) {
DefaultListenerManager manager = new DefaultListenerManager();
DefaultProgressLoggerFactory progressLoggerFactory = new DefaultProgressLoggerFactory(manager.getBroadcaster(ProgressListener.class), new TrueTimeProvider());
threadServices = new ThreadLoggingServices(manager, progressLoggerFactory);
services.set(threadServices);
}
return threadServices;
}
use of org.gradle.internal.time.TrueTimeProvider in project gradle by gradle.
the class DefaultTestExecuter method execute.
@Override
public void execute(final Test testTask, TestResultProcessor testResultProcessor) {
final TestFramework testFramework = testTask.getTestFramework();
final WorkerTestClassProcessorFactory testInstanceFactory = testFramework.getProcessorFactory();
final BuildOperationWorkerRegistry.Operation currentOperation = buildOperationWorkerRegistry.getCurrent();
final Set<File> classpath = ImmutableSet.copyOf(testTask.getClasspath());
final Factory<TestClassProcessor> forkingProcessorFactory = new Factory<TestClassProcessor>() {
public TestClassProcessor create() {
return new ForkingTestClassProcessor(workerFactory, testInstanceFactory, testTask, classpath, testFramework.getWorkerConfigurationAction(), moduleRegistry, currentOperation);
}
};
Factory<TestClassProcessor> reforkingProcessorFactory = new Factory<TestClassProcessor>() {
public TestClassProcessor create() {
return new RestartEveryNTestClassProcessor(forkingProcessorFactory, testTask.getForkEvery());
}
};
TestClassProcessor processor = new MaxNParallelTestClassProcessor(getMaxParallelForks(testTask), reforkingProcessorFactory, actorFactory);
final FileTree testClassFiles = testTask.getCandidateClassFiles();
Runnable detector;
if (testTask.isScanForTestClasses()) {
TestFrameworkDetector testFrameworkDetector = testTask.getTestFramework().getDetector();
testFrameworkDetector.setTestClassesDirectory(testTask.getTestClassesDir());
testFrameworkDetector.setTestClasspath(classpath);
detector = new DefaultTestClassScanner(testClassFiles, testFrameworkDetector, processor);
} else {
detector = new DefaultTestClassScanner(testClassFiles, null, processor);
}
final Object testTaskOperationId = buildOperationExecutor.getCurrentOperation().getParentId();
new TestMainAction(detector, processor, testResultProcessor, new TrueTimeProvider(), testTaskOperationId, testTask.getPath(), "Gradle Test Run " + testTask.getIdentityPath()).run();
}
use of org.gradle.internal.time.TrueTimeProvider in project gradle by gradle.
the class OutputEventRenderer method addConsole.
public OutputEventRenderer addConsole(Console console, boolean stdout, boolean stderr, ConsoleMetaData consoleMetaData) {
final OutputEventListener consoleChain = new ThrottlingOutputEventListener(new BuildStatusRenderer(new WorkInProgressRenderer(new ProgressLogEventGenerator(new StyledTextOutputBackedRenderer(console.getBuildOutputArea()), true), console.getBuildProgressArea(), new DefaultWorkInProgressFormatter(consoleMetaData)), console.getStatusBar(), console, consoleMetaData), new TrueTimeProvider());
synchronized (lock) {
if (stdout && stderr) {
this.console = consoleChain;
removeStandardOutputListener();
removeStandardErrorListener();
} else if (stdout) {
this.console = onNonError(consoleChain);
removeStandardOutputListener();
} else {
this.console = onError(consoleChain);
removeStandardErrorListener();
}
consoleChain.onOutput(new LogLevelChangeEvent(logLevel));
formatters.add(this.console);
}
return this;
}
Aggregations