本文整理匯總了Java中org.gradle.api.Project.getTasks方法的典型用法代碼示例。如果您正苦於以下問題:Java Project.getTasks方法的具體用法?Java Project.getTasks怎麽用?Java Project.getTasks使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.gradle.api.Project
的用法示例。
在下文中一共展示了Project.getTasks方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: testMinikubeExtensionSetProperties
import org.gradle.api.Project; //導入方法依賴的package包/類
@Test
public void testMinikubeExtensionSetProperties() {
Project project = ProjectBuilder.builder().withProjectDir(tmp.getRoot()).build();
project.getPluginManager().apply(MinikubePlugin.class);
MinikubeExtension ex = (MinikubeExtension) project.getExtensions().getByName("minikube");
ex.setMinikube("/custom/minikube/path");
TaskContainer t = project.getTasks();
TaskCollection<MinikubeTask> tc = t.withType(MinikubeTask.class);
Assert.assertEquals(3, tc.size());
tc.forEach(
minikubeTask -> {
Assert.assertEquals(minikubeTask.getMinikube(), "/custom/minikube/path");
});
}
示例2: maybeAddTask
import org.gradle.api.Project; //導入方法依賴的package包/類
private static <T extends Task> void maybeAddTask(Project project, IdePlugin plugin, String taskName, Class<T> taskType, Action<T> action) {
TaskContainer tasks = project.getTasks();
if (tasks.findByName(taskName) != null) {
return;
}
T task = tasks.create(taskName, taskType);
action.execute(task);
plugin.addWorker(task);
}
示例3: testDefaultMinikubeTasks
import org.gradle.api.Project; //導入方法依賴的package包/類
@Test
public void testDefaultMinikubeTasks() {
Project project = ProjectBuilder.builder().withProjectDir(tmp.getRoot()).build();
project.getPluginManager().apply(MinikubePlugin.class);
((ProjectInternal) project).evaluate();
TaskContainer t = project.getTasks();
TaskCollection<MinikubeTask> tc = t.withType(MinikubeTask.class);
Assert.assertEquals(3, tc.size());
AssertMinikubeTaskConfig(tc, "minikubeStart", "start");
AssertMinikubeTaskConfig(tc, "minikubeStop", "stop");
AssertMinikubeTaskConfig(tc, "minikubeDelete", "delete");
}
示例4: setupRuntimeDependencies
import org.gradle.api.Project; //導入方法依賴的package包/類
private void setupRuntimeDependencies(Project project, Task generateTask) {
TSGeneratorConfig config = project.getExtensions().getByType(TSGeneratorConfig.class);
String runtimeConfiguration = config.getRuntime().getConfiguration();
if (runtimeConfiguration != null) {
String runtimeConfigurationFirstUpper =
Character.toUpperCase(runtimeConfiguration.charAt(0)) + runtimeConfiguration.substring(1);
// make sure applications is compiled in order to startup and extract meta information
String processResourcesName = "process" + runtimeConfigurationFirstUpper + "Resources";
String compileJavaName = "compile" + runtimeConfigurationFirstUpper + "Java";
TaskContainer tasks = project.getTasks();
Task processResourceTask = tasks.findByName(processResourcesName);
Task compileJavaTask = tasks.findByName(compileJavaName);
if (processResourceTask != null) {
generateTask.dependsOn(processResourceTask);
}
if (compileJavaTask != null) {
generateTask.dependsOn(compileJavaTask, compileJavaTask);
}
// setup up-to-date checking
Configuration compileConfiguration = project.getConfigurations().findByName(runtimeConfiguration);
if (compileConfiguration != null) {
generateTask.getInputs().file(compileConfiguration.getFiles());
generateTask.getOutputs().dir(config.getGenDir());
}
}
}
示例5: AtlasBaseTaskManager
import org.gradle.api.Project; //導入方法依賴的package包/類
public AtlasBaseTaskManager(AtlasBuilder androidBuilder, T androidExtension, Project project,
AtlasExtension atlasExtension) {
this.tAndroidBuilder = androidBuilder;
this.androidExtension = androidExtension;
this.project = project;
this.tasks = new TaskContainerAdaptor(project.getTasks());
this.atlasExtension = atlasExtension;
this.extraModelInfo = new ExtraModelInfo(project);
this.logger = new LoggerWrapper(Logging.getLogger(AtlasBaseTaskManager.class));
//this.dependencyManager = new DependencyManager(androidExtension, project, atlasExtension);
}