本文整理了Java中org.gradle.api.Task.dependsOn()
方法的一些代码示例,展示了Task.dependsOn()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Task.dependsOn()
方法的具体详情如下:
包路径:org.gradle.api.Task
类名称:Task
方法名:dependsOn
暂无
代码示例来源:origin: uber/okbuck
.getTasks()
.create(OKBUCK, OkBuckTask.class, okbuckExt, kotlin, scala, buckFileManager);
rootOkBuckTask.dependsOn(setupOkbuck);
rootOkBuckTask.doLast(
task -> {
.getTasks()
.create(OKBUCK_CLEAN, OkBuckCleanTask.class, okbuckExt.buckProjects);
rootOkBuckTask.dependsOn(okBuckClean);
ProjectCache.resetScopeCache(bp);
});
okbuckProjectTask.dependsOn(setupOkbuck);
okBuckClean.dependsOn(okbuckProjectTask);
});
});
代码示例来源:origin: diffplug/spotless
Task applyTask = project.getTasks().create(taskName + APPLY);
rootCheckTask.dependsOn(checkTask);
rootApplyTask.dependsOn(applyTask);
checkTask.dependsOn(spotlessTask);
applyTask.dependsOn(spotlessTask);
project.getTasks()
.matching(task -> task.getName().equals(JavaBasePlugin.CHECK_TASK_NAME))
.all(task -> task.dependsOn(rootCheckTask));
代码示例来源:origin: com.amazon.device.tools.build/gradle-core
@Override
public void execute(Task task) {
task.dependsOn(other.name);
}
});
代码示例来源:origin: com.amazon.device.tools.build/gradle-core
@Override
public void execute(Task it) {
it.dependsOn(mainProviderTaskName);
}
});
代码示例来源:origin: com.amazon.device.tools.build/gradle-core
@Override
public void execute(Task it) {
it.dependsOn(serverTask);
}
});
代码示例来源:origin: org.shipkit/shipkit
public void execute(Task t) {
t.setDescription("Prepares the working copy for releasing from CI build");
t.dependsOn(UNSHALLOW_TASK, CHECKOUT_TASK, SET_USER_TASK, SET_EMAIL_TASK);
}
});
代码示例来源:origin: gradle.plugin.com.enonic.xp/xp-gradle-plugin
private void createUnpackDevTask( final Project project )
{
final UnpackDevTask task = project.getTasks().create( "unpackDevResources", UnpackDevTask.class );
project.getTasks().getByPath( "processResources" ).dependsOn( task );
}
}
代码示例来源:origin: gradle.plugin.com.enonic.xp/xp-gradle-plugin
private void applyUnpackWebJarTask()
{
final UnpackWebJarTask task = this.project.getTasks().create( "unpackWebJars", UnpackWebJarTask.class );
this.project.getTasks().getByName( "jar" ).dependsOn( task );
}
}
代码示例来源:origin: gradle.plugin.de.chkpnt/truststorebuilder-gradle-plugin
private static void configureDependency(Project project, String taskName, Task dependsOn) {
project.getTasks()
.getByName(taskName)
.dependsOn(dependsOn);
}
代码示例来源:origin: gradle.plugin.com.hg.plugin/objectstore
public final void addGeneratorTask(@NotNull BaseVariant variant, @NotNull Task objectboxTask, @NotNull File targetGenDir) {
boolean writeToBuildFolder = true;
if(writeToBuildFolder) {
variant.registerJavaGeneratingTask(objectboxTask, new File[]{targetGenDir});
} else {
variant.getJavaCompiler().dependsOn(new Object[]{objectboxTask});
}
}
代码示例来源:origin: com.android.tools.build/gradle-core
public void registerResGeneratingTask(@NonNull Task task, @NonNull Collection<File> generatedResFolders) {
// no need add the folders anywhere, the convention mapping closure for the MergeResources
// action will pick them up from here
resourceGenTask.dependsOn(task);
if (extraGeneratedResFolders == null) {
extraGeneratedResFolders = Lists.newArrayList();
}
extraGeneratedResFolders.addAll(generatedResFolders);
}
代码示例来源:origin: gradle.plugin.com.enonic.xp/xp-gradle-plugin
private void createBuildDocTask()
{
final Task task = this.project.getTasks().create( BUILD_DOC_TASK );
task.setGroup( GROUP );
task.setDescription( "Build documentation based on Asciidoctor (alias for " + ASCIIDOCTOR_TASK + ")." );
task.dependsOn( ASCIIDOCTOR_TASK );
}
代码示例来源:origin: com.amazon.device.tools.build/gradle-core
public void registerResGeneratingTask(@NonNull Task task, @NonNull File... generatedResFolders) {
// no need add the folders anywhere, the convention mapping closure for the MergeResources
// action will pick them up from here
resourceGenTask.dependsOn(task);
if (extraGeneratedResFolders == null) {
extraGeneratedResFolders = Lists.newArrayList();
}
Collections.addAll(extraGeneratedResFolders, generatedResFolders);
}
代码示例来源:origin: vojtechhabarta/typescript-generator
@Override
public void apply(Project project) {
final Task generateTsTask = project.task(Collections.singletonMap(Task.TASK_TYPE, GenerateTask.class), "generateTypeScript");
for (Task task : project.getTasks()) {
if (task.getName().startsWith("compile")) {
generateTsTask.dependsOn(task.getName());
}
}
}
代码示例来源:origin: gradle.plugin.org.shipkit/shipkit
public void execute(final Task t) {
t.setDescription("Performs " + SOFT_RESET_COMMIT_TASK + " and " + GIT_STASH_TASK + " tasks.");
t.dependsOn(SOFT_RESET_COMMIT_TASK, GIT_STASH_TASK);
t.mustRunAfter(performPush);
}
});
代码示例来源:origin: gradle.plugin.com.liferay/gradle-plugins-node
private void _configureTaskNpmRunTestForLifecycleBasePlugin(
ExecuteNpmTask executeNpmTask) {
Task checkTask = GradleUtil.getTask(
executeNpmTask.getProject(), LifecycleBasePlugin.CHECK_TASK_NAME);
checkTask.dependsOn(executeNpmTask);
}
代码示例来源:origin: gradle.plugin.org.shipkit/shipkit
@Override
public void execute(InitConfigFileTask t) {
t.setDescription("Creates Shipkit configuration file unless it already exists");
t.setConfigFile(configFile);
project.getTasks().getByName(InitPlugin.INIT_SHIPKIT_TASK).dependsOn(t);
}
});
代码示例来源:origin: linkedin/pygradle
@Override
public void applyTo(Project project) {
project.getPlugins().apply(PythonPexDistributionPlugin.class);
ExtensionUtils.maybeCreateCliExtension(project);
GenerateCompletionsTask completionsTask = project.getTasks().create(TASK_GENERATE_COMPLETIONS, GenerateCompletionsTask.class);
completionsTask.dependsOn(project.getTasks().getByName(StandardTextValues.TASK_INSTALL_PROJECT.getValue()));
project.getTasks().getByName(PythonPexDistributionPlugin.TASK_BUILD_PEX).dependsOn(project.getTasks().getByName(TASK_GENERATE_COMPLETIONS));
}
代码示例来源:origin: gradle.plugin.me.seeber.gradle/gradle-project-config
/**
* Make task 'cleanEclipse' depend on 'cleanEclipseUi'
*
* @param cleanEclipse Eclipse clean task
* @param cleanEclipseUi Eclipse UI clean task
*/
@Mutate
public void configureCleanEclipseTask(@org.gradle.model.Path("tasks.cleanEclipse") Task cleanEclipse,
@org.gradle.model.Path("tasks.cleanEclipseUi") Task cleanEclipseUi) {
cleanEclipse.dependsOn(cleanEclipseUi);
}
代码示例来源:origin: gradle.plugin.org.gosu-lang.gosu/gradle-gosu-plugin
private void configureGosuCompile(JavaBasePlugin javaPlugin, SourceSet sourceSet, GosuSourceSet gosuSourceSet) {
String compileTaskName = sourceSet.getCompileTaskName("gosu");
GosuCompile gosuCompile = _project.getTasks().create(compileTaskName, GosuCompile.class);
javaPlugin.configureForSourceSet(sourceSet, gosuCompile);
gosuCompile.dependsOn(sourceSet.getCompileJavaTaskName());
gosuCompile.setDescription("Compiles the " + sourceSet.getName() + " Gosu source");
gosuCompile.setSource(gosuSourceSet.getGosu());
gosuCompile.setSourceRoots(gosuSourceSet.getGosu().getSrcDirs());
_project.getTasks().getByName(sourceSet.getClassesTaskName()).dependsOn(compileTaskName);
}
内容来源于网络,如有侵权,请联系作者删除!