Search in sources :

Example 21 with CeylonImportJarTool

use of org.eclipse.ceylon.tools.importjar.CeylonImportJarTool in project ceylon by eclipse.

the class ImportJarToolTests method testSourceJarWithPropertiesDescriptor.

@Test
public void testSourceJarWithPropertiesDescriptor() throws Exception {
    FileUtil.delete(destFile("importtest"));
    ToolModel<CeylonImportJarTool> model = pluginLoader.loadToolModel("import-jar");
    Assert.assertNotNull(model);
    CeylonImportJarTool tool = pluginFactory.bindArguments(model, getMainTool(), toolOptions("--descriptor", "test/src/org/eclipse/ceylon/tools/test/test-descriptor.properties", "source.import.test/1.0", "test/src/org/eclipse/ceylon/tools/test/test.jar", "test/src/org/eclipse/ceylon/tools/test/test-source.jar"));
    tool.run();
    File jarFile = destFile("source/import/test/1.0/source.import.test-1.0.jar");
    File sha1JarFile = destFile("source/import/test/1.0/source.import.test-1.0.jar.sha1");
    File sourceJarFile = destFile("source/import/test/1.0/source.import.test-1.0-sources.jar");
    File sha1SourceJarFile = destFile("source/import/test/1.0/source.import.test-1.0-sources.jar.sha1");
    File propertiesFile = destFile("source/import/test/1.0/module.properties");
    File sha1PropertiesFile = destFile("source/import/test/1.0/module.properties");
    Assert.assertTrue(jarFile.exists());
    Assert.assertTrue(sha1JarFile.exists());
    Assert.assertTrue(sourceJarFile.exists());
    Assert.assertTrue(sha1SourceJarFile.exists());
    Assert.assertTrue(propertiesFile.exists());
    Assert.assertTrue(sha1PropertiesFile.exists());
}
Also used : CeylonImportJarTool(org.eclipse.ceylon.tools.importjar.CeylonImportJarTool) File(java.io.File) Test(org.junit.Test)

Example 22 with CeylonImportJarTool

use of org.eclipse.ceylon.tools.importjar.CeylonImportJarTool in project ceylon by eclipse.

the class ImportJarToolTests method testWithPropertiesDescriptor.

@Test
public void testWithPropertiesDescriptor() throws Exception {
    FileUtil.delete(destFile("importtest"));
    ToolModel<CeylonImportJarTool> model = pluginLoader.loadToolModel("import-jar");
    Assert.assertNotNull(model);
    CeylonImportJarTool tool = pluginFactory.bindArguments(model, getMainTool(), toolOptions("--descriptor", "test/src/org/eclipse/ceylon/tools/test/test-descriptor.properties", "importtest/1.0", "test/src/org/eclipse/ceylon/tools/test/test.jar"));
    tool.run();
    File f1 = destFile("importtest/1.0/importtest-1.0.jar");
    File f2 = destFile("importtest/1.0/importtest-1.0.jar.sha1");
    File f3 = destFile("importtest/1.0/module.properties");
    File f4 = destFile("importtest/1.0/module.properties.sha1");
    Assert.assertTrue(f1.exists());
    Assert.assertTrue(f2.exists());
    Assert.assertTrue(f3.exists());
    Assert.assertTrue(f4.exists());
}
Also used : CeylonImportJarTool(org.eclipse.ceylon.tools.importjar.CeylonImportJarTool) File(java.io.File) Test(org.junit.Test)

Example 23 with CeylonImportJarTool

use of org.eclipse.ceylon.tools.importjar.CeylonImportJarTool in project ceylon by eclipse.

the class ImportJarToolTests method testVerbosePackageModuleVersionJar.

@Test
public void testVerbosePackageModuleVersionJar() throws Exception {
    FileUtil.delete(destFile("importtest/imptest"));
    ToolModel<CeylonImportJarTool> model = pluginLoader.loadToolModel("import-jar");
    Assert.assertNotNull(model);
    CeylonImportJarTool tool = pluginFactory.bindArguments(model, getMainTool(), toolOptions("--verbose", "--force", "importtest.imptest/1.0", "test/src/org/eclipse/ceylon/tools/test/test.jar"));
    tool.run();
    File f1 = destFile("importtest/imptest/1.0/importtest.imptest-1.0.jar");
    File f2 = destFile("importtest/imptest/1.0/importtest.imptest-1.0.jar.sha1");
    Assert.assertTrue(f1.exists() && f2.exists());
}
Also used : CeylonImportJarTool(org.eclipse.ceylon.tools.importjar.CeylonImportJarTool) File(java.io.File) Test(org.junit.Test)

Aggregations

CeylonImportJarTool (org.eclipse.ceylon.tools.importjar.CeylonImportJarTool)23 Test (org.junit.Test)22 File (java.io.File)12 ImportJarException (org.eclipse.ceylon.tools.importjar.ImportJarException)6 OptionArgumentException (org.eclipse.ceylon.common.tool.OptionArgumentException)3 ToolUsageError (org.eclipse.ceylon.common.tool.ToolUsageError)3 ArtifactContext (org.eclipse.ceylon.cmr.api.ArtifactContext)1 MavenArtifactContext (org.eclipse.ceylon.cmr.api.MavenArtifactContext)1 RepositoryManager (org.eclipse.ceylon.cmr.api.RepositoryManager)1 CeylonRepoManagerBuilder (org.eclipse.ceylon.cmr.ceylon.CeylonUtils.CeylonRepoManagerBuilder)1 ToolError (org.eclipse.ceylon.common.tool.ToolError)1