本文整理了Java中org.gradle.api.Task.doFirst()
方法的一些代码示例,展示了Task.doFirst()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Task.doFirst()
方法的具体详情如下:
包路径:org.gradle.api.Task
类名称:Task
方法名:doFirst
暂无
代码示例来源:origin: uber/okbuck
.maybeCreate(cacheName + "ExtraDepCache")));
setupOkbuck.doFirst(
task -> {
if (System.getProperty("okbuck.wrapper", "false").equals("false")) {
代码示例来源:origin: palantir/gradle-circle-style
public static <T extends Task & Reporting<? extends ReportContainer<SingleFileReport>>>
XmlReportFailuresSupplier create(final T task, final ReportHandler<T> reportHandler) {
// Ensure any necessary output is enabled
task.doFirst(new Action<Task>() {
@Override
public void execute(Task ignored) {
reportHandler.configureTask(task);
}
});
return new XmlReportFailuresSupplier(task, reportHandler);
}
代码示例来源:origin: com.palantir.baseline/gradle-circle-style
public static <T extends Task & Reporting<? extends ReportContainer<SingleFileReport>>>
XmlReportFailuresSupplier create(final T task, final ReportHandler<T> reportHandler) {
// Ensure any necessary output is enabled
task.doFirst(ignored -> reportHandler.configureTask(task));
return new XmlReportFailuresSupplier(task, reportHandler);
}
代码示例来源:origin: palantir/gradle-baseline
public static <T extends Task & Reporting<? extends ReportContainer<SingleFileReport>>>
XmlReportFailuresSupplier create(final T task, final ReportHandler<T> reportHandler) {
// Ensure any necessary output is enabled
task.doFirst(ignored -> reportHandler.configureTask(task));
return new XmlReportFailuresSupplier(task, reportHandler);
}
代码示例来源:origin: com.amazon.device.tools.build/gradle-core
@Override
public void execute(Task lintCompile) {
final File outputDir =
new File(getGlobalScope().getIntermediatesDir(), "lint");
lintCompile.doFirst(new Action<Task>() {
@Override
public void execute(Task task) {
// create the directory for lint output if it does not exist.
if (!outputDir.exists()) {
boolean mkdirs = outputDir.mkdirs();
if (!mkdirs) {
throw new GradleException(
"Unable to create lint output directory.");
}
}
}
});
}
});
代码示例来源:origin: gradle.plugin.com.sedmelluq/mass-relocator
@Override
public void apply(Project target) {
Task shadowTask = target.getTasks().getByName(ShadowJavaPlugin.getSHADOW_JAR_TASK_NAME());
if (shadowTask instanceof ShadowJar) {
shadowTask.doFirst(shadowJar -> processShadowJar((ShadowJar) shadowJar));
}
target.getExtensions().add("massRelocator", new ShadowMassRelocatorExtension());
}
代码示例来源:origin: gradle.plugin.com.xiaoquan.gradle.plugin/support-plugin
private void configEnv(Project project) {
Task jar = project.getTasks().getByName("jar");
Copy copy = project.getTasks().create("copy", Copy.class);
copy.into(project.getBuildDir() + "/classes/java/main");
// copy.from("/home/xiaoquan/idea-workspace/support-plugin/.idea/misc.xml");
// copy.into("/home/xiaoquan/tmp/gradle_tmp");
Action<Task> taskAction = (t) -> {
NukeEnvExtension nukeEnvExtension = (NukeEnvExtension) project.getExtensions().getByName(Nuke_Ext_Name);
EnvDomain qa = nukeEnvExtension.getQa();
if (qa.getConfigDir() != null) {
String configDir = qa.getConfigDir();
copy.from(configDir);
}
copy.exclude(qa.getExclude());
copy.execute();
};
jar.doFirst(taskAction);
}
代码示例来源:origin: diffplug/goomph
ideSetupP2.doFirst(unused -> {
Errors.rethrow().run(extension::ideSetupP2);
});
ideSetupWorkspace.doFirst(unused -> {
Errors.rethrow().run(extension::ideSetupWorkspace);
});
ide.doFirst(unused -> {
Errors.rethrow().run(extension::ide);
});
ideClean.doFirst(unused -> {
extension.ideClean();
});
代码示例来源:origin: gradle.plugin.org.hibernate.build/database-profile-plugin
profileTestTask.doFirst(
task -> profileResolver.injectSelectedProfile( name )
);
profileResourcesTask.dependsOn( resourcesTask );
profileResourcesTask.finalizedBy( applyTask );
profileResourcesTask.doFirst(
task -> {
profileResolver.injectSelectedProfile( name );
代码示例来源:origin: MinecraftForge/ForgeGradle
project.getTasks().getByName("ideaModule").dependsOn(TASK_DD_COMPILE, TASK_DD_PROVIDED).doFirst(makeRunDir);
task.doFirst(makeRunDir);
task.doLast(new Action<Task>() {
@Override
内容来源于网络,如有侵权,请联系作者删除!