use of aQute.bnd.osgi.Descriptors.TypeRef in project bnd by bndtools.
the class Builder method addSources.
/**
* @throws IOException
*/
private void addSources(Jar dot) throws Exception {
if (!hasSources())
return;
Set<PackageRef> packages = Create.set();
for (TypeRef typeRef : getClassspace().keySet()) {
PackageRef packageRef = typeRef.getPackageRef();
String sourcePath = typeRef.getSourcePath();
String packagePath = packageRef.getPath();
boolean found = false;
String[] fixed = { "packageinfo", "package.html", "module-info.java", "package-info.java" };
for (File root : getSourcePath()) {
File f = getFile(root, sourcePath);
if (f.exists()) {
found = true;
if (!packages.contains(packageRef)) {
packages.add(packageRef);
for (int j = 0; j < fixed.length; j++) {
for (File sp : getSourcePath()) {
File bdir = getFile(sp, packagePath);
File ff = getFile(bdir, fixed[j]);
if (ff.isFile()) {
String name = "OSGI-OPT/src/" + packagePath + "/" + fixed[j];
dot.putResource(name, new FileResource(ff));
break;
}
}
}
}
if (packageRef.isDefaultPackage())
logger.debug("Package reference is default package");
dot.putResource("OSGI-OPT/src/" + sourcePath, new FileResource(f));
}
}
if (getSourcePath().isEmpty())
warning("Including sources but " + SOURCEPATH + " does not contain any source directories ");
// TODO copy from the jars where they came from
}
}
use of aQute.bnd.osgi.Descriptors.TypeRef in project bnd by bndtools.
the class Clazz method doExceptions.
void doExceptions(DataInput in, int access_flags) throws IOException {
int exception_count = in.readUnsignedShort();
for (int i = 0; i < exception_count; i++) {
int index = in.readUnsignedShort();
ClassConstant cc = (ClassConstant) pool[index];
TypeRef clazz = analyzer.getTypeRef(cc.getName());
referTo(clazz, access_flags);
}
}
Aggregations