本文整理了Java中org.gradle.api.artifacts.Configuration.getDescription()
方法的一些代码示例,展示了Configuration.getDescription()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Configuration.getDescription()
方法的具体详情如下:
包路径:org.gradle.api.artifacts.Configuration
类名称:Configuration
方法名:getDescription
暂无
代码示例来源:origin: diffplug/spotless
/**
* Creates a Provisioner for the given repositories.
*
* The first time a project is created, there are ~7 seconds of configuration
* which will go away for all subsequent runs.
*
* Every call to resolve will take about 1 second, even when all artifacts are resolved.
*/
private static Supplier<Provisioner> createLazyWithRepositories(Consumer<RepositoryHandler> repoConfig) {
// Running this takes ~3 seconds the first time it is called. Probably because of classloading.
return Suppliers.memoize(() -> {
Project project = ProjectBuilder.builder().build();
repoConfig.accept(project.getRepositories());
return (withTransitives, mavenCoords) -> {
Dependency[] deps = mavenCoords.stream()
.map(project.getDependencies()::create)
.toArray(Dependency[]::new);
Configuration config = project.getConfigurations().detachedConfiguration(deps);
config.setTransitive(withTransitives);
config.setDescription(mavenCoords.toString());
try {
return config.resolve();
} catch (ResolveException e) {
/* Provide Maven coordinates in exception message instead of static string 'detachedConfiguration' */
throw new ResolveException(config.getDescription(), e);
}
};
});
}
代码示例来源:origin: com.amazon.device.tools.build/gradle-core
private String getDescription(Configuration configuration) {
return GUtil.isTrue(
configuration.getDescription()) ? " - " + configuration.getDescription() : "";
}
代码示例来源:origin: com.android.tools.build/gradle-core
private String getDescription(Configuration configuration) {
return GUtil.isTrue(
configuration.getDescription()) ? " - " + configuration.getDescription() : "";
}
内容来源于网络,如有侵权,请联系作者删除!