diff --git a/README.md b/README.md index 15c9906c56..afa71d0ced 100644 --- a/README.md +++ b/README.md @@ -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: * [Eclipse Foundation](https://www.eclipse.org/sponsor/) - host our CI Infrastructure, become a friend of Eclipse and support the Eclipse Foundation in general * [Renesas Electronics Corporation](https://www.eclipse.org/membership/showMember.php?member_id=1069) - sponsors a resource pack with 2 CPU / 8 GB RAM * [SAP SE](https://www.eclipse.org/membership/showMember.php?member_id=665) - sponsors two resource packs with 2 CPU / 8 GB RAM each -* [Red Hat, Inc.](https://www.eclipse.org/membership/showMember.php?member_id=731) - sponsors a resource pack with 2 CPU / 8 GB RAM +* [Red Hat, Inc.](https://www.eclipse.org/membership/showMember.php?member_id=731) - sponsors a resource pack with 2 CPU / 8 GB RAM * [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). diff --git a/tycho-baseline-plugin/.settings/org.eclipse.jdt.core.prefs b/tycho-baseline-plugin/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000000..cf2cd4590a --- /dev/null +++ b/tycho-baseline-plugin/.settings/org.eclipse.jdt.core.prefs @@ -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 diff --git a/tycho-core/src/main/java/org/eclipse/tycho/p2/resolver/URITargetDefinitionContent.java b/tycho-core/src/main/java/org/eclipse/tycho/p2/resolver/URITargetDefinitionContent.java index ce36f8fe1f..36f05b2b82 100644 --- a/tycho-core/src/main/java/org/eclipse/tycho/p2/resolver/URITargetDefinitionContent.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/p2/resolver/URITargetDefinitionContent.java @@ -125,7 +125,7 @@ private static void loadMetadataRepositories(URI uri, String id, Map 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 { diff --git a/tycho-core/src/main/java/org/eclipse/tycho/p2resolver/InstallableUnitResolver.java b/tycho-core/src/main/java/org/eclipse/tycho/p2resolver/InstallableUnitResolver.java index c6524a233d..6edba2fa89 100644 --- a/tycho-core/src/main/java/org/eclipse/tycho/p2resolver/InstallableUnitResolver.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/p2resolver/InstallableUnitResolver.java @@ -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); diff --git a/tycho-core/src/main/java/org/eclipse/tycho/p2resolver/TargetDefinitionResolver.java b/tycho-core/src/main/java/org/eclipse/tycho/p2resolver/TargetDefinitionResolver.java index 49df237316..a2cd62978f 100644 --- a/tycho-core/src/main/java/org/eclipse/tycho/p2resolver/TargetDefinitionResolver.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/p2resolver/TargetDefinitionResolver.java @@ -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; @@ -141,7 +142,7 @@ public TargetDefinitionContent resolveContentWithExceptions(TargetDefinition def Map uriRepositories = new LinkedHashMap<>(); List mavenLocations = new ArrayList<>(); List referencedTargetLocations = new ArrayList<>(); - List repositorytLocations = new ArrayList<>(); + List repositoryLocations = new ArrayList<>(); for (Location locationDefinition : definition.getLocations()) { if (locationDefinition instanceof InstallableUnitLocation installableUnitLocation) { if (installableUnitResolver == null) { @@ -149,12 +150,21 @@ public TargetDefinitionContent resolveContentWithExceptions(TargetDefinition def includeSourceMode, logger); } List 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 locationUnits = QueryUtil.compoundQueryable(locations); Collection rootUnits = installableUnitResolver @@ -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 result = content.query(QueryUtil.ALL_UNITS, new LoggingProgressMonitor(logger)); unitResultSet.addAll(result); @@ -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()); } diff --git a/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/TargetDefinitionResolverTest.java b/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/TargetDefinitionResolverTest.java index f05aeb264c..81717fa5c9 100644 --- a/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/TargetDefinitionResolverTest.java +++ b/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/TargetDefinitionResolverTest.java @@ -366,6 +366,11 @@ public boolean includeAllEnvironments() { public boolean includeSource() { return false; } + + @Override + public boolean includeConfigurePhase() { + return false; + } } private static class OtherLocationStub implements Location { diff --git a/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/TargetDefinitionResolverWithPlatformSpecificUnitsTest.java b/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/TargetDefinitionResolverWithPlatformSpecificUnitsTest.java index fbb9a72dd0..582a7c7f4a 100644 --- a/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/TargetDefinitionResolverWithPlatformSpecificUnitsTest.java +++ b/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/TargetDefinitionResolverWithPlatformSpecificUnitsTest.java @@ -203,6 +203,11 @@ public boolean includeAllEnvironments() { public boolean includeSource() { return false; } + + @Override + public boolean includeConfigurePhase() { + return false; + } } } diff --git a/tycho-extras/tycho-version-bump-plugin/src/main/java/org/eclipse/tycho/versionbump/UpdateTargetMojo.java b/tycho-extras/tycho-version-bump-plugin/src/main/java/org/eclipse/tycho/versionbump/UpdateTargetMojo.java index 3d1a1f1557..9c6e9dce55 100644 --- a/tycho-extras/tycho-version-bump-plugin/src/main/java/org/eclipse/tycho/versionbump/UpdateTargetMojo.java +++ b/tycho-extras/tycho-version-bump-plugin/src/main/java/org/eclipse/tycho/versionbump/UpdateTargetMojo.java @@ -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; @@ -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 { diff --git a/tycho-p2-repository-plugin/src/main/java/org/eclipse/tycho/plugins/p2/repository/MavenP2SiteMojo.java b/tycho-p2-repository-plugin/src/main/java/org/eclipse/tycho/plugins/p2/repository/MavenP2SiteMojo.java index 21dd727a11..cd3d935c85 100644 --- a/tycho-p2-repository-plugin/src/main/java/org/eclipse/tycho/plugins/p2/repository/MavenP2SiteMojo.java +++ b/tycho-p2-repository-plugin/src/main/java/org/eclipse/tycho/plugins/p2/repository/MavenP2SiteMojo.java @@ -97,7 +97,7 @@ *
     <repository>
     <id>my-p2-maven-site
-        <url>mvn:[grouId]:[artifactId]:[version]:zip:p2site
+        <url>mvn:[groupId]:[artifactId]:[version]:zip:p2site
         <layout>p2
     </repository>
  * 
@@ -106,7 +106,7 @@ * *
  *  <location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
-        <repository location="mvn:[grouId]:[artifactId]:[version]:zip:p2site"/>
+        <repository location="mvn:[groupId]:[artifactId]:[version]:zip:p2site"/>
         -- list desired units here --
     </location>
  * 
diff --git a/tycho-p2/.settings/org.eclipse.jdt.core.prefs b/tycho-p2/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000000..cf2cd4590a --- /dev/null +++ b/tycho-p2/.settings/org.eclipse.jdt.core.prefs @@ -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 diff --git a/tycho-surefire/org.eclipse.tycho.bnd.executionlistener/.settings/org.eclipse.jdt.core.prefs b/tycho-surefire/org.eclipse.tycho.bnd.executionlistener/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000000..2f5cc74c3a --- /dev/null +++ b/tycho-surefire/org.eclipse.tycho.bnd.executionlistener/.settings/org.eclipse.jdt.core.prefs @@ -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 diff --git a/tycho-targetplatform/pom.xml b/tycho-targetplatform/pom.xml index 093caa7059..269d327a83 100644 --- a/tycho-targetplatform/pom.xml +++ b/tycho-targetplatform/pom.xml @@ -7,7 +7,7 @@ tycho-targetplatform Tycho Target Platform - Contains the neccesary bits to handle target platform files. + Contains the necessary bits to handle target platform files. org.eclipse.tycho diff --git a/tycho-targetplatform/src/main/java/org/eclipse/tycho/targetplatform/TargetDefinition.java b/tycho-targetplatform/src/main/java/org/eclipse/tycho/targetplatform/TargetDefinition.java index 1a0683df41..27bc5c2103 100644 --- a/tycho-targetplatform/src/main/java/org/eclipse/tycho/targetplatform/TargetDefinition.java +++ b/tycho-targetplatform/src/main/java/org/eclipse/tycho/targetplatform/TargetDefinition.java @@ -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; @@ -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 getRepositories(); public List getUnits(); @@ -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() { diff --git a/tycho-targetplatform/src/main/java/org/eclipse/tycho/targetplatform/TargetDefinitionFile.java b/tycho-targetplatform/src/main/java/org/eclipse/tycho/targetplatform/TargetDefinitionFile.java index 53549f0cd5..01ecc755d2 100644 --- a/tycho-targetplatform/src/main/java/org/eclipse/tycho/targetplatform/TargetDefinitionFile.java +++ b/tycho-targetplatform/src/main/java/org/eclipse/tycho/targetplatform/TargetDefinitionFile.java @@ -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 units, List 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 @@ -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 { @@ -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) {