Skip to content

Commit

Permalink
Always include the projects resolved target platform as a source
Browse files Browse the repository at this point in the history
  • Loading branch information
laeubi committed Jan 20, 2024
1 parent e5463f5 commit 2e0d162
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 7 deletions.
10 changes: 8 additions & 2 deletions src/site/markdown/Category.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@ The following is an example, demonstrating a complex category definition.
<!-- Directly include bundles, without a feature -->
<bundle id="bundle.id" version="1.3.1.v2023"/>
<!-- Directly include any iu -->
<iu id="unit.id"/>
<!-- Include all IUs matching an expression -->
<iu>
<query>
Expand All @@ -58,7 +60,11 @@ The following is an example, demonstrating a complex category definition.
<category-def name="javax" label="Bundles starting with javax."/>
<iu>
<category name="javax"/>
<query><expression type="match">id ~= /javax.*/</expression></query>
<query>
<expression type="match">id ~= /javax.*/</expression>
</query>
</iu>
</site>
```
```

You can read more about P2 Query Syntax [here](https://wiki.eclipse.org/Equinox/p2/Query_Language_for_p2).
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,9 @@ private void setTargetEnvironments(PublisherInfo publisherInfo) {

private void handlePublisherStatus(IStatus result) {
if (result.matches(IStatus.INFO)) {
logger.info(StatusTool.collectProblems(result));
logger.info(StatusTool.toLogMessage(result));
} else if (result.matches(IStatus.WARNING)) {
logger.warn(StatusTool.collectProblems(result));

logger.warn(StatusTool.toLogMessage(result));
} else if (!result.isOK()) {
Throwable directlyIncludedException = result.getException();
throw directlyIncludedException instanceof RuntimeException runtimeEx //
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -354,15 +354,15 @@ static class LogListener implements IArtifactMirrorLog {
@Override
public void log(IArtifactDescriptor descriptor, IStatus status) {
if (!status.isOK()) {
logger.debug(MIRROR_TOOL_MESSAGE_PREFIX + StatusTool.collectProblems(status));
logger.debug(MIRROR_TOOL_MESSAGE_PREFIX + StatusTool.toLogMessage(status));
hasLogged = true;
}
}

@Override
public void log(IStatus status) {
if (!status.isOK()) {
logger.warn(MIRROR_TOOL_MESSAGE_PREFIX + StatusTool.collectProblems(status));
logger.warn(MIRROR_TOOL_MESSAGE_PREFIX + StatusTool.toLogMessage(status));
hasLogged = true;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,10 @@
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepositoryManager;
import org.eclipse.tycho.TargetPlatform;
import org.eclipse.tycho.p2.repository.ListCompositeMetadataRepository;
import org.eclipse.tycho.p2.tools.DestinationRepositoryDescriptor;
import org.eclipse.tycho.p2.tools.RepositoryReference;
import org.eclipse.tycho.p2maven.ListCompositeArtifactRepository;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -94,6 +96,26 @@ protected IArtifactRepository initializeDestination(RepositoryDescriptor toInit,
return result;
}

@Override
public IArtifactRepository getCompositeArtifactRepository() {
IArtifactRepository repository = super.getCompositeArtifactRepository();
if (targetPlatform != null) {
return new ListCompositeArtifactRepository(List.of(repository, targetPlatform.getArtifactRepository()),
agent);
}
return repository;
}

@Override
public IMetadataRepository getCompositeMetadataRepository() {
IMetadataRepository repository = super.getCompositeMetadataRepository();
if (targetPlatform != null) {
return new ListCompositeMetadataRepository(List.of(repository, targetPlatform.getMetadataRepository()),
agent);
}
return repository;
}

@Override
protected Slicer createSlicer(SlicingOptions options) {
List<Map<String, String>> filters = getContextFilters();
Expand Down

0 comments on commit 2e0d162

Please sign in to comment.