use of org.eclipse.ceylon.common.ModuleSpec in project ceylon by eclipse.
the class CompatTests method compileAndRunDepends120With121.
@Test
public void compileAndRunDepends120With121() throws Throwable {
ProcessBuilder pb = new ProcessBuilder(get121DistPath() + "/bin/ceylon", "compile", "--offline", "--rep", "test/src/org/eclipse/ceylon/compiler/java/test/compat/modules", "--src=test/src/org/eclipse/ceylon/compiler/java/test/compat/source", "depends120");
assert (0 == pb.inheritIO().start().waitFor());
// with the default upgrade dist behaviour
runInJBossModules("run", "depends120", Arrays.asList("--rep", "modules", "--rep", "test/src/org/eclipse/ceylon/compiler/java/test/compat/modules"), Arrays.asList(Versions.CEYLON_VERSION_NUMBER), null, null);
runInJBossModules("run", "depends120", Arrays.asList("--flat-classpath", "--rep", "modules", "--rep", "test/src/org/eclipse/ceylon/compiler/java/test/compat/modules"), Arrays.asList(Versions.CEYLON_VERSION_NUMBER), null, null);
runInMainApi("test/src/org/eclipse/ceylon/compiler/java/test/compat/modules", new ModuleSpec(null, "depends120", "1.0.0"), "depends120.run_", Arrays.asList(Versions.CEYLON_VERSION_NUMBER), false);
}
use of org.eclipse.ceylon.common.ModuleSpec in project ceylon by eclipse.
the class CompatTests method runCompiled1299CarIn121MainApi.
// TODO FlatClasspath downgrade
@Ignore("Removed until we can create compiled modules with alternate versions")
@Test
public void runCompiled1299CarIn121MainApi() throws Throwable {
File err = File.createTempFile("compattest", "out");
try {
mainApiClasspath("test/src/org/eclipse/ceylon/compiler/java/test/compat/modules", new ModuleSpec(null, "compiled1299", "1.0.0"), Collections.<ModuleSpec>emptyList(), 1, err, false);
assertFileContainsLine(err, "Module org.eclipse.ceylon.typechecker/1.2.99 not found in the following repositories:");
} finally {
err.delete();
}
}
use of org.eclipse.ceylon.common.ModuleSpec in project ceylon by eclipse.
the class CompatTests method classpathCompiled1299With121NoDowngrade.
@Ignore("Removed until we can create compiled modules with alternate versions")
@Test
public void classpathCompiled1299With121NoDowngrade() throws Throwable {
File err = File.createTempFile("compattest", "out");
try {
mainApiClasspath("test/src/org/eclipse/ceylon/compiler/java/test/compat/modules", new ModuleSpec(null, "compiled1299", "1.0.0"), Collections.<ModuleSpec>emptyList(), 1, err, false);
assertFileContainsLine(err, "Module org.eclipse.ceylon.typechecker/1.2.99 not found in the following repositories:");
} finally {
err.delete();
}
}
use of org.eclipse.ceylon.common.ModuleSpec in project ceylon by eclipse.
the class RepoUsingTool method collectModule.
private void collectModule(File sourceRoot, File sourceFile, Map<String, ModuleSpec> modules) {
File relativeFile = FileUtil.relativeFile(sourceRoot, sourceFile);
String name = relativeFile.getPath().replace(File.separatorChar, '.');
if (modules.containsKey(name))
return;
try {
ModuleDescriptorReader mdr = new ModuleDescriptorReader(name, sourceRoot);
String version = mdr.getModuleVersion();
if (version != null) {
modules.put(name, new ModuleSpec(null, name, version));
}
} catch (ModuleDescriptorReader.NoSuchModuleException x) {
// skip this source folder and look in the next one
x.printStackTrace();
}
}
use of org.eclipse.ceylon.common.ModuleSpec in project ceylon by eclipse.
the class RepoUsingTool method getSourceModules.
protected List<ModuleSpec> getSourceModules(List<File> srcDirs) {
Map<String, ModuleSpec> modules = new HashMap<String, ModuleSpec>();
for (File srcDir : srcDirs) {
collectModules(srcDir, srcDir, modules);
}
ArrayList<ModuleSpec> ret = new ArrayList<ModuleSpec>(modules.size());
ret.addAll(modules.values());
return ret;
}
Aggregations