本文整理匯總了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());
}
示例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();
}