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


Java Project.setVersion方法代碼示例

本文整理匯總了Java中org.gradle.api.Project.setVersion方法的典型用法代碼示例。如果您正苦於以下問題:Java Project.setVersion方法的具體用法?Java Project.setVersion怎麽用?Java Project.setVersion使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.gradle.api.Project的用法示例。


在下文中一共展示了Project.setVersion方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: checkTaskProperties

import org.gradle.api.Project; //導入方法依賴的package包/類
@Test
public void checkTaskProperties() throws IOException {
	System.setProperty(Context.INITIAL_CONTEXT_FACTORY, DummyInitialContextFactory.class.getName());

	testProjectDir.newFolder("src", "main", "java");

	File outputDir = testProjectDir.getRoot();

	Project project = ProjectBuilder.builder().withName("crnk-gen-typescript-test").withProjectDir(outputDir).build();
	project.setVersion("0.0.1");
	project.getPluginManager().apply(JavaPlugin.class);
	project.getPluginManager().apply(TSGeneratorPlugin.class);

	TSGeneratorExtension extension = project.getExtensions().getByType(TSGeneratorExtension.class);
	extension.getRuntime().setConfiguration(null);

	TSGeneratorPlugin plugin = project.getPlugins().getPlugin(TSGeneratorPlugin.class);
	plugin.init(project);

	PublishTypescriptStubsTask task = (PublishTypescriptStubsTask) project.getTasks().getByName("publishTypescript");
	Assert.assertEquals("publish", task.getGroup());
	Assert.assertNotNull(task.getDescription());
	Assert.assertFalse(task.getInputs().getFiles().isEmpty());
	Assert.assertFalse(task.getOutputs().getFiles().isEmpty());
}
 
開發者ID:crnk-project,項目名稱:crnk-framework,代碼行數:26,代碼來源:PublishTypescriptTaskTest.java

示例2: setup

import org.gradle.api.Project; //導入方法依賴的package包/類
@Before
public void setup() throws IOException {
	// Deltaspike sometimes really wants to have a retarded JNDI context
	System.setProperty(Context.INITIAL_CONTEXT_FACTORY, DummyInitialContextFactory.class.getName());

	testProjectDir.newFolder("src", "main", "java");

	File outputDir = testProjectDir.getRoot();

	Project project = ProjectBuilder.builder().withName("crnk-gen-typescript-test").withProjectDir(outputDir).build();
	project.setVersion("0.0.1");

	project.getPluginManager().apply("com.moowork.node");
	project.getPluginManager().apply(JavaPlugin.class);
	project.getPluginManager().apply(TSGeneratorPlugin.class);

	TSGeneratorExtension config = project.getExtensions().getByType(TSGeneratorExtension.class);
	config.getRuntime().setConfiguration("test");

	factory = new RuntimeClassLoaderFactory(project);
	ClassLoader parentClassLoader = getClass().getClassLoader();
	classLoader = factory.createClassLoader(parentClassLoader);
	sharedClassLoader = (RuntimeClassLoaderFactory.SharedClassLoader) classLoader.getParent();

}
 
開發者ID:crnk-project,項目名稱:crnk-framework,代碼行數:26,代碼來源:RuntimeClassoaderFactoryTest.java


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