本文整理汇总了Java中org.gradle.logging.ProgressLogger.setDescription方法的典型用法代码示例。如果您正苦于以下问题:Java ProgressLogger.setDescription方法的具体用法?Java ProgressLogger.setDescription怎么用?Java ProgressLogger.setDescription使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.gradle.logging.ProgressLogger
的用法示例。
在下文中一共展示了ProgressLogger.setDescription方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: create
import org.gradle.logging.ProgressLogger; //导入方法依赖的package包/类
public ConsumerConnection create(Distribution distribution, ProgressLoggerFactory progressLoggerFactory, ConnectionParameters connectionParameters, BuildCancellationToken cancellationToken) {
if (lock.tryLock()) {
try {
return delegate.create(distribution, progressLoggerFactory, connectionParameters, cancellationToken);
} finally {
lock.unlock();
}
}
ProgressLogger logger = progressLoggerFactory.newOperation(SynchronizedToolingImplementationLoader.class);
logger.setDescription("Wait for the other thread to finish acquiring the distribution");
logger.started();
lock.lock();
try {
return delegate.create(distribution, progressLoggerFactory, connectionParameters, cancellationToken);
} finally {
lock.unlock();
logger.completed();
}
}
示例2: run
import org.gradle.logging.ProgressLogger; //导入方法依赖的package包/类
public <T> T run(ConsumerAction<T> action) throws UnsupportedOperationException, IllegalStateException {
ConsumerOperationParameters parameters = action.getParameters();
ProgressListenerAdapter listener = new ProgressListenerAdapter(parameters.getProgressListener());
ListenerManager listenerManager = loggingProvider.getListenerManager();
listenerManager.addListener(listener);
try {
ProgressLogger progressLogger = loggingProvider.getProgressLoggerFactory().newOperation(ProgressLoggingConsumerActionExecutor.class);
progressLogger.setDescription("Build");
progressLogger.started();
try {
return actionExecutor.run(action);
} finally {
progressLogger.completed();
}
} finally {
listenerManager.removeListener(listener);
}
}
示例3: create
import org.gradle.logging.ProgressLogger; //导入方法依赖的package包/类
public ConsumerConnection create(Distribution distribution, ProgressLoggerFactory progressLoggerFactory, ConnectionParameters connectionParameters) {
if (lock.tryLock()) {
try {
return delegate.create(distribution, progressLoggerFactory, connectionParameters);
} finally {
lock.unlock();
}
}
ProgressLogger logger = progressLoggerFactory.newOperation(SynchronizedToolingImplementationLoader.class);
logger.setDescription("Wait for the other thread to finish acquiring the distribution");
logger.started();
lock.lock();
try {
return delegate.create(distribution, progressLoggerFactory, connectionParameters);
} finally {
lock.unlock();
logger.completed();
}
}
示例4: download
import org.gradle.logging.ProgressLogger; //导入方法依赖的package包/类
public void download(URI address, File destination) throws Exception {
ProgressLogger progressLogger = progressLoggerFactory.newOperation(DistributionFactory.class);
progressLogger.setDescription(String.format("Download %s", address));
progressLogger.started();
try {
new Download(new Logger(false), "Gradle Tooling API", GradleVersion.current().getVersion()).download(address, destination);
} finally {
progressLogger.completed();
}
}
示例5: getToolingImplementationClasspath
import org.gradle.logging.ProgressLogger; //导入方法依赖的package包/类
public ClassPath getToolingImplementationClasspath(ProgressLoggerFactory progressLoggerFactory,
File userHomeDir,
BuildCancellationToken cancellationToken) {
ProgressLogger progressLogger = progressLoggerFactory.newOperation(DistributionFactory.class);
progressLogger.setDescription("Validate distribution");
progressLogger.started();
try {
return getToolingImpl();
}
finally {
progressLogger.completed();
}
}
示例6: startProgress
import org.gradle.logging.ProgressLogger; //导入方法依赖的package包/类
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;
}
示例7: download
import org.gradle.logging.ProgressLogger; //导入方法依赖的package包/类
public void download(URI address, File destination) throws Exception {
ProgressLogger progressLogger = progressLoggerFactory.newOperation(DistributionFactory.class);
progressLogger.setDescription(String.format("Download %s", address));
progressLogger.started();
try {
new Download("Gradle Tooling API", GradleVersion.current().getVersion()).download(address, destination);
} finally {
progressLogger.completed();
}
}
示例8: getToolingImplementationClasspath
import org.gradle.logging.ProgressLogger; //导入方法依赖的package包/类
public ClassPath getToolingImplementationClasspath(ProgressLoggerFactory progressLoggerFactory, File userHomeDir, BuildCancellationToken cancellationToken) {
ProgressLogger progressLogger = progressLoggerFactory.newOperation(DistributionFactory.class);
progressLogger.setDescription("Validate distribution");
progressLogger.started();
try {
return getToolingImpl();
} finally {
progressLogger.completed();
}
}
示例9: getToolingImplementationClasspath
import org.gradle.logging.ProgressLogger; //导入方法依赖的package包/类
public ClassPath getToolingImplementationClasspath(ProgressLoggerFactory progressLoggerFactory, File userHomeDir) {
ProgressLogger progressLogger = progressLoggerFactory.newOperation(DistributionFactory.class);
progressLogger.setDescription("Validate distribution");
progressLogger.started();
try {
return getToolingImpl();
} finally {
progressLogger.completed();
}
}
示例10: compare
import org.gradle.logging.ProgressLogger; //导入方法依赖的package包/类
@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);
}
示例11: compare
import org.gradle.logging.ProgressLogger; //导入方法依赖的package包/类
@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 = progressLoggerFactory.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 = fileResolver.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);
}