use of org.gradle.internal.logging.progress.ProgressLogger in project gradle by gradle.
the class ProjectEvaluationLogger method beforeEvaluate.
@Override
public void beforeEvaluate(Project project) {
// --configuration-on-demand can sometimes cause projects to be configured after execution phase has started
// see ConfigurationOnDemandIntegrationTest
final String projectPath = project.getPath().equals(":") ? "root project" : project.getPath();
ProgressLogger currentTask = progressLoggerFactory.newOperation(ProjectEvaluationLogger.class).start("Configuring ".concat(projectPath), projectPath);
currentProjects.put(project.getPath(), currentTask);
}
use of org.gradle.internal.logging.progress.ProgressLogger in project gradle by gradle.
the class TaskExecutionLogger method beforeExecute.
public void beforeExecute(Task task) {
assert !currentTasks.containsKey(task);
ProgressLogger currentTask = progressLoggerFactory.newOperation(TaskExecutionLogger.class, parentLoggerProvider.getLogger());
String displayName = getDisplayName((TaskInternal) task);
currentTask.setDescription("Execute ".concat(displayName));
currentTask.setShortDescription(displayName);
currentTask.setLoggingHeader(displayName);
currentTask.started();
currentTasks.put(task, currentTask);
}
use of org.gradle.internal.logging.progress.ProgressLogger in project gradle by gradle.
the class CompareGradleBuilds method compare.
@SuppressWarnings("UnusedDeclaration")
@TaskAction
void compare() {
GradleBuildInvocationSpec sourceBuild = getSourceBuild();
GradleBuildInvocationSpec targetBuild = getTargetBuild();
if (sourceBuild.equals(targetBuild)) {
getLogger().warn("The source build and target build are identical. Set '{}.targetBuild.gradleVersion' if you want to compare with a different Gradle version.", getName());
}
ComparableGradleBuildExecuter sourceBuildExecuter = new ComparableGradleBuildExecuter(sourceBuild);
ComparableGradleBuildExecuter targetBuildExecuter = new ComparableGradleBuildExecuter(targetBuild);
Logger logger = getLogger();
ProgressLogger progressLogger = getProgressLoggerFactory().newOperation(getClass());
progressLogger.setDescription("Gradle Build Comparison");
progressLogger.setShortDescription(getName());
GradleBuildComparison comparison = new GradleBuildComparison(sourceBuildExecuter, targetBuildExecuter, logger, progressLogger, getProject().getGradle());
comparison.registerType(GeneratedArchiveBuildOutcome.class, new GeneratedArchiveBuildOutcomeComparator(), new GeneratedArchiveBuildOutcomeComparisonResultHtmlRenderer(), new GeneratedArchiveBuildOutcomeHtmlRenderer());
comparison.registerType(UnknownBuildOutcome.class, new UnknownBuildOutcomeComparator(), new UnknownBuildOutcomeComparisonResultHtmlRenderer(), new UnknownBuildOutcomeHtmlRenderer());
File fileStoreTmpBase = getFileResolver().resolve(String.format(TMP_FILESTORAGE_PREFIX + "-%s-%s", getName(), System.currentTimeMillis()));
FileStore<String> fileStore = new PathNormalisingKeyFileStore(fileStoreTmpBase);
Map<String, String> hostAttributes = new LinkedHashMap<String, String>(4);
hostAttributes.put("Project", getProject().getRootDir().getAbsolutePath());
hostAttributes.put("Task", getPath());
hostAttributes.put("Gradle version", GradleVersion.current().getVersion());
hostAttributes.put("Executed at", new SimpleDateFormat().format(new Date()));
BuildComparisonResult result = comparison.compare(fileStore, getReportDir(), hostAttributes);
communicateResult(result);
}
use of org.gradle.internal.logging.progress.ProgressLogger in project gradle by gradle.
the class TaskExecutionLogger method afterExecute.
public void afterExecute(Task task, TaskState state) {
ProgressLogger currentTask = currentTasks.remove(task);
String taskMessage = state.getFailure() != null ? "FAILED" : state.getSkipMessage();
currentTask.completed(taskMessage);
}
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);
}
Aggregations