private void resolveBundle() {
log("Resolve classpath", Project.MSG_VERBOSE);
isResolved = true;
BundleRepositoryPersister persister = new BundleRepositoryPersister(repositoryDirectory);
BundleRepository repository = null;
try {
repository = persister.load();
} catch (IOException e) {
// cannot load repository - create an empty one
log("Repository " + repositoryDirectory + " cannot be loaded", Project.MSG_WARN);
repository = new BundleRepository("J2SE-1.5");
}
unresolved = new HashSet<ImportPackage>();
resolved = new HashSet<ExportPackage>();
resolvedBundles = new HashSet<BundleDescriptor>();
boolean resolveToBundle = "bundle".equals(resolve);
Set<BundleDescriptor> importedBundles = new HashSet<BundleDescriptor>();
// add fragment host bundle
if (descriptor.getFragmentHost() != null) {
BundleDescriptor[] hosts = repository.resolveBundle(descriptor.getFragmentHost(), descriptor.getFragmentHostVersionRange(), true);
if (hosts.length > 0) {
BundleDescriptor fragmentHost = hosts[0];
importedBundles.add(fragmentHost);
// resolve the fragment host
resolveBundle(0, fragmentHost, repository);