Skip to content

Commit

Permalink
Print added repository-references when assembly a p2-repository
Browse files Browse the repository at this point in the history
  • Loading branch information
HannesWell committed Sep 5, 2023
1 parent 5cfd3a0 commit bd7d483
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,12 @@
import org.eclipse.tycho.TargetPlatform;
import org.eclipse.tycho.p2.tools.DestinationRepositoryDescriptor;
import org.eclipse.tycho.p2.tools.RepositoryReference;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class TychoMirrorApplication extends org.eclipse.tycho.p2tools.copiedfromp2.MirrorApplication {

private static final Logger LOGGER = LoggerFactory.getLogger(TychoMirrorApplication.class);
private static final String SOURCE_SUFFIX = ".source";
private static final String FEATURE_GROUP = ".feature.group";
private final Map<String, String> extraArtifactRepositoryProperties;
Expand Down Expand Up @@ -275,6 +278,16 @@ private <T> List<Entry<URI, IRepository<T>>> removeProvidedItems(Collection<T> a
return referencedRepositories;
}

@Override
protected void finalizeRepositories() {
Collection<IRepositoryReference> references = getDestinationMetadataRepository().getReferences();
if (!references.isEmpty()) {
LOGGER.info("Adding references to the following repositories:");
references.stream().map(r -> r.getLocation()).distinct().forEach(loc -> LOGGER.info(" {}", loc));
}
super.finalizeRepositories();
}

//TODO: just call IRepositoryManager.loadRepository() once available: https://github.com/eclipse-equinox/p2/pull/311
@SuppressWarnings("unchecked")
private static <T> IRepository<T> loadRepository(IRepositoryManager<T> mgr, URI location, IProgressMonitor monitor)
Expand Down

0 comments on commit bd7d483

Please sign in to comment.