use of com.redhat.ceylon.tools.src.CeylonSrcTool in project ceylon-compiler by ceylon.
the class SrcToolTests method testModuleVersion.
@Test
public void testModuleVersion() throws Exception {
ToolModel<CeylonSrcTool> model = pluginLoader.loadToolModel("src");
Assert.assertNotNull(model);
CeylonSrcTool tool = pluginFactory.bindArguments(model, getMainTool(), Collections.<String>singletonList("ceylon.language/" + Versions.CEYLON_VERSION_NUMBER));
}
use of com.redhat.ceylon.tools.src.CeylonSrcTool in project ceylon-compiler by ceylon.
the class SrcToolTests method testNoArgs.
@Test
public void testNoArgs() throws Exception {
ToolModel<CeylonSrcTool> model = pluginLoader.loadToolModel("src");
Assert.assertNotNull(model);
try {
CeylonSrcTool tool = pluginFactory.bindArguments(model, getMainTool(), Collections.<String>emptyList());
Assert.fail();
} catch (OptionArgumentException e) {
// asserting this is thrown
}
}
use of com.redhat.ceylon.tools.src.CeylonSrcTool in project ceylon-compiler by ceylon.
the class SrcToolTests method testOffline.
@Test
public void testOffline() throws Exception {
ToolModel<CeylonSrcTool> model = pluginLoader.loadToolModel("src");
Assert.assertNotNull(model);
CeylonSrcTool tool = pluginFactory.bindArguments(model, getMainTool(), Arrays.<String>asList("--offline", "ceylon.language"));
}
use of com.redhat.ceylon.tools.src.CeylonSrcTool in project ceylon-compiler by ceylon.
the class SrcToolTests method testUnpacking.
@Test
public void testUnpacking() throws Exception {
compile("src_tool_test/module.ceylon", "src_tool_test/package.ceylon", "src_tool_test/foo.ceylon");
ToolModel<CeylonSrcTool> model = pluginLoader.loadToolModel("src");
Assert.assertNotNull(model);
CeylonSrcTool tool = pluginFactory.bindArguments(model, getMainTool(), Arrays.<String>asList("--cacherep", getCachePath(), "--rep", getOutPath(), "--src", "build/test-source", "com.redhat.ceylon.tools.test.test_mod_source.src_tool_test/1.0.0"));
tool.run();
String path = "build/test-source/com/redhat/ceylon/tools/test/test_mod_source/src_tool_test";
File dir = new File(path);
Assert.assertTrue(dir.isDirectory());
File moduleFile = new File(dir, "module.ceylon");
Assert.assertTrue(moduleFile.isFile());
File packageFile = new File(dir, "package.ceylon");
Assert.assertTrue(packageFile.isFile());
File fooFile = new File(dir, "foo.ceylon");
Assert.assertTrue(fooFile.isFile());
}
use of com.redhat.ceylon.tools.src.CeylonSrcTool in project ceylon-compiler by ceylon.
the class SrcToolTests method testUnpackingCwd.
@Test
public void testUnpackingCwd() throws Exception {
compile("src_tool_test/module.ceylon", "src_tool_test/package.ceylon", "src_tool_test/foo.ceylon");
ToolModel<CeylonSrcTool> model = pluginLoader.loadToolModel("src");
Assert.assertNotNull(model);
CeylonSrcTool tool = pluginFactory.bindArguments(model, getMainTool(), Arrays.<String>asList("--cacherep", removeRoot(getCachePath()), "--rep", removeRoot(getOutPath()), "--cwd", "build", "--src", "test-source2", "com.redhat.ceylon.tools.test.test_mod_source.src_tool_test/1.0.0"));
tool.run();
String path = "build/test-source2/com/redhat/ceylon/tools/test/test_mod_source/src_tool_test";
File dir = new File(path);
Assert.assertTrue(dir.isDirectory());
File moduleFile = new File(dir, "module.ceylon");
Assert.assertTrue(moduleFile.isFile());
File packageFile = new File(dir, "package.ceylon");
Assert.assertTrue(packageFile.isFile());
File fooFile = new File(dir, "foo.ceylon");
Assert.assertTrue(fooFile.isFile());
}
Aggregations