use of org.eclipse.ceylon.cmr.api.ModuleVersionDetails in project ceylon by eclipse.
the class CeylonInfoTool method outputVersions.
private void outputVersions(String namespace, String moduleName, Collection<ModuleVersionDetails> versions, String prefix) throws IOException {
String namePrefix = (formatting == Formatting.fancy) ? prefix + " " : "";
for (ModuleVersionDetails version : versions) {
if (formatting == Formatting.fancy || (!showDependencies && !showNames)) {
append(prefix);
if (formatting == Formatting.simple) {
if (namespace != null) {
append(namespace).append(":");
}
append(moduleName).append("/");
}
append(version.getVersion());
if (formatting == Formatting.fancy) {
append(" - ").append(version.getOrigin());
if (hasOnlyIncompatibleBinaries(version)) {
append(" ");
msg("label.incompatible.version");
}
if (version.isRemote()) {
append(" ");
msg("label.remote");
}
}
newline();
}
if (showDependencies) {
if (formatting == Formatting.fancy || !version.getDependencies().isEmpty()) {
for (ModuleDependencyInfo dep : version.getDependencies()) {
if (dep.getModuleScope() == ModuleScope.TEST)
continue;
if (formatting == Formatting.fancy) {
append(prefix).append(" ").append(dep);
} else {
if (namespace != null) {
append(namespace).append(":");
}
append(moduleName).append("/").append(version.getVersion()).append(" ").append(dep.getModuleName());
}
newline();
}
} else {
if (namespace != null) {
append(namespace).append(":");
}
append(moduleName).append("/").append(version.getVersion()).newline();
}
}
if (showNames) {
outputNames(namespace, moduleName, version, namePrefix);
}
}
}
use of org.eclipse.ceylon.cmr.api.ModuleVersionDetails in project ceylon by eclipse.
the class CeylonBrowseTool method run.
@Override
public void run() throws Exception {
for (ModuleSpec module : modules) {
List<ModuleVersionDetails> versions = new ArrayList<ModuleVersionDetails>(getModuleVersions(getRepositoryManager(), module.getNamespace(), module.getName(), module.getVersion(), false, ModuleQuery.Type.ALL, null, null, null, null));
Collections.sort(versions);
if (versions.isEmpty()) {
String err = getModuleNotFoundErrorMessage(getRepositoryManager(), module.getName(), module.getVersion());
errorAppend(err);
errorNewline();
continue;
}
ModuleVersionDetails mvd = versions.get(versions.size() - 1);
browseDoc(mvd);
}
}
Aggregations