use of com.redhat.ceylon.model.typechecker.model.Module in project ceylon-compiler by ceylon.
the class CeylonClassWriter method writeClass.
@Override
public JavaFileObject writeClass(ClassSymbol c) throws IOException, PoolOverflow, StringOverflow {
String packageName = c.packge().getQualifiedName().toString();
Package pkg = modelLoader.findPackage(packageName);
if (pkg == null)
throw new RuntimeException("Failed to find package: " + packageName);
Module module = pkg.getModule();
fileManager.setModule(module);
return super.writeClass(c);
}
use of com.redhat.ceylon.model.typechecker.model.Module in project ceylon-compiler by ceylon.
the class CeylonDocToolTests method documentSingleModule.
@Test
public void documentSingleModule() throws Exception {
String pathname = "test/ceylondoc";
String moduleName = "com.redhat.ceylon.ceylondoc.test.modules.multi.a";
CeylonDocTool tool = tool(pathname, moduleName, true, "build/ceylon-cars");
tool.run();
Module a = makeModule("com.redhat.ceylon.ceylondoc.test.modules.multi.a", "1");
File destDirA = getOutputDir(tool, a);
Module b = makeModule("com.redhat.ceylon.ceylondoc.test.modules.multi.b", "1");
File destDirB = getOutputDir(tool, b);
Module def = makeDefaultModule();
File destDirDef = getOutputDir(tool, def);
assertFileExists(destDirA, "index.html");
assertFileNotExists(destDirB, "index.html");
assertFileNotExists(destDirDef, "index.html");
}
use of com.redhat.ceylon.model.typechecker.model.Module in project ceylon-compiler by ceylon.
the class CeylonDocToolTests method ceylonSdk.
@Test
public void ceylonSdk() throws Exception {
File sdkDir = new File("../ceylon-sdk");
if (!sdkDir.exists() || !sdkDir.isDirectory()) {
Assert.fail("You don't have ceylon-sdk checked out at " + sdkDir.getAbsolutePath() + " so this test doesn't apply");
}
String[] fullModuleNames = { "ceylon.collection", "ceylon.dbc", "ceylon.file", "ceylon.html", "ceylon.interop.java", "ceylon.io", "ceylon.locale", "ceylon.logging", "ceylon.json", "ceylon.math", "ceylon.net", "ceylon.process", "ceylon.promise", "ceylon.regex", "ceylon.test", "ceylon.time", "ceylon.transaction", "ceylon.unicode" };
compileSdkJavaFiles();
CeylonDocTool tool = tool(Arrays.asList(new File("../ceylon-sdk/source")), Collections.<File>emptyList(), Arrays.asList(fullModuleNames), true, false, false);
tool.setIncludeNonShared(false);
tool.setIncludeSourceCode(true);
tool.run();
Map<String, String> nameToVersion = new HashMap<String, String>();
for (Module module : tool.getDocumentedModules()) {
nameToVersion.put(module.getNameAsString(), module.getVersion());
}
for (String moduleName : fullModuleNames) {
Module module = makeModule(moduleName, nameToVersion.get(moduleName));
File destDir = getOutputDir(tool, module);
assertFileExists(destDir, "index.html");
}
}
use of com.redhat.ceylon.model.typechecker.model.Module in project ceylon-compiler by ceylon.
the class CeylonDocToolTests method ceylonLanguage.
@Test
public void ceylonLanguage() throws Exception {
String pathname = "../ceylon.language/src";
String moduleName = AbstractModelLoader.CEYLON_LANGUAGE;
CeylonDocTool tool = tool(pathname, moduleName, true, true);
tool.setIncludeNonShared(false);
tool.setIncludeSourceCode(true);
tool.run();
Module module = makeModule(AbstractModelLoader.CEYLON_LANGUAGE, LANGUAGE_MODULE_VERSION);
File destDir = getOutputDir(tool, module);
assertFileExists(destDir, "index.html");
assertFileExists(destDir, "Nothing.type.html");
}
use of com.redhat.ceylon.model.typechecker.model.Module in project ceylon-compiler by ceylon.
the class CeylonDocToolTests method bug2346.
@Test
public void bug2346() throws Exception {
String pathname = "test/ceylondoc";
String moduleName = "com.redhat.ceylon.ceylondoc.test.modules.bug2346";
Module module = new Module();
module.setName(Arrays.asList(moduleName));
module.setVersion("1");
CeylonDocTool tool = tool(Arrays.asList(new File(pathname)), Arrays.asList(new File("doc")), Arrays.asList(moduleName), true, false, false);
tool.run();
}
Aggregations