use of org.eclipse.ceylon.compiler.java.tools.CeyloncTaskImpl in project ceylon by eclipse.
the class CMRTests method testMdlDependenciesFromMavenAutoExport.
@Test
public void testMdlDependenciesFromMavenAutoExport() throws Throwable {
Assume.assumeTrue("Runs on JDK8", JDKUtils.jdk == JDKUtils.JDK.JDK8);
CeyloncTaskImpl ceylonTask = getCompilerTask(Arrays.asList("-out", destDir), "modules/sparkframework/module.ceylon", "modules/sparkframework/test.ceylon");
assertEquals("Compilation failed", Boolean.TRUE, ceylonTask.call());
runInJBossModules("run", "org.eclipse.ceylon.compiler.java.test.cmr.modules.sparkframework/1", Arrays.asList("--auto-export-maven-dependencies"));
}
use of org.eclipse.ceylon.compiler.java.tools.CeyloncTaskImpl in project ceylon by eclipse.
the class CMRTests method testMdlByName.
//
// Modules
@Test
public void testMdlByName() throws IOException {
List<String> options = new LinkedList<String>();
options.add("-src");
options.add(getPackagePath() + "/modules/byName");
options.addAll(defaultOptions);
CeyloncTaskImpl task = getCompilerTask(options, null, Arrays.asList("default", "mod"));
Boolean ret = task.call();
assertTrue(ret);
File carFile = getModuleArchive("default", null);
assertTrue(carFile.exists());
JarFile car = new JarFile(carFile);
ZipEntry moduleClass = car.getEntry("def/Foo.class");
assertNotNull(moduleClass);
ZipEntry moduleClassDir = car.getEntry("def/");
assertNotNull(moduleClassDir);
assertTrue(moduleClassDir.isDirectory());
car.close();
carFile = getModuleArchive("mod", "1");
assertTrue(carFile.exists());
car = new JarFile(carFile);
moduleClass = car.getEntry("mod/$module_.class");
assertNotNull(moduleClass);
moduleClassDir = car.getEntry("mod/");
assertNotNull(moduleClassDir);
assertTrue(moduleClassDir.isDirectory());
car.close();
}
use of org.eclipse.ceylon.compiler.java.tools.CeyloncTaskImpl in project ceylon by eclipse.
the class CMRTests method testOverridesCeylonModuleShareImport.
@Test
public void testOverridesCeylonModuleShareImport() {
setupBinaryModulesForOverridesCeylonModuleTests();
ErrorCollector collector = new ErrorCollector();
CeyloncTaskImpl compilerTask = getCompilerTask(Arrays.asList("-src", getPackagePath() + "/modules", "-overrides", getPackagePath() + "modules/overridesCeylonModule/overrides-share-c-import.xml"), collector, "modules/overridesCeylonModule/module.ceylon");
ModulesRetriever modulesRetriever = new ModulesRetriever(compilerTask.getContext());
compilerTask.setTaskListener(modulesRetriever);
Boolean result = compilerTask.call();
Assert.assertEquals(Boolean.TRUE, result);
Module a = modulesRetriever.modules.get("a");
assert (a != null);
ModuleImport cImport = getModuleImport(a, "c");
assert (cImport != null);
assertEquals("The 'c' module import should be seen as 'exported' after applying the overrides file", true, cImport.isExport());
}
use of org.eclipse.ceylon.compiler.java.tools.CeyloncTaskImpl in project ceylon by eclipse.
the class CMRTests method testMdlCeylonAetherDependencyConflict.
@Test
public void testMdlCeylonAetherDependencyConflict() throws IOException {
// Try to compile the ceylon module
CeyloncTaskImpl ceylonTask = getCompilerTask(Arrays.asList("-out", destDir, "-verbose:cmr"), (DiagnosticListener<? super FileObject>) null, "modules/ceylonAetherConflict2/module.ceylon");
assertEquals(Boolean.TRUE, ceylonTask.call());
ErrorCollector collector = new ErrorCollector();
ceylonTask = getCompilerTask(Arrays.asList("-out", destDir, "-verbose:cmr"), collector, "modules/ceylonAetherConflict/module.ceylon", "modules/ceylonAetherConflict/foo.ceylon");
assertEquals(Boolean.TRUE, ceylonTask.call());
compareErrors(collector.get(Diagnostic.Kind.WARNING), new CompilerError(Diagnostic.Kind.WARNING, null, 21, "all-lowercase ASCII module names are recommended"), new CompilerError(Diagnostic.Kind.WARNING, null, 21, "source code imports two different versions of similar modules 'org.apache.httpcomponents.httpclient/4.3.2' and 'org.apache.httpcomponents:httpclient/4.3.3'"));
}
use of org.eclipse.ceylon.compiler.java.tools.CeyloncTaskImpl in project ceylon by eclipse.
the class CMRTests method testMdlModuleDefaultIncrementalNoPackage.
@Test
public void testMdlModuleDefaultIncrementalNoPackage() throws IOException {
List<String> options = new LinkedList<String>();
options.add("-src");
options.add(getPackagePath() + "/modules/def");
options.addAll(defaultOptions);
CeyloncTaskImpl task = getCompilerTask(options, null, Collections.<String>emptyList(), "modules/def/A.ceylon");
Boolean ret = task.call();
assertTrue(ret);
task = getCompilerTask(options, null, Collections.<String>emptyList(), "modules/def/RequiresA.ceylon");
ret = task.call();
assertTrue(ret);
}
Aggregations