當前位置: 首頁>>代碼示例>>Java>>正文


Java Project.getTasks方法代碼示例

本文整理匯總了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");
      });
}
 
開發者ID:GoogleCloudPlatform,項目名稱:minikube-build-tools-for-java,代碼行數:18,代碼來源:MinikubePluginTest.java

示例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);
}
 
開發者ID:lxxlxx888,項目名稱:Reer,代碼行數:11,代碼來源:EclipsePlugin.java

示例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");
}
 
開發者ID:GoogleCloudPlatform,項目名稱:minikube-build-tools-for-java,代碼行數:16,代碼來源:MinikubePluginTest.java

示例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());
		}
	}
}
 
開發者ID:crnk-project,項目名稱:crnk-framework,代碼行數:29,代碼來源:TSGeneratorPlugin.java

示例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);
}
 
開發者ID:alibaba,項目名稱:atlas,代碼行數:13,代碼來源:AtlasBaseTaskManager.java


注:本文中的org.gradle.api.Project.getTasks方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。