use of aQute.bnd.deployer.repository.FixedIndexedRepo in project bnd by bndtools.
the class ResolverValidator method validate.
public List<Resolution> validate() throws Exception {
FixedIndexedRepo repository = getRepository();
Set<Resource> resources = getAllResources(repository);
return validateResources(repository, resources);
}
use of aQute.bnd.deployer.repository.FixedIndexedRepo in project bnd by bndtools.
the class Utils method createRepo.
public static Repository createRepo(File index, String name) {
FixedIndexedRepo repo = new FixedIndexedRepo();
Map<String, String> props = new HashMap<String, String>();
props.put(FixedIndexedRepo.PROP_LOCATIONS, index.toURI().toString());
if (name != null)
props.put(AbstractIndexedRepo.PROP_NAME, name);
repo.setProperties(props);
return repo;
}
use of aQute.bnd.deployer.repository.FixedIndexedRepo in project bnd by bndtools.
the class Utils method createRepo.
public static Repository createRepo(URI uri, String name) {
FixedIndexedRepo repo = new FixedIndexedRepo();
Map<String, String> props = new HashMap<String, String>();
props.put(FixedIndexedRepo.PROP_LOCATIONS, uri.toString());
if (name != null)
props.put(AbstractIndexedRepo.PROP_NAME, name);
repo.setProperties(props);
return repo;
}
use of aQute.bnd.deployer.repository.FixedIndexedRepo in project bnd by bndtools.
the class ResolveTest method testMinimalSetup.
/**
* Test minimal setup
*
* @throws URISyntaxException
* @throws MalformedURLException
*/
public void testMinimalSetup() throws MalformedURLException, URISyntaxException {
File index = IO.getFile("testdata/repo3.index.xml");
FixedIndexedRepo fir = new FixedIndexedRepo();
fir.setLocations(index.toURI().toString());
Processor model = new Processor();
model.setProperty("-runfw", "org.apache.felix.framework");
model.setProperty("-runrequires", "osgi.identity;filter:='(osgi.identity=org.apache.felix.gogo.shell)'");
BndrunResolveContext context = new BndrunResolveContext(model, null, model, log);
context.setLevel(0);
context.addRepository(fir);
context.init();
Resolver resolver = new BndResolver(new ResolverLogger(4));
try {
Map<Resource, List<Wire>> resolved = resolver.resolve(context);
Set<Resource> resources = resolved.keySet();
Resource shell = getResource(resources, "org.apache.felix.gogo.shell", "0.10.0");
assertNotNull(shell);
} catch (ResolutionException e) {
e.printStackTrace();
fail("Resolve failed");
}
}
use of aQute.bnd.deployer.repository.FixedIndexedRepo in project bndtools by bndtools.
the class ReposTemplateLoader method addPreferenceConfiguredRepos.
private static void addPreferenceConfiguredRepos(List<Repository> repos, Reporter reporter) {
BndPreferences bndPrefs = null;
try {
bndPrefs = new BndPreferences();
} catch (Exception e) {
// e.printStackTrace();
}
if (bndPrefs != null && bndPrefs.getEnableTemplateRepo()) {
List<String> repoUris = bndPrefs.getTemplateRepoUriList();
try {
FixedIndexedRepo prefsRepo = loadRepo(repoUris);
repos.add(prefsRepo);
} catch (IOException | URISyntaxException ex) {
reporter.exception(ex, "Error loading preference repository: %s", repoUris);
}
}
}
Aggregations