本文整理汇总了Java中org.gradle.testkit.runner.BuildTask类的典型用法代码示例。如果您正苦于以下问题:Java BuildTask类的具体用法?Java BuildTask怎么用?Java BuildTask使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BuildTask类属于org.gradle.testkit.runner包,在下文中一共展示了BuildTask类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: executeGradleRunner
import org.gradle.testkit.runner.BuildTask; //导入依赖的package包/类
public static BuildTask executeGradleRunner(
File projectDir, String... taskPath) {
GradleRunner runner = GradleRunner.create().withProjectDir(projectDir);
GradleRunner runnerWithArguments = runner.withArguments(taskPath);
BuildResult buildResult = runnerWithArguments.build();
BuildTask buildtask = null;
for (BuildTask task : buildResult.getTasks()) {
if (task.getPath().endsWith(taskPath[taskPath.length - 1])) {
buildtask = task;
break;
}
}
return buildtask;
}
开发者ID:liferay,项目名称:liferay-blade-samples,代码行数:21,代码来源:GradleRunnerUtil.java
示例2: tasks
import org.gradle.testkit.runner.BuildTask; //导入依赖的package包/类
@Override
public List<BuildTask> tasks(final TaskOutcome outcome) {
return Collections.unmodifiableList(CollectionUtils.filter(tasks, new Spec<BuildTask>() {
public boolean isSatisfiedBy(BuildTask element) {
return element.getOutcome() == outcome;
}
}));
}
开发者ID:lxxlxx888,项目名称:Reer,代码行数:9,代码来源:DefaultBuildResult.java
示例3: taskPaths
import org.gradle.testkit.runner.BuildTask; //导入依赖的package包/类
@Override
public List<String> taskPaths(TaskOutcome outcome) {
return Collections.unmodifiableList(CollectionUtils.collect(tasks(outcome), new Transformer<String, BuildTask>() {
public String transform(BuildTask buildTask) {
return buildTask.getPath();
}
}));
}
开发者ID:lxxlxx888,项目名称:Reer,代码行数:9,代码来源:DefaultBuildResult.java
示例4: determineBuildTask
import org.gradle.testkit.runner.BuildTask; //导入依赖的package包/类
private BuildTask determineBuildTask(TaskOperationResult result, String taskPath) {
if (isFailed(result)) {
return createBuildTask(taskPath, FAILED);
} else if (isSkipped(result)) {
return createBuildTask(taskPath, SKIPPED);
} else if (isFromCache(result)) {
return createBuildTask(taskPath, FROM_CACHE);
} else if (isUpToDate(result)) {
return createBuildTask(taskPath, UP_TO_DATE);
}
return createBuildTask(taskPath, SUCCESS);
}
开发者ID:lxxlxx888,项目名称:Reer,代码行数:14,代码来源:ToolingApiGradleExecutor.java
示例5: extractTasks
import org.gradle.testkit.runner.BuildTask; //导入依赖的package包/类
/** Extract task as a list of path strings. */
public static List<String> extractTasks(BuildResult buildResult) {
return FluentIterable.from(buildResult.getTasks())
.transform(
new Function<BuildTask, String>() {
@Override
public String apply(BuildTask buildTask) {
return buildTask.getPath();
}
})
.toList();
}
开发者ID:GoogleCloudPlatform,项目名称:app-gradle-plugin,代码行数:14,代码来源:BuildResultFilter.java
示例6: testServiceBuilderGradleTemplate
import org.gradle.testkit.runner.BuildTask; //导入依赖的package包/类
@Test
public void testServiceBuilderGradleTemplate() throws Exception {
File projectPath = BladeCLIUtil.createProject(
_testDir, "service-builder", "guestbook", "-p",
"com.liferay.docs.guestbook");
BuildTask buildService = GradleRunnerUtil.executeGradleRunner(
projectPath, "buildService");
GradleRunnerUtil.verifyGradleRunnerOutput(buildService);
BuildTask buildtask = GradleRunnerUtil.executeGradleRunner(
projectPath, "build");
GradleRunnerUtil.verifyGradleRunnerOutput(buildtask);
File buildApiOutput = new File(
projectPath + "/guestbook-api/build/libs" +
"/com.liferay.docs.guestbook.api-1.0.0.jar");
File buildServiceOutput = new File(
projectPath + "/guestbook-service/build/libs" +
"/com.liferay.docs.guestbook.service-1.0.0.jar");
Assert.assertTrue(buildApiOutput.exists());
Assert.assertTrue(buildServiceOutput.exists());
String bundleIDApi = BladeCLIUtil.installBundle(buildApiOutput);
String bundleIDService = BladeCLIUtil.installBundle(buildServiceOutput);
BladeCLIUtil.startBundle(bundleIDApi);
BladeCLIUtil.startBundle(bundleIDService);
BladeCLIUtil.uninstallBundle(bundleIDApi, bundleIDService);
}
开发者ID:liferay,项目名称:liferay-blade-samples,代码行数:35,代码来源:BladeSamplesTest.java
示例7: halt_build_on_duplicate_command_handling_methods
import org.gradle.testkit.runner.BuildTask; //导入依赖的package包/类
@Test
public void halt_build_on_duplicate_command_handling_methods() {
final BuildResult result = newProjectWithJava(
"io/spine/model/verify/DuplicateAggregate.java",
"io/spine/model/verify/DuplicateCommandHandler.java")
.executeAndFail(VERIFY_MODEL);
final BuildTask task = result.task(toPath(VERIFY_MODEL));
assertNotNull(task);
final TaskOutcome generationResult = task.getOutcome();
assertEquals(FAILED, generationResult);
}
开发者ID:SpineEventEngine,项目名称:core-java,代码行数:12,代码来源:ModelVerifierPluginShould.java
示例8: halt_build_on_malformed_command_handling_methods
import org.gradle.testkit.runner.BuildTask; //导入依赖的package包/类
@Ignore // TODO:2017-08-25:dmytro.dashenkov: Re-enable when Model is capable of checking the handler methods.
// https://github.com/SpineEventEngine/base/issues/49
@Test
public void halt_build_on_malformed_command_handling_methods() {
final BuildResult result =
newProjectWithJava("io/spine/model/verify/MalformedAggregate.java")
.executeAndFail(VERIFY_MODEL);
final BuildTask task = result.task(toPath(VERIFY_MODEL));
assertNotNull(task);
final TaskOutcome generationResult = task.getOutcome();
assertEquals(FAILED, generationResult);
}
开发者ID:SpineEventEngine,项目名称:core-java,代码行数:13,代码来源:ModelVerifierPluginShould.java
示例9: buildResultToString
import org.gradle.testkit.runner.BuildTask; //导入依赖的package包/类
static String buildResultToString(BuildResult result) {
return StringPrinter.buildString(printer -> {
for (BuildTask task : result.getTasks()) {
printer.println(task.getPath() + " " + task.getOutcome());
}
});
}
开发者ID:diffplug,项目名称:spotless,代码行数:8,代码来源:GradleIntegrationTest.java
示例10: runTask
import org.gradle.testkit.runner.BuildTask; //导入依赖的package包/类
/**
* Create a task
* @param taskName the task's name
* @param parameters the download parameters
* @return the task
* @throws Exception if anything went wrong
*/
protected BuildTask runTask(String taskName, Parameters parameters) throws Exception {
return createRunner(parameters)
.withArguments(parameters.offline ? asList("--offline", taskName) :
singletonList(taskName))
.build()
.task(taskName);
}
开发者ID:michel-kraemer,项目名称:gradle-download-task,代码行数:15,代码来源:FunctionalDownloadTest.java
示例11: DefaultBuildResult
import org.gradle.testkit.runner.BuildTask; //导入依赖的package包/类
public DefaultBuildResult(String output, List<BuildTask> tasks) {
this.output = output;
this.tasks = tasks;
}
开发者ID:lxxlxx888,项目名称:Reer,代码行数:5,代码来源:DefaultBuildResult.java
示例12: getTasks
import org.gradle.testkit.runner.BuildTask; //导入依赖的package包/类
@Override
public List<BuildTask> getTasks() {
return Collections.unmodifiableList(tasks);
}
开发者ID:lxxlxx888,项目名称:Reer,代码行数:5,代码来源:DefaultBuildResult.java
示例13: FeatureCheckBuildResult
import org.gradle.testkit.runner.BuildTask; //导入依赖的package包/类
public FeatureCheckBuildResult(BuildOperationParameters buildOperationParameters, String output, List<BuildTask> tasks) {
delegateBuildResult = new DefaultBuildResult(output, tasks);
outputFeatureCheck = new BuildResultOutputFeatureCheck(buildOperationParameters.getTargetGradleVersion(), buildOperationParameters.isEmbedded());
tasksFeatureCheck = new BuildResultTasksFeatureCheck(buildOperationParameters.getTargetGradleVersion());
}
开发者ID:lxxlxx888,项目名称:Reer,代码行数:6,代码来源:FeatureCheckBuildResult.java
示例14: getTasks
import org.gradle.testkit.runner.BuildTask; //导入依赖的package包/类
@Override
public List<BuildTask> getTasks() {
tasksFeatureCheck.verify();
return delegateBuildResult.getTasks();
}
开发者ID:lxxlxx888,项目名称:Reer,代码行数:6,代码来源:FeatureCheckBuildResult.java
示例15: tasks
import org.gradle.testkit.runner.BuildTask; //导入依赖的package包/类
@Override
public List<BuildTask> tasks(TaskOutcome outcome) {
tasksFeatureCheck.verify();
return delegateBuildResult.tasks(outcome);
}
开发者ID:lxxlxx888,项目名称:Reer,代码行数:6,代码来源:FeatureCheckBuildResult.java
示例16: task
import org.gradle.testkit.runner.BuildTask; //导入依赖的package包/类
@Nullable
@Override
public BuildTask task(String taskPath) {
tasksFeatureCheck.verify();
return delegateBuildResult.task(taskPath);
}
开发者ID:lxxlxx888,项目名称:Reer,代码行数:7,代码来源:FeatureCheckBuildResult.java
示例17: GradleExecutionResult
import org.gradle.testkit.runner.BuildTask; //导入依赖的package包/类
public GradleExecutionResult(BuildOperationParameters buildOperationParameters, String standardOutput, List<BuildTask> tasks) {
this(buildOperationParameters, standardOutput, tasks, null);
}
开发者ID:lxxlxx888,项目名称:Reer,代码行数:4,代码来源:GradleExecutionResult.java
示例18: getTasks
import org.gradle.testkit.runner.BuildTask; //导入依赖的package包/类
public List<BuildTask> getTasks() {
return tasks;
}
开发者ID:lxxlxx888,项目名称:Reer,代码行数:4,代码来源:GradleExecutionResult.java
示例19: TaskExecutionProgressListener
import org.gradle.testkit.runner.BuildTask; //导入依赖的package包/类
public TaskExecutionProgressListener(List<BuildTask> tasks) {
this.tasks = tasks;
}
开发者ID:lxxlxx888,项目名称:Reer,代码行数:4,代码来源:ToolingApiGradleExecutor.java
示例20: createBuildTask
import org.gradle.testkit.runner.BuildTask; //导入依赖的package包/类
private BuildTask createBuildTask(String taskPath, TaskOutcome outcome) {
return new DefaultBuildTask(taskPath, outcome);
}
开发者ID:lxxlxx888,项目名称:Reer,代码行数:4,代码来源:ToolingApiGradleExecutor.java
注:本文中的org.gradle.testkit.runner.BuildTask类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论