Search in sources :

Example 6 with InstallableUnitLocation

use of org.eclipse.tycho.p2.target.facade.TargetDefinition.InstallableUnitLocation in project tycho by eclipse.

the class TargetDefinitionResolver method resolveContentWithExceptions.

TargetDefinitionContent resolveContentWithExceptions(TargetDefinition definition) throws TargetDefinitionSyntaxException, TargetDefinitionResolutionException, ResolverException {
    List<URI> artifactRepositories = new ArrayList<>();
    ResolverRun resolverRun = new ResolverRun();
    for (Location locationDefinition : definition.getLocations()) {
        if (locationDefinition instanceof InstallableUnitLocation) {
            resolverRun.addLocation((InstallableUnitLocation) locationDefinition);
            for (Repository repository : ((InstallableUnitLocation) locationDefinition).getRepositories()) {
                artifactRepositories.add(repository.getLocation());
            }
        } else {
            logger.warn("Target location type '" + locationDefinition.getTypeDescription() + "' is not supported");
        }
    }
    if (definition.hasIncludedBundles()) {
        // the bundle selection list is currently not taken into account (see bug 373776)
        logger.warn("De-selecting bundles in a target definition file is not supported. See http://wiki.eclipse.org/Tycho_Messages_Explained#Target_File_Include_Bundles for alternatives.");
    }
    return new TargetDefinitionContent(resolverRun.resolve(), artifactRepositories);
}
Also used : IMetadataRepository(org.eclipse.equinox.p2.repository.metadata.IMetadataRepository) Repository(org.eclipse.tycho.p2.target.facade.TargetDefinition.Repository) InstallableUnitLocation(org.eclipse.tycho.p2.target.facade.TargetDefinition.InstallableUnitLocation) ArrayList(java.util.ArrayList) URI(java.net.URI) InstallableUnitLocation(org.eclipse.tycho.p2.target.facade.TargetDefinition.InstallableUnitLocation) Location(org.eclipse.tycho.p2.target.facade.TargetDefinition.Location)

Aggregations

InstallableUnitLocation (org.eclipse.tycho.p2.target.facade.TargetDefinition.InstallableUnitLocation)6 Test (org.junit.Test)4 URI (java.net.URI)1 ArrayList (java.util.ArrayList)1 IMetadataRepository (org.eclipse.equinox.p2.repository.metadata.IMetadataRepository)1 Location (org.eclipse.tycho.p2.target.facade.TargetDefinition.Location)1 Repository (org.eclipse.tycho.p2.target.facade.TargetDefinition.Repository)1