当前位置: 首页>>代码示例>>Java>>正文


Java GradleRunner.build方法代码示例

本文整理汇总了Java中org.gradle.testkit.runner.GradleRunner.build方法的典型用法代码示例。如果您正苦于以下问题:Java GradleRunner.build方法的具体用法?Java GradleRunner.build怎么用?Java GradleRunner.build使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.gradle.testkit.runner.GradleRunner的用法示例。


在下文中一共展示了GradleRunner.build方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: executeGradleRunner

import org.gradle.testkit.runner.GradleRunner; //导入方法依赖的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: testApply

import org.gradle.testkit.runner.GradleRunner; //导入方法依赖的package包/类
@Test
public void testApply() throws Exception {
    String text = "plugins { id 'org.anarres.stdproject' }\n"
            + "stdproject {}\n";
    Files.write(text, testProjectBuildFile, StandardCharsets.UTF_8);

    GradleRunner runner = GradleRunner.create()
            .withGradleVersion(gradleVersion)
            .withPluginClasspath()
            .withDebug(true)
            .withProjectDir(testProjectDir.getRoot())
            .withArguments("tasks");
    LOG.info("Building...\n\n");
    // System.out.println("ClassPath is " + runner.getPluginClasspath());
    BuildResult result = runner.build();
    LOG.info("Output:\n\n" + result.getOutput() + "\n\n");
}
 
开发者ID:shevek,项目名称:gradle-stdproject-plugin,代码行数:18,代码来源:StdProjectPluginApplyTest.java

示例3: test

import org.gradle.testkit.runner.GradleRunner; //导入方法依赖的package包/类
@Test
public void test() throws IOException {
	testFolder.create();
	root = testFolder.getRoot();

	saveFile("test_build.gradle", "build.gradle");
	saveFile("test_settings.gradle", "settings.gradle");
	saveFile("META-INF/beans.xml", "src/main/resources/META-INF/beans.xml");
	saveFile("TestModuleProducer.template", "src/main/java/io/crnk/gen/typescript/TestModuleProducer.java");

	GradleRunner runner = GradleRunner.create();
	runner = runner.withPluginClasspath();

	// List<File> files = Arrays.asList(new File("C:\\projects\\oss\\crnk-framework\\crnk-gen-typescript\\build\\classes\\main"));


	runner = runner.withProjectDir(root);

	// TODO move to assembleTypescript once ngrx-json-api released
	runner = runner.withArguments("generateTypescript");


	BuildResult build = runner.build();
	System.out.println(build.getOutput());
}
 
开发者ID:crnk-project,项目名称:crnk-framework,代码行数:26,代码来源:GradleDeltaspikeTest.java


注:本文中的org.gradle.testkit.runner.GradleRunner.build方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。