本文整理了Java中org.gradle.api.Project.getLogger()
方法的一些代码示例,展示了Project.getLogger()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Project.getLogger()
方法的具体详情如下:
包路径:org.gradle.api.Project
类名称:Project
方法名:getLogger
暂无
代码示例来源:origin: f2prateek/dart
public HensonManager(Project project) {
this.project = project;
this.logger = project.getLogger();
this.taskManager = new TaskManager(project, logger);
this.dependencyManager = new DependencyManager(project, logger);
this.hensonExtension = (HensonPluginExtension) project.getExtensions().getByName("henson");
}
代码示例来源:origin: hibernate/hibernate-orm
public void apply(Project project) {
project.getPlugins().apply( "java" );
final HibernateExtension hibernateExtension = new HibernateExtension( project );
project.getLogger().debug( "Adding Hibernate extensions to the build [{}]", project.getName() );
project.getExtensions().add( "hibernate", hibernateExtension );
project.afterEvaluate(
new Action<Project>() {
@Override
public void execute(Project project) {
if ( hibernateExtension.enhance != null ) {
applyEnhancement( project, hibernateExtension );
}
}
}
);
}
代码示例来源:origin: hibernate/hibernate-orm
private void applyEnhancement(final Project project, final HibernateExtension hibernateExtension) {
if ( !hibernateExtension.enhance.shouldApply() ) {
project.getLogger().warn( "Skipping Hibernate bytecode enhancement since no feature is enabled" );
return;
project.getLogger().debug( "Applying Hibernate enhancement action to SourceSet.{}", sourceSet.getName() );
代码示例来源:origin: hibernate/hibernate-orm
@Override
public void execute(Task task) {
project.getLogger().debug( "Starting Hibernate enhancement on SourceSet.{}", sourceSet.getName() );
代码示例来源:origin: diffplug/spotless
/** Makes it possible to remove a format which was created earlier. */
public void removeFormat(String name) {
requireNonNull(name);
FormatExtension toRemove = formats.remove(name);
if (toRemove == null) {
project.getLogger().warn("Called removeFormat('" + name + "') but there was no such format.");
}
}
代码示例来源:origin: diffplug/spotless
private void fixParserToTypescript() {
if (this.prettierConfig == null) {
this.prettierConfig = Collections.singletonMap("parser", "typescript");
} else {
final Object replaced = this.prettierConfig.put("parser", "typescript");
if (replaced != null) {
getProject().getLogger().warn("overriding parser option to 'typescript'. Was set to '{}'", replaced);
}
}
}
}
代码示例来源:origin: diffplug/spotless
/** Use {@link #eclipse(String)} instead */
@Deprecated
public void eclipseFormatFile(String eclipseVersion, Object eclipseFormatFile) {
Objects.requireNonNull(eclipseVersion, "eclipseVersion");
Objects.requireNonNull(eclipseFormatFile, "eclipseFormatFile");
getProject().getLogger().warn(
StringPrinter.buildStringFromLines(
"'eclipseFormatFile [version] <file>' is deprecated.",
"Use 'eclipse([version]).configFile(<file>)' instead.",
"For details see https://github.com/diffplug/spotless/tree/master/plugin-gradle#applying-to-java-source"));
eclipse(eclipseVersion).configFile(eclipseFormatFile);
}
代码示例来源:origin: diffplug/spotless
/** Method interface has been changed to
* {@link GroovyExtension#importOrder(String...)}.*/
@Deprecated
public void importOrder(List<String> importOrder) {
getProject().getLogger().warn(
StringPrinter.buildStringFromLines(
"'importOrder([x, y, z])' is deprecated.",
"Use 'importOrder x, y, z' instead.",
"For details see https://github.com/diffplug/spotless/tree/master/plugin-gradle#applying-to-java-source"));
importOrder(importOrder.toArray(new String[0]));
}
代码示例来源:origin: diffplug/spotless
/** Method interface has been changed to
* {@link JavaExtension#importOrder(String...)}.*/
@Deprecated
public void importOrder(List<String> importOrder) {
getProject().getLogger().warn(
StringPrinter.buildStringFromLines(
"'importOrder([x, y, z])' is deprecated.",
"Use 'importOrder x, y, z' instead.",
"For details see https://github.com/diffplug/spotless/tree/master/plugin-gradle#applying-to-java-source"));
addStep(ImportOrderStep.createFromOrder(importOrder));
}
代码示例来源:origin: gradle.plugin.org.shoebox/gradle-haxe
public static void warn(String value)
{
project.getLogger().log(LogLevel.WARN, value);
}
}
代码示例来源:origin: javafxports/javafxmobile-plugin
public IosExtension(Project project) {
this.project = project;
installDirectory = new File(project.getBuildDir(), "javafxports/ios");
project.getLogger().info("iOS install directory: " + installDirectory);
temporaryDirectory = new File(project.getBuildDir(), "javafxports/tmp/ios");
project.getLogger().info("iOS temporary output directory: " + temporaryDirectory);
}
代码示例来源:origin: de.carne.common/java-gradle-plugins
private String write(String format, Object... args) {
String message = String.format(format, args);
this.project.getLogger().warn(message);
return message;
}
代码示例来源:origin: zeroturnaround/gradle-jrebel-plugin
public void apply(final Project project) {
log = new LoggerWrapper(project.getLogger());
// register the Rebel task
project.getTasks().create(GENERATE_REBEL_TASK_NAME, RebelGenerateTask.class).setDescription("Generate rebel.xml mappings file to use this project with JRebel.");
// only configure the real one if JavaPlugin gets enabled (it is pulled in by Groovy, Scala, War, ...)
project.getLogger().info("Registering deferred Rebel plugin configuration...");
project.getPlugins().withType(JavaPlugin.class).all(new Action<Plugin>() {
public void execute(Plugin p) {
configure(project);
}
});
}
代码示例来源:origin: de.carne.common/java-gradle-plugins
private void checkPrerequisites(Project project) {
try {
project.getPlugins().getPlugin("java");
} catch (UnknownPluginException e) {
String message = "Unable to apply plugin " + JAVA_TOOLS_PLUGIN_NAME
+ "; please apply java or java-library plugin first";
project.getLogger().error(message);
throw new GradleException(message, e);
}
}
代码示例来源:origin: linkedin/pygradle
public static boolean isPlainOrVerbose(Project project) {
return project.getLogger().isInfoEnabled() || System.getenv("TERM") == null
|| project.getGradle().getStartParameter().getConsoleOutput() == ConsoleOutput.Plain;
}
代码示例来源:origin: palantir/sls-packaging
private void validateProjectVersion() {
String stringVersion = getProjectVersion();
Preconditions.checkArgument(SlsVersion.check(stringVersion),
"Project version must be a valid SLS version: %s", stringVersion);
if (!OrderableSlsVersion.check(stringVersion)) {
getProject().getLogger().warn(
"Version string in project {} is not orderable as per SLS specification: {}",
getProject().getName(), stringVersion);
}
}
代码示例来源:origin: GoogleContainerTools/minikube-build-tools-for-java
@Override
public void apply(Project project) {
this.project = project;
CommandExecutorFactory commandExecutorFactory = new CommandExecutorFactory(project.getLogger());
createMinikubeExtension(commandExecutorFactory);
configureMinikubeTaskAdditionCallback(commandExecutorFactory);
createMinikubeStartTask();
createMinikubeStopTask();
createMinikubeDeleteTask();
}
代码示例来源:origin: classmethod/gradle-aws-plugin
public String getAccountId() {
try {
AWSSecurityTokenService sts = createClient(AWSSecurityTokenServiceClient.class, profileName);
sts.setRegion(getActiveRegion(region));
return sts.getCallerIdentity(new GetCallerIdentityRequest()).getAccount();
} catch (SdkClientException e) {
project.getLogger().lifecycle("AWS credentials not configured!");
return null;
}
}
代码示例来源:origin: palantir/gradle-baseline
@Override
public void apply(Project project) {
if (project != project.getRootProject()) {
project.getLogger().warn(
"com.palantir.baseline-circleci should be applied to the root project only, not '{}'",
project.getName());
}
// the `./gradlew resolveConfigurations` task is used on CI to download all jars for convenient caching
project.getRootProject().allprojects(p -> p.getPluginManager().apply(ConfigurationResolverPlugin.class));
configurePluginsForReports(project);
configurePluginsForArtifacts(project);
}
代码示例来源:origin: de.carne.common/java-gradle-plugins
@Override
public void afterEvaluate(Project project) {
GenerateI18N generateI18N = project.getExtensions().getByType(JavaToolsExtension.class).getGenerateI18N();
setEnabled(generateI18N.isEnabled());
getInputs().files(generateI18N.getBundles());
getOutputs().dir(generateI18N.getGenDir());
processBundleFiles(generateI18N.getBundles(), (srcDir, bundleFile) -> {
File javaFile = getAbsoluteFile(generateI18N.getGenDir(), getJavaFile(bundleFile));
project.getLogger().info("{} output file {}", GENERATE_I18N_TASK_NAME, javaFile);
getOutputs().file(javaFile);
});
}
内容来源于网络,如有侵权,请联系作者删除!