use of org.eclipse.ceylon.compiler.java.tools.CeyloncTaskImpl in project ceylon by eclipse.
the class CMRTests method testMdlCeylonAetherDuplicateImports.
@Test
public void testMdlCeylonAetherDuplicateImports() throws IOException {
// Try to compile the ceylon module
ErrorCollector collector = new ErrorCollector();
CeyloncTaskImpl ceylonTask = getCompilerTask(Arrays.asList("-out", destDir, "-verbose:cmr"), collector, "modules/ceylonAetherDuplicateImports/module.ceylon", "modules/ceylonAetherDuplicateImports/foo.ceylon");
assertEquals(Boolean.FALSE, ceylonTask.call());
compareErrors(collector.get(Diagnostic.Kind.ERROR), new CompilerError(23, "duplicate module import: 'org.apache.httpcomponents.httpclient'"), new CompilerError(25, "duplicate module import: 'org.apache.httpcomponents:httpclient'"));
}
use of org.eclipse.ceylon.compiler.java.tools.CeyloncTaskImpl in project ceylon by eclipse.
the class CMRTests method testMdlAetherDependencyCustomRelative.
@Test
public void testMdlAetherDependencyCustomRelative() throws IOException {
// Try to compile the ceylon module
File settingsFile = new File(getPackagePath(), "modules/aethercustom/settings.xml");
CeyloncTaskImpl ceylonTask = getCompilerTask(Arrays.asList("-out", destDir, "-rep", "aether:" + settingsFile, "-verbose:cmr"), (DiagnosticListener<? super FileObject>) null, "modules/aethercustom/module.ceylon", "modules/aethercustom/foo.ceylon");
assertEquals(Boolean.TRUE, ceylonTask.call());
File restletJar = new File("build/test-cars/cmr-repository", "org/restlet/org.restlet/1.1.10/org.restlet-1.1.10.jar");
assertTrue(restletJar.exists());
}
use of org.eclipse.ceylon.compiler.java.tools.CeyloncTaskImpl in project ceylon by eclipse.
the class CMRTests method testMdlAetherDependencyCustomAutoActive.
@Test
public void testMdlAetherDependencyCustomAutoActive() throws IOException {
// Try to compile the ceylon module
File settingsFile = new File(getPackagePath(), "modules/aethercustom/settings-autoactive.xml");
CeyloncTaskImpl ceylonTask = getCompilerTask(Arrays.asList("-out", destDir, "-rep", "aether:" + settingsFile.getAbsolutePath(), "-verbose:cmr"), (DiagnosticListener<? super FileObject>) null, "modules/aethercustom/module.ceylon", "modules/aethercustom/foo.ceylon");
assertEquals(Boolean.TRUE, ceylonTask.call());
File restletJar = new File("build/test-cars/cmr-repository", "org/restlet/org.restlet/1.1.10/org.restlet-1.1.10.jar");
assertTrue(restletJar.exists());
}
use of org.eclipse.ceylon.compiler.java.tools.CeyloncTaskImpl in project ceylon by eclipse.
the class CMRTests method testMdlSuppressObsoleteClasses.
@Test
public void testMdlSuppressObsoleteClasses() throws IOException {
File sourceFile = new File(getPackagePath(), "modules/single/SuppressClass.ceylon");
copy(new File(getPackagePath(), "modules/single/SuppressClass_1.ceylon"), sourceFile);
CeyloncTaskImpl compilerTask = getCompilerTask("modules/single/module.ceylon", "modules/single/SuppressClass.ceylon");
Boolean success = compilerTask.call();
assertTrue(success);
File carFile = getModuleArchive("org.eclipse.ceylon.compiler.java.test.cmr.modules.single", "6.6.6");
assertTrue(carFile.exists());
ZipFile car = new ZipFile(carFile);
ZipEntry oneClass = car.getEntry("org/eclipse/ceylon/compiler/java/test/cmr/modules/single/One.class");
assertNotNull(oneClass);
ZipEntry twoClass = car.getEntry("org/eclipse/ceylon/compiler/java/test/cmr/modules/single/Two.class");
assertNotNull(twoClass);
car.close();
copy(new File(getPackagePath(), "modules/single/SuppressClass_2.ceylon"), sourceFile);
compilerTask = getCompilerTask("modules/single/module.ceylon", "modules/single/SuppressClass.ceylon");
success = compilerTask.call();
assertTrue(success);
carFile = getModuleArchive("org.eclipse.ceylon.compiler.java.test.cmr.modules.single", "6.6.6");
assertTrue(carFile.exists());
car = new ZipFile(carFile);
oneClass = car.getEntry("org/eclipse/ceylon/compiler/java/test/cmr/modules/single/One.class");
assertNotNull(oneClass);
twoClass = car.getEntry("org/eclipse/ceylon/compiler/java/test/cmr/modules/single/Two.class");
assertNull(twoClass);
car.close();
sourceFile.delete();
}
use of org.eclipse.ceylon.compiler.java.tools.CeyloncTaskImpl in project ceylon by eclipse.
the class CMRTests method testOverridesCeylonModuleVersionAlterdPackageSharing.
@Test
public void testOverridesCeylonModuleVersionAlterdPackageSharing() {
setupBinaryModulesForOverridesCeylonModuleTests();
ErrorCollector collector = new ErrorCollector();
CeyloncTaskImpl compilerTask = getCompilerTask(Arrays.asList("-src", getPackagePath() + "/modules", "-overrides", getPackagePath() + "modules/overridesCeylonModule/overrides-b-version.xml"), collector, "modules/overridesCeylonModule/module.ceylon", "modules/overridesCeylonModule/testImportHiddenPackage.ceylon");
ModulesRetriever modulesRetriever = new ModulesRetriever(compilerTask.getContext());
compilerTask.setTaskListener(modulesRetriever);
Boolean result = compilerTask.call();
Assert.assertEquals(Boolean.FALSE, result);
compareErrors(collector.get(Diagnostic.Kind.ERROR), new CompilerError(2, "imported package is not visible: package 'b.hidden' is not shared by module 'b'"));
}
Aggregations