Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport/tycho 4.0.x/pr 3801 #3805

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,36 +30,36 @@ with Maven.

Just get in contact with us through the [discussions](https://github.com/eclipse-tycho/tycho/discussions) and share your [ideas](https://github.com/eclipse-tycho/tycho/discussions/new) or report [issues](https://github.com/eclipse-tycho/tycho/issues).

Please bear in mind that this is a community project, and not a product you contracted support for and as a result, some contributors may or may not look at your support requests on demand and if you do not provide the fix/implementation yourself the issue might even never get fixed.
Please bear in mind that this is a community project and not a product you contracted support for and as a result, some contributors may or may not look at your support requests on demand and if you do not provide the fix/implementation yourself, the issue might even never get fixed.

If you require dedicated help with Tycho, want to make sure a bugfix or feature is handled with priority, the following companies offers commercial support for Tycho
If you require dedicated help with Tycho or want to make sure a bugfix or feature is handled with priority, the following companies offer commercial support for Tycho
* ![](https://läubisoft.gmbh/favicon.ico) [Läubisoft GmbH](https://xn--lubisoft-0za.gmbh/en/)


# Support Tycho

In general, if Tycho is key technology for your Organization, you can help with the following things:
In general, if Tycho is a key technology for your Organization, you can help with the following:

### Help testing
Test snapshots of Tycho early and often so that regressions are found early before we start the release process, this gives faster release and maybe even more often releases if we are certain that snapshots are production-ready.
Test snapshots of Tycho early and often so that regressions are found early before we start the release process. This results in faster releases and maybe even more frequent releases if we are certain that snapshots are production-ready.

### Donate some time
Consider donate some developer time to improve code (e.g. fixing bugs), enhancing documentation, help with review of open PRs, [answer questions on the discussions](https://github.com/eclipse-tycho/tycho/discussions), or [providing integration test](https://github.com/eclipse-tycho/tycho/wiki#providing-an-integration-test) to cover your important features.
Consider donating some developer time to improve code (e.g., fixing bugs), enhance documentation, help with review of open PRs, [answer questions on the discussions](https://github.com/eclipse-tycho/tycho/discussions), or [providing integration tests](https://github.com/eclipse-tycho/tycho/wiki#providing-an-integration-test) to cover your important features.

## Sponsor individual contributors
If you want to help with development of Tycho itself but can't afford to do it by yourself, you can sponsor some of the contributors of Tycho directly:
If you want to help with the development of Tycho itself but can't afford to do it by yourself, you can sponsor some of the contributors of Tycho directly:

* [Christoph Läubrich](https://github.com/sponsors/laeubi) - A sample of his recent work can be seen [here](https://github.com/eclipse-tycho/tycho/commits?author=laeubi).

### Support us with processing power
Tycho has a very large user-base and thus we use exhaustive test-suites to ensure everything works well. This comes at a cost of also using a lot of processing power.

The following Organizations support Tycho getting processing power for their builds:
The following Organizations support Tycho by providing processing power for their builds:
* <img src="https://www.eclipse.org/favicon.ico" width="16" height="16"> [Eclipse Foundation](https://www.eclipse.org/sponsor/) - host our CI Infrastructure, become a friend of Eclipse and support the Eclipse Foundation in general
* <img src="https://www.renesas.com/favicon.ico" width="16" height="16"> [Renesas Electronics Corporation](https://www.eclipse.org/membership/showMember.php?member_id=1069) - sponsors a resource pack with 2 CPU / 8 GB RAM
* <img src="https://www.sap.com/favicon.ico" width="16" height="16"> [SAP SE](https://www.eclipse.org/membership/showMember.php?member_id=665) - sponsors two resource packs with 2 CPU / 8 GB RAM each
* <img src="https://www.redhat.com/themes/custom/rhdc/favicon.ico" width="16" height="16"> [Red Hat, Inc.](https://www.eclipse.org/membership/showMember.php?member_id=731) - sponsors a resource pack with 2 CPU / 8 GB RAM
* <img src="https://www.redhat.com/favicon.ico" width="16" height="16"> [Red Hat, Inc.](https://www.eclipse.org/membership/showMember.php?member_id=731) - sponsors a resource pack with 2 CPU / 8 GB RAM
* <img src="https://www.sigasi.com/img/logoSquare.png" width="16" height="16"> [Sigasi](https://www.eclipse.org/membership/showMember.php?member_id=990) - sponsors a resource pack with 2 CPU / 8 GB RAM


If your Organizations is an [Eclipse Member](https://www.eclipse.org/membership/exploreMembership.php) you can help us by [sponsoring one of the included resource packs](https://github.com/eclipse-cbi/cbi/wiki#assigning-additional-resources-to-a-project) to speed up builds. Organizations can check how many Resource Packs they have left for project sponsoring on the [membership portal](https://membership.eclipse.org/portal/login).
If your Organization is an [Eclipse Member](https://www.eclipse.org/membership/exploreMembership.php) you can help us by [sponsoring one of the included resource packs](https://github.com/eclipse-cbi/cbi/wiki#assigning-additional-resources-to-a-project) to speed up builds. Organizations can check how many Resource Packs they have left for project sponsoring on the [membership portal](https://membership.eclipse.org/portal/login).
8 changes: 8 additions & 0 deletions tycho-baseline-plugin/.settings/org.eclipse.jdt.core.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=17
org.eclipse.jdt.core.compiler.compliance=17
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=17
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ private static void loadMetadataRepositories(URI uri, String id, Map<URI, IMetad
Collection<IRepositoryReference> references = repository.getReferences();
subMonitor.setWorkRemaining(references.size());
for (IRepositoryReference reference : references) {
if ((reference.getOptions() | IRepository.ENABLED) != 0) {
if ((reference.getOptions() & IRepository.ENABLED) != 0) {
URI location = reference.getLocation();
if (reference.getType() == IRepository.TYPE_METADATA) {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ private ProjectorResolutionStrategy getPlannerResolutionStrategy(ResolutionData
throws TargetDefinitionResolutionException {
if (includeAllEnvironments) {
logger.warn(
"includeAllPlatforms='true' and includeMode='planner' are incompatible. ignore includeAllPlatforms flag");
"includeAllPlatforms='true' and includeMode='planner' are incompatible. Ignoring 'includeAllPlatforms' flag");
}
ProjectorResolutionStrategy strategy = new ProjectorResolutionStrategy(logger);
strategy.setData(data);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
import org.eclipse.tycho.targetplatform.TargetDefinition;
import org.eclipse.tycho.targetplatform.TargetDefinition.DirectoryLocation;
import org.eclipse.tycho.targetplatform.TargetDefinition.FeaturesLocation;
import org.eclipse.tycho.targetplatform.TargetDefinition.FollowRepositoryReferences;
import org.eclipse.tycho.targetplatform.TargetDefinition.InstallableUnitLocation;
import org.eclipse.tycho.targetplatform.TargetDefinition.Location;
import org.eclipse.tycho.targetplatform.TargetDefinition.MavenGAVLocation;
Expand Down Expand Up @@ -141,20 +142,29 @@ public TargetDefinitionContent resolveContentWithExceptions(TargetDefinition def
Map<String, URITargetDefinitionContent> uriRepositories = new LinkedHashMap<>();
List<TargetDefinitionContent> mavenLocations = new ArrayList<>();
List<TargetDefinitionContent> referencedTargetLocations = new ArrayList<>();
List<TargetDefinitionContent> repositorytLocations = new ArrayList<>();
List<TargetDefinitionContent> repositoryLocations = new ArrayList<>();
for (Location locationDefinition : definition.getLocations()) {
if (locationDefinition instanceof InstallableUnitLocation installableUnitLocation) {
if (installableUnitResolver == null) {
installableUnitResolver = new InstallableUnitResolver(environments, executionEnvironment,
includeSourceMode, logger);
}
List<URITargetDefinitionContent> locations = new ArrayList<>();
var followRepositoryReferences = installableUnitLocation.followRepositoryReferences();
final ReferencedRepositoryMode followReferences;
if (followRepositoryReferences == FollowRepositoryReferences.DEFAULT) {
followReferences = referencedRepositoryMode;
} else if (followRepositoryReferences == FollowRepositoryReferences.ENABLED) {
followReferences = ReferencedRepositoryMode.include;
} else {
followReferences = ReferencedRepositoryMode.ignore;
}
for (Repository repository : installableUnitLocation.getRepositories()) {
URI location = resolveRepositoryLocation(repository.getLocation());
String key = location.normalize().toASCIIString();
locations.add(
uriRepositories.computeIfAbsent(key, s -> new URITargetDefinitionContent(provisioningAgent,
location, repository.getId(), referencedRepositoryMode, logger)));
location, repository.getId(), followReferences, logger)));
}
IQueryable<IInstallableUnit> locationUnits = QueryUtil.compoundQueryable(locations);
Collection<IInstallableUnit> rootUnits = installableUnitResolver
Expand Down Expand Up @@ -234,7 +244,7 @@ public TargetDefinitionContent resolveContentWithExceptions(TargetDefinition def
logger.info("Loading " + resolvedUri + "...");
RepositoryLocationContent content = new RepositoryLocationContent(resolvedUri,
repositoryLocation.getRequirements(), provisioningAgent, logger);
repositorytLocations.add(content);
repositoryLocations.add(content);
IQueryResult<IInstallableUnit> result = content.query(QueryUtil.ALL_UNITS,
new LoggingProgressMonitor(logger));
unitResultSet.addAll(result);
Expand Down Expand Up @@ -273,7 +283,7 @@ public TargetDefinitionContent resolveContentWithExceptions(TargetDefinition def
artifactRepositories.add(referenceContent.getArtifactRepository());
}
//preliminary step: add all repository locations:
for (TargetDefinitionContent referenceContent : repositorytLocations) {
for (TargetDefinitionContent referenceContent : repositoryLocations) {
metadataRepositories.add(referenceContent.getMetadataRepository());
artifactRepositories.add(referenceContent.getArtifactRepository());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,11 @@ public boolean includeAllEnvironments() {
public boolean includeSource() {
return false;
}

@Override
public boolean includeConfigurePhase() {
return false;
}
}

private static class OtherLocationStub implements Location {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,11 @@ public boolean includeAllEnvironments() {
public boolean includeSource() {
return false;
}

@Override
public boolean includeConfigurePhase() {
return false;
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import org.eclipse.tycho.core.resolver.P2ResolutionResult;
import org.eclipse.tycho.p2resolver.TargetDefinitionVariableResolver;
import org.eclipse.tycho.targetplatform.TargetDefinition;
import org.eclipse.tycho.targetplatform.TargetDefinition.FollowRepositoryReferences;
import org.eclipse.tycho.targetplatform.TargetDefinition.IncludeMode;
import org.eclipse.tycho.targetplatform.TargetDefinition.InstallableUnitLocation;
import org.eclipse.tycho.targetplatform.TargetDefinition.Unit;
Expand Down Expand Up @@ -170,6 +171,16 @@ public boolean includeSource() {
return delegate.includeSource();
}

@Override
public boolean includeConfigurePhase() {
return delegate.includeConfigurePhase();
}

@Override
public FollowRepositoryReferences followRepositoryReferences() {
return delegate.followRepositoryReferences();
}

}

private static final class LatestVersionUnit implements TargetDefinition.Unit {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
* <pre>
&lt;repository>
&lt;id>my-p2-maven-site</id>
&lt;url>mvn:[grouId]:[artifactId]:[version]:zip:p2site</url>
&lt;url>mvn:[groupId]:[artifactId]:[version]:zip:p2site</url>
&lt;layout>p2</layout>
&lt;/repository>
* </pre>
Expand All @@ -106,7 +106,7 @@
*
* <pre>
* &lt;location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
&lt;repository location="mvn:[grouId]:[artifactId]:[version]:zip:p2site"/>
&lt;repository location="mvn:[groupId]:[artifactId]:[version]:zip:p2site"/>
-- list desired units here --
&lt;/location>
* </pre>
Expand Down
8 changes: 8 additions & 0 deletions tycho-p2/.settings/org.eclipse.jdt.core.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=17
org.eclipse.jdt.core.compiler.compliance=17
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=17
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=1.8
2 changes: 1 addition & 1 deletion tycho-targetplatform/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</parent>
<artifactId>tycho-targetplatform</artifactId>
<name>Tycho Target Platform</name>
<description>Contains the neccesary bits to handle target platform files.</description>
<description>Contains the necessary bits to handle target platform files.</description>
<dependencies>
<dependency>
<groupId>org.eclipse.tycho</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import java.util.List;
import java.util.Properties;

import org.bouncycastle.jcajce.provider.drbg.DRBG.Default;
import org.eclipse.tycho.IArtifactFacade;
import org.eclipse.tycho.MavenArtifactRepositoryReference;
import org.osgi.resource.Requirement;
Expand Down Expand Up @@ -66,10 +67,16 @@ public interface Location {

}

public enum FollowRepositoryReferences {
DEFAULT,
ENABLED,
DISABLED,
}

public interface InstallableUnitLocation extends Location {

public static String TYPE = "InstallableUnit";

public List<? extends Repository> getRepositories();

public List<? extends Unit> getUnits();
Expand All @@ -79,6 +86,19 @@ public interface InstallableUnitLocation extends Location {
public boolean includeAllEnvironments();

public boolean includeSource();

/**
* Read for completeness but not used
*/
public boolean includeConfigurePhase();

/**
* When {@link FollowRepositoryReferences.Default} the global {@link IncludeSourceMode} should be used instead.
* @return whether repository references should be used, never null
*/
public default FollowRepositoryReferences followRepositoryReferences() {
return FollowRepositoryReferences.DEFAULT;
}

@Override
public default String getTypeDescription() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -413,14 +413,19 @@ private static class IULocation implements TargetDefinition.InstallableUnitLocat
private final IncludeMode includeMode;
private final boolean includeAllEnvironments;
private final boolean includeSource;
private final boolean includeConfigurePhase;
private final FollowRepositoryReferences followRepositoryReferences;

IULocation(List<Unit> units, List<Repository> repositories, IncludeMode includeMode,
boolean includeAllEnvironments, boolean includeSource) {
boolean includeAllEnvironments, boolean includeSource, boolean includeConfigurePhase,
FollowRepositoryReferences followRepositoryReferences) {
this.units = units;
this.repositories = repositories;
this.includeMode = includeMode;
this.includeAllEnvironments = includeAllEnvironments;
this.includeSource = includeSource;
this.includeConfigurePhase = includeConfigurePhase;
this.followRepositoryReferences = followRepositoryReferences;
}

@Override
Expand All @@ -447,6 +452,16 @@ public boolean includeAllEnvironments() {
public boolean includeSource() {
return includeSource;
}

@Override
public boolean includeConfigurePhase() {
return includeConfigurePhase;
}

@Override
public FollowRepositoryReferences followRepositoryReferences() {
return followRepositoryReferences;
}
}

private static class OtherLocation implements Location {
Expand Down Expand Up @@ -743,9 +758,23 @@ private static IULocation parseIULocation(Element dom) {
String uri = node.getAttribute("location");
repositories.add(new Repository(id, uri));
}

String rawFollowRepositoryReferences = dom.getAttribute("followRepositoryReferences");
final FollowRepositoryReferences followRepositoryReferences;
if (rawFollowRepositoryReferences == null || rawFollowRepositoryReferences.isEmpty()) {
followRepositoryReferences = FollowRepositoryReferences.DEFAULT;
} else if (Boolean.parseBoolean(rawFollowRepositoryReferences)) {
followRepositoryReferences = FollowRepositoryReferences.ENABLED;
} else {
followRepositoryReferences = FollowRepositoryReferences.DISABLED;
}

return new IULocation(Collections.unmodifiableList(units), Collections.unmodifiableList(repositories),
parseIncludeMode(dom), Boolean.parseBoolean(dom.getAttribute("includeAllPlatforms")),
Boolean.parseBoolean(dom.getAttribute("includeSource")));
Boolean.parseBoolean(dom.getAttribute("includeSource")),
Boolean.parseBoolean(dom.getAttribute("includeConfigurePhase")),
followRepositoryReferences
);
}

private static String parseTargetEE(Element dom) {
Expand Down
Loading