diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 2b63786076..b54da2b191 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -43,7 +43,7 @@ jobs: - name: Set up Maven uses: stCarolas/setup-maven@v4.5 with: - maven-version: 3.9.0 + maven-version: 3.9.2 - name: Build Tycho env: JAVA_HOME: ${{ env.JAVA_HOME_17_X64 }} diff --git a/.github/workflows/sitedocs.yml b/.github/workflows/sitedocs.yml index 26a95bd5bb..0a6e9c563a 100644 --- a/.github/workflows/sitedocs.yml +++ b/.github/workflows/sitedocs.yml @@ -44,7 +44,7 @@ jobs: - name: Set up Maven uses: stCarolas/setup-maven@v4.5 with: - maven-version: 3.8.6 + maven-version: 3.9.2 - name: Build site-doc env: JAVA_HOME: ${{ env.JAVA_HOME_17_X64 }} diff --git a/.github/workflows/verify-platform.yml b/.github/workflows/verify-platform.yml index fe3bf35e52..7b4f968b84 100644 --- a/.github/workflows/verify-platform.yml +++ b/.github/workflows/verify-platform.yml @@ -45,7 +45,7 @@ jobs: - name: Set up Maven uses: stCarolas/setup-maven@v4.5 with: - maven-version: 3.8.6 + maven-version: 3.9.2 - name: Build Tycho env: JAVA_HOME: ${{ env.JAVA_HOME_17_X64 }} diff --git a/.github/workflows/verify-platform2.yml b/.github/workflows/verify-platform2.yml index 4713356f8e..bb2443115e 100644 --- a/.github/workflows/verify-platform2.yml +++ b/.github/workflows/verify-platform2.yml @@ -45,7 +45,7 @@ jobs: - name: Set up Maven uses: stCarolas/setup-maven@v4.5 with: - maven-version: 3.8.6 + maven-version: 3.9.2 - name: Build Tycho env: JAVA_HOME: ${{ env.JAVA_HOME_17_X64 }} diff --git a/Jenkinsfile b/Jenkinsfile index b45c32bcff..e783ad7388 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -18,7 +18,7 @@ pipeline { label agentLabel } tools { - maven 'apache-maven-3.8.6' + maven 'apache-maven-3.9.1' jdk 'openjdk-jdk17-latest' } stages { diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 0baa355f76..c03c0f22f3 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -245,6 +245,13 @@ This can be disabled with the following configuration in the pom: ``` +### Variable resolution in target repository location + +URI in `` in `*.target` files can contain: +- Environment variable as `${env_var:MY_VARIABLE}` +- System variable as `${system_property:myProp}` passed at build time as `-DmyProp` +- Project location as `${project_loc:ProjectName}` + ### Migration guide 3.x > 4.x ### New delayed target platform resolving diff --git a/p2-maven-plugin/pom.xml b/p2-maven-plugin/pom.xml index c5353b50b3..d71618fdcd 100644 --- a/p2-maven-plugin/pom.xml +++ b/p2-maven-plugin/pom.xml @@ -21,6 +21,9 @@ P2 Maven Integration The P2 Maven Plugin provides access to the P2 eco-system inside maven. + + ${minimal-maven-version} + org.eclipse.platform diff --git a/pom.xml b/pom.xml index 2cec23e769..d68d3170cc 100644 --- a/pom.xml +++ b/pom.xml @@ -47,9 +47,6 @@ https://projects.eclipse.org/projects/technology.tycho - - 3.8.6 - org.eclipse.tycho tycho 4.0.0-SNAPSHOT @@ -68,6 +65,7 @@ 3.9.0 6.5.0.202303070854-r 3.9.2 + 3.9.0 3.1.0 @@ -335,6 +333,9 @@ + + class + org.apache.maven.plugins @@ -489,7 +490,7 @@ ${pluginToolsVersion} - ${maven-version} + ${minimal-maven-version} ${min.jdk.version} @@ -497,7 +498,7 @@ org.apache.maven.plugins maven-project-info-reports-plugin - 3.4.3 + 3.4.4 @@ -510,6 +511,7 @@ tycho-bundles + tycho-api sisu-osgi p2-maven-plugin tycho-metadata-model @@ -531,7 +533,10 @@ tycho-versions-plugin - tycho-p2 + tycho-p2-director-plugin + tycho-p2-plugin + tycho-p2-publisher-plugin + tycho-p2-repository-plugin tycho-artifactcomparator tycho-gpg-plugin tycho-extras diff --git a/sisu-osgi/sisu-equinox-launching/pom.xml b/sisu-osgi/sisu-equinox-launching/pom.xml index 3be1ea455b..0080db49d3 100644 --- a/sisu-osgi/sisu-equinox-launching/pom.xml +++ b/sisu-osgi/sisu-equinox-launching/pom.xml @@ -27,12 +27,7 @@ org.eclipse.tycho - org.eclipse.tycho.core.shared - ${project.version} - - - org.eclipse.tycho - org.eclipse.tycho.embedder.shared + tycho-api ${project.version} diff --git a/target-platform-configuration/pom.xml b/target-platform-configuration/pom.xml index 5a27fe162d..1711f46219 100644 --- a/target-platform-configuration/pom.xml +++ b/target-platform-configuration/pom.xml @@ -21,7 +21,9 @@ target-platform-configuration maven-plugin - + + ${minimal-maven-version} + Tycho Target Platform Configuration Plugin diff --git a/target-platform-configuration/src/main/java/org/eclipse/tycho/target/TargetPlatformConfigurationMojo.java b/target-platform-configuration/src/main/java/org/eclipse/tycho/target/TargetPlatformConfigurationMojo.java index 7939a70778..fa649db7ad 100644 --- a/target-platform-configuration/src/main/java/org/eclipse/tycho/target/TargetPlatformConfigurationMojo.java +++ b/target-platform-configuration/src/main/java/org/eclipse/tycho/target/TargetPlatformConfigurationMojo.java @@ -22,11 +22,11 @@ import org.apache.maven.plugins.annotations.Mojo; import org.apache.maven.plugins.annotations.Parameter; import org.eclipse.tycho.TargetEnvironment; -import org.eclipse.tycho.artifacts.TargetPlatformFilter.CapabilityPattern; import org.eclipse.tycho.core.TargetPlatformConfiguration.BREEHeaderSelectionPolicy; import org.eclipse.tycho.core.resolver.DefaultTargetPlatformConfigurationReader; import org.eclipse.tycho.core.resolver.shared.IncludeSourceMode; import org.eclipse.tycho.core.resolver.shared.PomDependencies; +import org.eclipse.tycho.targetplatform.TargetPlatformFilter.CapabilityPattern; /** * Configures the target-platform to use in order to resolve dependencies.
diff --git a/tycho-bundles/org.eclipse.tycho.embedder.shared/.gitignore b/tycho-api/.gitignore similarity index 100% rename from tycho-bundles/org.eclipse.tycho.embedder.shared/.gitignore rename to tycho-api/.gitignore diff --git a/tycho-bundles/org.eclipse.tycho.embedder.shared/.settings/org.eclipse.jdt.core.prefs b/tycho-api/.settings/org.eclipse.jdt.core.prefs similarity index 100% rename from tycho-bundles/org.eclipse.tycho.embedder.shared/.settings/org.eclipse.jdt.core.prefs rename to tycho-api/.settings/org.eclipse.jdt.core.prefs diff --git a/tycho-bundles/org.eclipse.tycho.embedder.shared/.settings/org.eclipse.jdt.ui.prefs b/tycho-api/.settings/org.eclipse.jdt.ui.prefs similarity index 100% rename from tycho-bundles/org.eclipse.tycho.embedder.shared/.settings/org.eclipse.jdt.ui.prefs rename to tycho-api/.settings/org.eclipse.jdt.ui.prefs diff --git a/tycho-bundles/org.eclipse.tycho.embedder.shared/build.properties b/tycho-api/build.properties similarity index 100% rename from tycho-bundles/org.eclipse.tycho.embedder.shared/build.properties rename to tycho-api/build.properties diff --git a/tycho-bundles/org.eclipse.tycho.embedder.shared/pom.xml b/tycho-api/pom.xml similarity index 94% rename from tycho-bundles/org.eclipse.tycho.embedder.shared/pom.xml rename to tycho-api/pom.xml index 1590f3515f..4ebb4d6db1 100644 --- a/tycho-bundles/org.eclipse.tycho.embedder.shared/pom.xml +++ b/tycho-api/pom.xml @@ -17,10 +17,9 @@ org.eclipse.tycho tycho 4.0.0-SNAPSHOT - ../../pom.xml - org.eclipse.tycho.embedder.shared + tycho-api jar Tycho Embedder API Maven/OSGi Shared Classes diff --git a/tycho-bundles/org.eclipse.tycho.embedder.shared/src/main/java/org/eclipse/tycho/ArtifactDescriptor.java b/tycho-api/src/main/java/org/eclipse/tycho/ArtifactDescriptor.java similarity index 100% rename from tycho-bundles/org.eclipse.tycho.embedder.shared/src/main/java/org/eclipse/tycho/ArtifactDescriptor.java rename to tycho-api/src/main/java/org/eclipse/tycho/ArtifactDescriptor.java diff --git a/tycho-bundles/org.eclipse.tycho.embedder.shared/src/main/java/org/eclipse/tycho/ArtifactKey.java b/tycho-api/src/main/java/org/eclipse/tycho/ArtifactKey.java similarity index 100% rename from tycho-bundles/org.eclipse.tycho.embedder.shared/src/main/java/org/eclipse/tycho/ArtifactKey.java rename to tycho-api/src/main/java/org/eclipse/tycho/ArtifactKey.java diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/artifact/provider/streaming/ArtifactSinkException.java b/tycho-api/src/main/java/org/eclipse/tycho/ArtifactSinkException.java similarity index 94% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/artifact/provider/streaming/ArtifactSinkException.java rename to tycho-api/src/main/java/org/eclipse/tycho/ArtifactSinkException.java index b24dc03580..440f7fd910 100644 --- a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/artifact/provider/streaming/ArtifactSinkException.java +++ b/tycho-api/src/main/java/org/eclipse/tycho/ArtifactSinkException.java @@ -10,7 +10,7 @@ * Contributors: * Tobias Oberlies (SAP SE) - initial API and implementation *******************************************************************************/ -package org.eclipse.tycho.p2.artifact.provider.streaming; +package org.eclipse.tycho; /** * Exception thrown when one of the operations of {@link IArtifactSink} fails. diff --git a/tycho-bundles/org.eclipse.tycho.embedder.shared/src/main/java/org/eclipse/tycho/ArtifactType.java b/tycho-api/src/main/java/org/eclipse/tycho/ArtifactType.java similarity index 100% rename from tycho-bundles/org.eclipse.tycho.embedder.shared/src/main/java/org/eclipse/tycho/ArtifactType.java rename to tycho-api/src/main/java/org/eclipse/tycho/ArtifactType.java diff --git a/tycho-bundles/org.eclipse.tycho.embedder.shared/src/main/java/org/eclipse/tycho/BuildDirectory.java b/tycho-api/src/main/java/org/eclipse/tycho/BuildDirectory.java similarity index 100% rename from tycho-bundles/org.eclipse.tycho.embedder.shared/src/main/java/org/eclipse/tycho/BuildDirectory.java rename to tycho-api/src/main/java/org/eclipse/tycho/BuildDirectory.java diff --git a/tycho-bundles/org.eclipse.tycho.embedder.shared/src/main/java/org/eclipse/tycho/BuildFailureException.java b/tycho-api/src/main/java/org/eclipse/tycho/BuildFailureException.java similarity index 100% rename from tycho-bundles/org.eclipse.tycho.embedder.shared/src/main/java/org/eclipse/tycho/BuildFailureException.java rename to tycho-api/src/main/java/org/eclipse/tycho/BuildFailureException.java diff --git a/tycho-bundles/org.eclipse.tycho.embedder.shared/src/main/java/org/eclipse/tycho/BuildOutputDirectory.java b/tycho-api/src/main/java/org/eclipse/tycho/BuildOutputDirectory.java similarity index 100% rename from tycho-bundles/org.eclipse.tycho.embedder.shared/src/main/java/org/eclipse/tycho/BuildOutputDirectory.java rename to tycho-api/src/main/java/org/eclipse/tycho/BuildOutputDirectory.java diff --git a/tycho-bundles/org.eclipse.tycho.embedder.shared/src/main/java/org/eclipse/tycho/BuildProperties.java b/tycho-api/src/main/java/org/eclipse/tycho/BuildProperties.java similarity index 100% rename from tycho-bundles/org.eclipse.tycho.embedder.shared/src/main/java/org/eclipse/tycho/BuildProperties.java rename to tycho-api/src/main/java/org/eclipse/tycho/BuildProperties.java diff --git a/tycho-bundles/org.eclipse.tycho.embedder.shared/src/main/java/org/eclipse/tycho/BuildPropertiesParser.java b/tycho-api/src/main/java/org/eclipse/tycho/BuildPropertiesParser.java similarity index 100% rename from tycho-bundles/org.eclipse.tycho.embedder.shared/src/main/java/org/eclipse/tycho/BuildPropertiesParser.java rename to tycho-api/src/main/java/org/eclipse/tycho/BuildPropertiesParser.java diff --git a/tycho-bundles/org.eclipse.tycho.embedder.shared/src/main/java/org/eclipse/tycho/ClasspathEntry.java b/tycho-api/src/main/java/org/eclipse/tycho/ClasspathEntry.java similarity index 100% rename from tycho-bundles/org.eclipse.tycho.embedder.shared/src/main/java/org/eclipse/tycho/ClasspathEntry.java rename to tycho-api/src/main/java/org/eclipse/tycho/ClasspathEntry.java diff --git a/tycho-bundles/org.eclipse.tycho.embedder.shared/src/main/java/org/eclipse/tycho/DefaultArtifactKey.java b/tycho-api/src/main/java/org/eclipse/tycho/DefaultArtifactKey.java similarity index 100% rename from tycho-bundles/org.eclipse.tycho.embedder.shared/src/main/java/org/eclipse/tycho/DefaultArtifactKey.java rename to tycho-api/src/main/java/org/eclipse/tycho/DefaultArtifactKey.java diff --git a/tycho-bundles/org.eclipse.tycho.embedder.shared/src/main/java/org/eclipse/tycho/DependencyArtifacts.java b/tycho-api/src/main/java/org/eclipse/tycho/DependencyArtifacts.java similarity index 100% rename from tycho-bundles/org.eclipse.tycho.embedder.shared/src/main/java/org/eclipse/tycho/DependencyArtifacts.java rename to tycho-api/src/main/java/org/eclipse/tycho/DependencyArtifacts.java diff --git a/tycho-bundles/org.eclipse.tycho.embedder.shared/src/main/java/org/eclipse/tycho/DependencyResolutionException.java b/tycho-api/src/main/java/org/eclipse/tycho/DependencyResolutionException.java similarity index 100% rename from tycho-bundles/org.eclipse.tycho.embedder.shared/src/main/java/org/eclipse/tycho/DependencyResolutionException.java rename to tycho-api/src/main/java/org/eclipse/tycho/DependencyResolutionException.java diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/core/ee/shared/ExecutionEnvironment.java b/tycho-api/src/main/java/org/eclipse/tycho/ExecutionEnvironment.java similarity index 98% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/core/ee/shared/ExecutionEnvironment.java rename to tycho-api/src/main/java/org/eclipse/tycho/ExecutionEnvironment.java index 5fe084e465..f2e0cd8934 100644 --- a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/core/ee/shared/ExecutionEnvironment.java +++ b/tycho-api/src/main/java/org/eclipse/tycho/ExecutionEnvironment.java @@ -10,7 +10,7 @@ * Contributors: * SAP AG - initial API and implementation *******************************************************************************/ -package org.eclipse.tycho.core.ee.shared; +package org.eclipse.tycho; import java.util.Collection; import java.util.Objects; diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/core/ee/shared/ExecutionEnvironmentConfiguration.java b/tycho-api/src/main/java/org/eclipse/tycho/ExecutionEnvironmentConfiguration.java similarity index 98% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/core/ee/shared/ExecutionEnvironmentConfiguration.java rename to tycho-api/src/main/java/org/eclipse/tycho/ExecutionEnvironmentConfiguration.java index 2486b61afc..29fe205e7f 100644 --- a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/core/ee/shared/ExecutionEnvironmentConfiguration.java +++ b/tycho-api/src/main/java/org/eclipse/tycho/ExecutionEnvironmentConfiguration.java @@ -10,7 +10,7 @@ * Contributors: * SAP SE - initial API and implementation *******************************************************************************/ -package org.eclipse.tycho.core.ee.shared; +package org.eclipse.tycho; import java.util.Collection; import java.util.List; diff --git a/tycho-bundles/org.eclipse.tycho.embedder.shared/src/main/java/org/eclipse/tycho/ExecutionEnvironmentResolutionHints.java b/tycho-api/src/main/java/org/eclipse/tycho/ExecutionEnvironmentResolutionHints.java similarity index 100% rename from tycho-bundles/org.eclipse.tycho.embedder.shared/src/main/java/org/eclipse/tycho/ExecutionEnvironmentResolutionHints.java rename to tycho-api/src/main/java/org/eclipse/tycho/ExecutionEnvironmentResolutionHints.java diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/locking/facade/FileLockService.java b/tycho-api/src/main/java/org/eclipse/tycho/FileLockService.java similarity index 95% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/locking/facade/FileLockService.java rename to tycho-api/src/main/java/org/eclipse/tycho/FileLockService.java index 9f1a298cad..21e525627a 100644 --- a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/locking/facade/FileLockService.java +++ b/tycho-api/src/main/java/org/eclipse/tycho/FileLockService.java @@ -11,7 +11,7 @@ * SAP AG - initial API and implementation *******************************************************************************/ -package org.eclipse.tycho.locking.facade; +package org.eclipse.tycho; import java.io.File; diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/locking/facade/FileLocker.java b/tycho-api/src/main/java/org/eclipse/tycho/FileLocker.java similarity index 97% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/locking/facade/FileLocker.java rename to tycho-api/src/main/java/org/eclipse/tycho/FileLocker.java index 375962b3d4..bf3b7296e4 100644 --- a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/locking/facade/FileLocker.java +++ b/tycho-api/src/main/java/org/eclipse/tycho/FileLocker.java @@ -11,7 +11,7 @@ * SAP AG - initial API and implementation *******************************************************************************/ -package org.eclipse.tycho.locking.facade; +package org.eclipse.tycho; /** * Provides process-level file locking. Locking is advisory, meaning that processes must diff --git a/tycho-bundles/org.eclipse.tycho.embedder.shared/src/main/java/org/eclipse/tycho/IArtifactFacade.java b/tycho-api/src/main/java/org/eclipse/tycho/IArtifactFacade.java similarity index 100% rename from tycho-bundles/org.eclipse.tycho.embedder.shared/src/main/java/org/eclipse/tycho/IArtifactFacade.java rename to tycho-api/src/main/java/org/eclipse/tycho/IArtifactFacade.java diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/artifact/provider/IArtifactFileProvider.java b/tycho-api/src/main/java/org/eclipse/tycho/IArtifactFileProvider.java similarity index 96% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/artifact/provider/IArtifactFileProvider.java rename to tycho-api/src/main/java/org/eclipse/tycho/IArtifactFileProvider.java index e81d6e17d5..6c652f069e 100644 --- a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/artifact/provider/IArtifactFileProvider.java +++ b/tycho-api/src/main/java/org/eclipse/tycho/IArtifactFileProvider.java @@ -10,7 +10,7 @@ * Contributors: * Tobias Oberlies (SAP SE) - initial API and implementation *******************************************************************************/ -package org.eclipse.tycho.p2.artifact.provider; +package org.eclipse.tycho; import java.io.File; diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/artifact/provider/IArtifactProvider.java b/tycho-api/src/main/java/org/eclipse/tycho/IArtifactProvider.java similarity index 92% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/artifact/provider/IArtifactProvider.java rename to tycho-api/src/main/java/org/eclipse/tycho/IArtifactProvider.java index 0de6bde172..e609c67558 100644 --- a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/artifact/provider/IArtifactProvider.java +++ b/tycho-api/src/main/java/org/eclipse/tycho/IArtifactProvider.java @@ -10,14 +10,12 @@ * Contributors: * Tobias Oberlies (SAP SE) - initial API and implementation *******************************************************************************/ -package org.eclipse.tycho.p2.artifact.provider; +package org.eclipse.tycho; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.equinox.p2.metadata.IArtifactKey; import org.eclipse.equinox.p2.query.IQueryable; -import org.eclipse.tycho.p2.artifact.provider.streaming.ArtifactSinkException; -import org.eclipse.tycho.p2.artifact.provider.streaming.IArtifactSink; /** * Provider for artifact content. diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/artifact/provider/streaming/IArtifactSink.java b/tycho-api/src/main/java/org/eclipse/tycho/IArtifactSink.java similarity index 98% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/artifact/provider/streaming/IArtifactSink.java rename to tycho-api/src/main/java/org/eclipse/tycho/IArtifactSink.java index 3fc12c7a02..07a8ba6ad2 100644 --- a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/artifact/provider/streaming/IArtifactSink.java +++ b/tycho-api/src/main/java/org/eclipse/tycho/IArtifactSink.java @@ -10,7 +10,7 @@ * Contributors: * Tobias Oberlies (SAP SE) - initial API and implementation *******************************************************************************/ -package org.eclipse.tycho.p2.artifact.provider.streaming; +package org.eclipse.tycho; import java.io.OutputStream; diff --git a/tycho-bundles/org.eclipse.tycho.embedder.shared/src/main/java/org/eclipse/tycho/IDependencyMetadata.java b/tycho-api/src/main/java/org/eclipse/tycho/IDependencyMetadata.java similarity index 100% rename from tycho-bundles/org.eclipse.tycho.embedder.shared/src/main/java/org/eclipse/tycho/IDependencyMetadata.java rename to tycho-api/src/main/java/org/eclipse/tycho/IDependencyMetadata.java diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/artifact/provider/IRawArtifactFileProvider.java b/tycho-api/src/main/java/org/eclipse/tycho/IRawArtifactFileProvider.java similarity index 97% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/artifact/provider/IRawArtifactFileProvider.java rename to tycho-api/src/main/java/org/eclipse/tycho/IRawArtifactFileProvider.java index d7f6da362f..9994af0f48 100644 --- a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/artifact/provider/IRawArtifactFileProvider.java +++ b/tycho-api/src/main/java/org/eclipse/tycho/IRawArtifactFileProvider.java @@ -10,7 +10,7 @@ * Contributors: * Tobias Oberlies (SAP SE) - initial API and implementation *******************************************************************************/ -package org.eclipse.tycho.p2.artifact.provider; +package org.eclipse.tycho; import java.io.File; diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/artifact/provider/IRawArtifactProvider.java b/tycho-api/src/main/java/org/eclipse/tycho/IRawArtifactProvider.java similarity index 92% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/artifact/provider/IRawArtifactProvider.java rename to tycho-api/src/main/java/org/eclipse/tycho/IRawArtifactProvider.java index e283caf26d..3e7c3fcc7f 100644 --- a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/artifact/provider/IRawArtifactProvider.java +++ b/tycho-api/src/main/java/org/eclipse/tycho/IRawArtifactProvider.java @@ -10,15 +10,12 @@ * Contributors: * Tobias Oberlies (SAP SE) - initial API and implementation *******************************************************************************/ -package org.eclipse.tycho.p2.artifact.provider; +package org.eclipse.tycho; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.equinox.p2.metadata.IArtifactKey; import org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor; -import org.eclipse.tycho.p2.artifact.provider.streaming.ArtifactSinkException; -import org.eclipse.tycho.p2.artifact.provider.streaming.IArtifactSink; -import org.eclipse.tycho.p2.artifact.provider.streaming.IRawArtifactSink; /** * Provider for artifact content in different formats. diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/artifact/provider/streaming/IRawArtifactSink.java b/tycho-api/src/main/java/org/eclipse/tycho/IRawArtifactSink.java similarity index 95% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/artifact/provider/streaming/IRawArtifactSink.java rename to tycho-api/src/main/java/org/eclipse/tycho/IRawArtifactSink.java index af0d65c5e1..9c160642c3 100644 --- a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/artifact/provider/streaming/IRawArtifactSink.java +++ b/tycho-api/src/main/java/org/eclipse/tycho/IRawArtifactSink.java @@ -10,7 +10,7 @@ * Contributors: * Tobias Oberlies (SAP SE) - initial API and implementation *******************************************************************************/ -package org.eclipse.tycho.p2.artifact.provider.streaming; +package org.eclipse.tycho; import org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor; diff --git a/tycho-bundles/org.eclipse.tycho.embedder.shared/src/main/java/org/eclipse/tycho/IRepositoryIdManager.java b/tycho-api/src/main/java/org/eclipse/tycho/IRepositoryIdManager.java similarity index 100% rename from tycho-bundles/org.eclipse.tycho.embedder.shared/src/main/java/org/eclipse/tycho/IRepositoryIdManager.java rename to tycho-api/src/main/java/org/eclipse/tycho/IRepositoryIdManager.java diff --git a/tycho-bundles/org.eclipse.tycho.embedder.shared/src/main/java/org/eclipse/tycho/IllegalArtifactReferenceException.java b/tycho-api/src/main/java/org/eclipse/tycho/IllegalArtifactReferenceException.java similarity index 100% rename from tycho-bundles/org.eclipse.tycho.embedder.shared/src/main/java/org/eclipse/tycho/IllegalArtifactReferenceException.java rename to tycho-api/src/main/java/org/eclipse/tycho/IllegalArtifactReferenceException.java diff --git a/tycho-bundles/org.eclipse.tycho.embedder.shared/src/main/java/org/eclipse/tycho/Interpolator.java b/tycho-api/src/main/java/org/eclipse/tycho/Interpolator.java similarity index 100% rename from tycho-bundles/org.eclipse.tycho.embedder.shared/src/main/java/org/eclipse/tycho/Interpolator.java rename to tycho-api/src/main/java/org/eclipse/tycho/Interpolator.java diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/locking/facade/LockTimeoutException.java b/tycho-api/src/main/java/org/eclipse/tycho/LockTimeoutException.java similarity index 95% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/locking/facade/LockTimeoutException.java rename to tycho-api/src/main/java/org/eclipse/tycho/LockTimeoutException.java index 25e389af4d..da44fe1809 100644 --- a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/locking/facade/LockTimeoutException.java +++ b/tycho-api/src/main/java/org/eclipse/tycho/LockTimeoutException.java @@ -11,7 +11,7 @@ * SAP AG - initial API and implementation *******************************************************************************/ -package org.eclipse.tycho.locking.facade; +package org.eclipse.tycho; public class LockTimeoutException extends RuntimeException { diff --git a/tycho-bundles/org.eclipse.tycho.embedder.shared/src/main/java/org/eclipse/tycho/MavenArtifactKey.java b/tycho-api/src/main/java/org/eclipse/tycho/MavenArtifactKey.java similarity index 100% rename from tycho-bundles/org.eclipse.tycho.embedder.shared/src/main/java/org/eclipse/tycho/MavenArtifactKey.java rename to tycho-api/src/main/java/org/eclipse/tycho/MavenArtifactKey.java diff --git a/tycho-bundles/org.eclipse.tycho.embedder.shared/src/main/java/org/eclipse/tycho/MavenArtifactRepositoryReference.java b/tycho-api/src/main/java/org/eclipse/tycho/MavenArtifactRepositoryReference.java similarity index 100% rename from tycho-bundles/org.eclipse.tycho.embedder.shared/src/main/java/org/eclipse/tycho/MavenArtifactRepositoryReference.java rename to tycho-api/src/main/java/org/eclipse/tycho/MavenArtifactRepositoryReference.java diff --git a/tycho-bundles/org.eclipse.tycho.embedder.shared/src/main/java/org/eclipse/tycho/MavenDependencyDescriptor.java b/tycho-api/src/main/java/org/eclipse/tycho/MavenDependencyDescriptor.java similarity index 100% rename from tycho-bundles/org.eclipse.tycho.embedder.shared/src/main/java/org/eclipse/tycho/MavenDependencyDescriptor.java rename to tycho-api/src/main/java/org/eclipse/tycho/MavenDependencyDescriptor.java diff --git a/tycho-bundles/org.eclipse.tycho.embedder.shared/src/main/java/org/eclipse/tycho/MavenRepositoryLocation.java b/tycho-api/src/main/java/org/eclipse/tycho/MavenRepositoryLocation.java similarity index 100% rename from tycho-bundles/org.eclipse.tycho.embedder.shared/src/main/java/org/eclipse/tycho/MavenRepositoryLocation.java rename to tycho-api/src/main/java/org/eclipse/tycho/MavenRepositoryLocation.java diff --git a/tycho-bundles/org.eclipse.tycho.embedder.shared/src/main/java/org/eclipse/tycho/MavenRepositorySettings.java b/tycho-api/src/main/java/org/eclipse/tycho/MavenRepositorySettings.java similarity index 100% rename from tycho-bundles/org.eclipse.tycho.embedder.shared/src/main/java/org/eclipse/tycho/MavenRepositorySettings.java rename to tycho-api/src/main/java/org/eclipse/tycho/MavenRepositorySettings.java diff --git a/tycho-bundles/org.eclipse.tycho.embedder.shared/src/main/java/org/eclipse/tycho/OptionalResolutionAction.java b/tycho-api/src/main/java/org/eclipse/tycho/OptionalResolutionAction.java similarity index 100% rename from tycho-bundles/org.eclipse.tycho.embedder.shared/src/main/java/org/eclipse/tycho/OptionalResolutionAction.java rename to tycho-api/src/main/java/org/eclipse/tycho/OptionalResolutionAction.java diff --git a/tycho-bundles/org.eclipse.tycho.embedder.shared/src/main/java/org/eclipse/tycho/PackagingType.java b/tycho-api/src/main/java/org/eclipse/tycho/PackagingType.java similarity index 100% rename from tycho-bundles/org.eclipse.tycho.embedder.shared/src/main/java/org/eclipse/tycho/PackagingType.java rename to tycho-api/src/main/java/org/eclipse/tycho/PackagingType.java diff --git a/tycho-bundles/org.eclipse.tycho.embedder.shared/src/main/java/org/eclipse/tycho/PlatformPropertiesUtils.java b/tycho-api/src/main/java/org/eclipse/tycho/PlatformPropertiesUtils.java similarity index 100% rename from tycho-bundles/org.eclipse.tycho.embedder.shared/src/main/java/org/eclipse/tycho/PlatformPropertiesUtils.java rename to tycho-api/src/main/java/org/eclipse/tycho/PlatformPropertiesUtils.java diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/repository/registry/facade/PublishingRepositoryFacade.java b/tycho-api/src/main/java/org/eclipse/tycho/PublishingRepositoryFacade.java similarity index 96% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/repository/registry/facade/PublishingRepositoryFacade.java rename to tycho-api/src/main/java/org/eclipse/tycho/PublishingRepositoryFacade.java index 87cf6d809a..1a89b1e608 100644 --- a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/repository/registry/facade/PublishingRepositoryFacade.java +++ b/tycho-api/src/main/java/org/eclipse/tycho/PublishingRepositoryFacade.java @@ -10,7 +10,7 @@ * Contributors: * SAP AG - initial API and implementation *******************************************************************************/ -package org.eclipse.tycho.repository.registry.facade; +package org.eclipse.tycho; import java.io.File; import java.util.Map; diff --git a/tycho-bundles/org.eclipse.tycho.embedder.shared/src/main/java/org/eclipse/tycho/ReactorProject.java b/tycho-api/src/main/java/org/eclipse/tycho/ReactorProject.java similarity index 100% rename from tycho-bundles/org.eclipse.tycho.embedder.shared/src/main/java/org/eclipse/tycho/ReactorProject.java rename to tycho-api/src/main/java/org/eclipse/tycho/ReactorProject.java diff --git a/tycho-bundles/org.eclipse.tycho.embedder.shared/src/main/java/org/eclipse/tycho/ReactorProjectIdentities.java b/tycho-api/src/main/java/org/eclipse/tycho/ReactorProjectIdentities.java similarity index 100% rename from tycho-bundles/org.eclipse.tycho.embedder.shared/src/main/java/org/eclipse/tycho/ReactorProjectIdentities.java rename to tycho-api/src/main/java/org/eclipse/tycho/ReactorProjectIdentities.java diff --git a/tycho-bundles/org.eclipse.tycho.embedder.shared/src/main/java/org/eclipse/tycho/ResolvedArtifactKey.java b/tycho-api/src/main/java/org/eclipse/tycho/ResolvedArtifactKey.java similarity index 100% rename from tycho-bundles/org.eclipse.tycho.embedder.shared/src/main/java/org/eclipse/tycho/ResolvedArtifactKey.java rename to tycho-api/src/main/java/org/eclipse/tycho/ResolvedArtifactKey.java diff --git a/tycho-bundles/org.eclipse.tycho.embedder.shared/src/main/java/org/eclipse/tycho/SourcepathEntry.java b/tycho-api/src/main/java/org/eclipse/tycho/SourcepathEntry.java similarity index 100% rename from tycho-bundles/org.eclipse.tycho.embedder.shared/src/main/java/org/eclipse/tycho/SourcepathEntry.java rename to tycho-api/src/main/java/org/eclipse/tycho/SourcepathEntry.java diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/core/ee/shared/SystemCapability.java b/tycho-api/src/main/java/org/eclipse/tycho/SystemCapability.java similarity index 97% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/core/ee/shared/SystemCapability.java rename to tycho-api/src/main/java/org/eclipse/tycho/SystemCapability.java index 0f768931da..561d7f863c 100644 --- a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/core/ee/shared/SystemCapability.java +++ b/tycho-api/src/main/java/org/eclipse/tycho/SystemCapability.java @@ -10,7 +10,7 @@ * Contributors: * SAP AG - initial API and implementation *******************************************************************************/ -package org.eclipse.tycho.core.ee.shared; +package org.eclipse.tycho; import java.util.Objects; diff --git a/tycho-bundles/org.eclipse.tycho.embedder.shared/src/main/java/org/eclipse/tycho/TargetEnvironment.java b/tycho-api/src/main/java/org/eclipse/tycho/TargetEnvironment.java similarity index 100% rename from tycho-bundles/org.eclipse.tycho.embedder.shared/src/main/java/org/eclipse/tycho/TargetEnvironment.java rename to tycho-api/src/main/java/org/eclipse/tycho/TargetEnvironment.java diff --git a/tycho-bundles/org.eclipse.tycho.embedder.shared/src/main/java/org/eclipse/tycho/TargetPlatform.java b/tycho-api/src/main/java/org/eclipse/tycho/TargetPlatform.java similarity index 100% rename from tycho-bundles/org.eclipse.tycho.embedder.shared/src/main/java/org/eclipse/tycho/TargetPlatform.java rename to tycho-api/src/main/java/org/eclipse/tycho/TargetPlatform.java diff --git a/tycho-bundles/org.eclipse.tycho.embedder.shared/src/main/java/org/eclipse/tycho/TargetPlatformService.java b/tycho-api/src/main/java/org/eclipse/tycho/TargetPlatformService.java similarity index 100% rename from tycho-bundles/org.eclipse.tycho.embedder.shared/src/main/java/org/eclipse/tycho/TargetPlatformService.java rename to tycho-api/src/main/java/org/eclipse/tycho/TargetPlatformService.java diff --git a/tycho-bundles/org.eclipse.tycho.embedder.shared/src/main/java/org/eclipse/tycho/TychoConstants.java b/tycho-api/src/main/java/org/eclipse/tycho/TychoConstants.java similarity index 100% rename from tycho-bundles/org.eclipse.tycho.embedder.shared/src/main/java/org/eclipse/tycho/TychoConstants.java rename to tycho-api/src/main/java/org/eclipse/tycho/TychoConstants.java diff --git a/tycho-bundles/org.eclipse.tycho.embedder.shared/src/main/java/org/eclipse/tycho/TychoProperties.java b/tycho-api/src/main/java/org/eclipse/tycho/TychoProperties.java similarity index 100% rename from tycho-bundles/org.eclipse.tycho.embedder.shared/src/main/java/org/eclipse/tycho/TychoProperties.java rename to tycho-api/src/main/java/org/eclipse/tycho/TychoProperties.java diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/repository/publishing/WriteSessionContext.java b/tycho-api/src/main/java/org/eclipse/tycho/WriteSessionContext.java similarity index 96% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/repository/publishing/WriteSessionContext.java rename to tycho-api/src/main/java/org/eclipse/tycho/WriteSessionContext.java index 24e79b98fb..eddcbf1c23 100644 --- a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/repository/publishing/WriteSessionContext.java +++ b/tycho-api/src/main/java/org/eclipse/tycho/WriteSessionContext.java @@ -10,7 +10,7 @@ * Contributors: * SAP SE - initial API and implementation *******************************************************************************/ -package org.eclipse.tycho.repository.publishing; +package org.eclipse.tycho; import org.eclipse.equinox.p2.metadata.IArtifactKey; diff --git a/tycho-bundles/org.eclipse.tycho.embedder.shared/src/main/resources/META-INF/MANIFEST.MF b/tycho-api/src/main/resources/META-INF/MANIFEST.MF similarity index 100% rename from tycho-bundles/org.eclipse.tycho.embedder.shared/src/main/resources/META-INF/MANIFEST.MF rename to tycho-api/src/main/resources/META-INF/MANIFEST.MF diff --git a/tycho-bundles/org.eclipse.tycho.embedder.shared/src/main/resources/about.html b/tycho-api/src/main/resources/about.html similarity index 100% rename from tycho-bundles/org.eclipse.tycho.embedder.shared/src/main/resources/about.html rename to tycho-api/src/main/resources/about.html diff --git a/tycho-apitools-plugin/pom.xml b/tycho-apitools-plugin/pom.xml index f198a0770d..de0dc847e2 100644 --- a/tycho-apitools-plugin/pom.xml +++ b/tycho-apitools-plugin/pom.xml @@ -8,6 +8,9 @@ tycho-apitools-plugin Plugin for performing API analysis tasks maven-plugin + + ${minimal-maven-version} + 9.5 diff --git a/tycho-baseline-plugin/pom.xml b/tycho-baseline-plugin/pom.xml index c5903b5a40..b34f8c8029 100644 --- a/tycho-baseline-plugin/pom.xml +++ b/tycho-baseline-plugin/pom.xml @@ -7,6 +7,9 @@ tycho-baseline-plugin maven-plugin + + ${minimal-maven-version} + Tycho Baseline Plugin A plugin for handling OSGi Declarative Services diff --git a/tycho-bnd-plugin/pom.xml b/tycho-bnd-plugin/pom.xml index a8ecc9cd27..57b1b25165 100644 --- a/tycho-bnd-plugin/pom.xml +++ b/tycho-bnd-plugin/pom.xml @@ -10,7 +10,7 @@ Builds BND Workspace with Maven maven-plugin - 3.8.6 + ${minimal-maven-version} diff --git a/tycho-build/pom.xml b/tycho-build/pom.xml index 8202eebc02..8aad8aacaf 100644 --- a/tycho-build/pom.xml +++ b/tycho-build/pom.xml @@ -35,11 +35,6 @@ tycho-pomless ${project.version} - - org.eclipse.tycho - org.eclipse.tycho.core.shared - ${project.version} - org.eclipse.tycho tycho-buildtimestamp-jgit @@ -142,6 +137,19 @@ - + + biz.aQute.bnd + biz.aQute.bndlib + + + org.osgi + org.osgi.service.repository + 1.1.0 + + + org.osgi + org.osgi.util.promise + 1.3.0 + \ No newline at end of file diff --git a/tycho-build/src/main/java/org/eclipse/tycho/build/MavenLoggerAdapter.java b/tycho-build/src/main/java/org/eclipse/tycho/build/MavenLoggerAdapter.java deleted file mode 100644 index 91ba722fc3..0000000000 --- a/tycho-build/src/main/java/org/eclipse/tycho/build/MavenLoggerAdapter.java +++ /dev/null @@ -1,89 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2011, 2022 SAP AG and others. - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * SAP AG - initial API and implementation - * Christoph Läubrich - #225 MavenLogger is missing error method that accepts an exception - *******************************************************************************/ -package org.eclipse.tycho.build; - -import org.codehaus.plexus.logging.Logger; -import org.eclipse.tycho.core.shared.MavenLogger; - -public class MavenLoggerAdapter implements MavenLogger { - - private final Logger logger; - private final boolean extendedDebug; - - public MavenLoggerAdapter(Logger logger, boolean extendedDebug) { - this.logger = logger; - this.extendedDebug = extendedDebug; - } - - @Override - public void debug(String message) { - if (logger.isDebugEnabled()) { - logger.debug(message); - } else if (isExtendedDebugEnabled()) { - logger.info(message); - } - } - - @Override - public void debug(String message, Throwable cause) { - if (logger.isDebugEnabled()) { - logger.debug(message, cause); - } else if (isExtendedDebugEnabled()) { - logger.info(message, cause); - } - } - - @Override - public T adapt(Class adapt) { - if (adapt == Logger.class) { - return adapt.cast(logger); - } - return null; - } - - @Override - public void info(String message) { - logger.info(message); - } - - @Override - public void warn(String message) { - warn(message, null); - } - - @Override - public void warn(String message, Throwable cause) { - logger.warn(message, cause); - } - - @Override - public void error(String message, Throwable cause) { - logger.error(message, cause); - } - - @Override - public void error(String message) { - logger.error(message); - } - - @Override - public boolean isDebugEnabled() { - return logger.isDebugEnabled() || isExtendedDebugEnabled(); - } - - @Override - public boolean isExtendedDebugEnabled() { - return extendedDebug; - } -} diff --git a/tycho-build/src/main/java/org/eclipse/tycho/build/TychoGraphBuilder.java b/tycho-build/src/main/java/org/eclipse/tycho/build/TychoGraphBuilder.java index c40a15d4cc..2b2ac745af 100644 --- a/tycho-build/src/main/java/org/eclipse/tycho/build/TychoGraphBuilder.java +++ b/tycho-build/src/main/java/org/eclipse/tycho/build/TychoGraphBuilder.java @@ -52,7 +52,6 @@ import org.eclipse.equinox.p2.metadata.IInstallableUnit; import org.eclipse.tycho.PackagingType; import org.eclipse.tycho.TychoConstants; -import org.eclipse.tycho.core.shared.MavenLogger; import org.eclipse.tycho.p2maven.MavenProjectDependencyProcessor; import org.eclipse.tycho.p2maven.MavenProjectDependencyProcessor.ProjectDependencies; import org.eclipse.tycho.p2maven.MavenProjectDependencyProcessor.ProjectDependencyClosure; @@ -62,6 +61,7 @@ @Component(role = GraphBuilder.class, hint = GraphBuilder.HINT) public class TychoGraphBuilder extends DefaultGraphBuilder { + private static final boolean DEBUG = Boolean.getBoolean("tycho.graphbuilder.debug"); @Requirement private Logger log; @@ -99,14 +99,12 @@ public Result build(MavenSession session) { request.setBuilderId("smart"); session.getUserProperties().put(TychoConstants.SESSION_PROPERTY_TYCHO_BUILDER, "smart"); } - MavenLogger loggerAdapter = new MavenLoggerAdapter(log, - Boolean.valueOf(session.getUserProperties().getProperty("tycho.debug.resolver"))); String makeBehavior = request.getMakeBehavior(); - if (loggerAdapter.isExtendedDebugEnabled()) { - loggerAdapter.debug("TychoGraphBuilder:"); - loggerAdapter.debug(" - SelectedProjects: " + request.getSelectedProjects()); - loggerAdapter.debug(" - ExcludedProjects: " + request.getExcludedProjects()); - loggerAdapter.debug(" - MakeBehavior: " + makeBehavior); + if (DEBUG) { + log.info("TychoGraphBuilder:"); + log.info(" - SelectedProjects: " + request.getSelectedProjects()); + log.info(" - ExcludedProjects: " + request.getExcludedProjects()); + log.info(" - MakeBehavior: " + makeBehavior); } // upstream is the -am / --also-make option of maven described as: // When you specify a project with the -am option, Maven will build all of the @@ -160,36 +158,39 @@ public Result build(MavenSession session) { return Result.error(graph, toProblems(e.getStatus(), new ArrayList<>())); } - if (loggerAdapter.isExtendedDebugEnabled()) { + if (DEBUG) { for (MavenProject project : projects) { ProjectDependencies depends = dependencyClosure.getProjectDependecies(project); if (depends.getDependencies().isEmpty()) { continue; } - loggerAdapter.debug("[[ project " + project.getName() + " depends on: ]]"); + log.info("[[ project " + project.getName() + " depends on: ]]"); for (IInstallableUnit dependency : depends.getDependencies()) { Optional mavenProject = dependencyClosure.getProject(dependency); if (mavenProject.isEmpty()) { - loggerAdapter.debug(" IU: " + dependency); + log.info(" IU: " + dependency); } else { - loggerAdapter - .debug(" IU: " + dependency + " [of project " + mavenProject.get().getName() + "]"); + log.info(" IU: " + dependency + " [of project " + mavenProject.get().getName() + "]"); } } } } Queue queue = new ConcurrentLinkedQueue<>(graph.getSortedProjects().stream() .map(p -> new ProjectRequest(p, makeDownstream, makeUpstream, null)).toList()); - loggerAdapter.debug("Computing additional " + makeBehavior + if (DEBUG) { + log.info("Computing additional " + makeBehavior + " dependencies based on initial project set of " + queue.stream().map(r -> r.mavenProject) .map(MavenProject::getName).collect(Collectors.joining(", "))); + } while (!queue.isEmpty()) { ProjectRequest projectRequest = queue.poll(); if (selectedProjects.add(projectRequest.mavenProject)) { if (projectRequest.addDependencies) { dependencyClosure.getDependencyProjects(projectRequest.mavenProject).forEach(project -> { - loggerAdapter.debug(" + add dependency project '" + project.getId() + "' of project '" + if (DEBUG) { + log.info(" + add dependency project '" + project.getId() + "' of project '" + projectRequest.mavenProject.getId() + "'"); + } // we also need to add the dependencies of the dependency project queue.add(new ProjectRequest(project, false, true, projectRequest)); }); @@ -201,8 +202,12 @@ public Result build(MavenSession session) { .anyMatch(projectRequest::matches))// .map(Entry::getKey)// .distinct()// - .peek(project -> loggerAdapter.debug(" + add project '" + project.getId() - + "' that depends on '" + projectRequest.mavenProject.getId() + "'..."))// + .peek(project -> { + if (DEBUG) { + log.info(" + add project '" + project.getId() + "' that depends on '" + + projectRequest.mavenProject.getId() + "'..."); + } + })// // request dependencies of dependants, otherwise, -amd would not be able to // produce a satisfiable build graph .forEach(project -> queue.add(new ProjectRequest(project, true, true, projectRequest))); diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/pom.xml b/tycho-bundles/org.eclipse.tycho.core.shared/pom.xml index be07d6652a..8283ed1beb 100644 --- a/tycho-bundles/org.eclipse.tycho.core.shared/pom.xml +++ b/tycho-bundles/org.eclipse.tycho.core.shared/pom.xml @@ -28,7 +28,7 @@ org.eclipse.tycho - org.eclipse.tycho.embedder.shared + tycho-api ${project.version} diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/repository/util/DuplicateFilteringLoggingProgressMonitor.java b/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/core/shared/DuplicateFilteringLoggingProgressMonitor.java similarity index 95% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/repository/util/DuplicateFilteringLoggingProgressMonitor.java rename to tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/core/shared/DuplicateFilteringLoggingProgressMonitor.java index 6eb160ee8e..93abe7a489 100644 --- a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/repository/util/DuplicateFilteringLoggingProgressMonitor.java +++ b/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/core/shared/DuplicateFilteringLoggingProgressMonitor.java @@ -11,12 +11,10 @@ * SAP SE - initial API and implementation * Christoph Läubrich - filter additional string *******************************************************************************/ -package org.eclipse.tycho.repository.util; +package org.eclipse.tycho.core.shared; import java.util.regex.Pattern; -import org.eclipse.tycho.core.shared.MavenLogger; - /** * {@link LoggingProgressMonitor} which removes duplicated and other obsolete log output produced by * p2/ECF when downloading artifacts. diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/repository/util/LoggingProgressMonitor.java b/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/core/shared/LoggingProgressMonitor.java similarity index 95% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/repository/util/LoggingProgressMonitor.java rename to tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/core/shared/LoggingProgressMonitor.java index 5e49940681..ab0f8cd318 100644 --- a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/repository/util/LoggingProgressMonitor.java +++ b/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/core/shared/LoggingProgressMonitor.java @@ -10,10 +10,9 @@ * Contributors: * Sonatype Inc. - initial API and implementation *******************************************************************************/ -package org.eclipse.tycho.repository.util; +package org.eclipse.tycho.core.shared; import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.tycho.core.shared.MavenLogger; /** * Special {@link IProgressMonitor} instance which writes the task names it is given via the diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/repository/util/StatusTool.java b/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/core/shared/StatusTool.java similarity index 99% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/repository/util/StatusTool.java rename to tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/core/shared/StatusTool.java index 01954cb620..9317c73a12 100644 --- a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/repository/util/StatusTool.java +++ b/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/core/shared/StatusTool.java @@ -10,7 +10,7 @@ * Contributors: * SAP SE - initial API and implementation *******************************************************************************/ -package org.eclipse.tycho.repository.util; +package org.eclipse.tycho.core.shared; import org.eclipse.core.runtime.IStatus; diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/AbstractArtifactRepository2.java b/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/AbstractArtifactRepository2.java index d0358bee3e..fe31bbd849 100644 --- a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/AbstractArtifactRepository2.java +++ b/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/AbstractArtifactRepository2.java @@ -13,9 +13,9 @@ *******************************************************************************/ package org.eclipse.tycho.p2.repository; -import static org.eclipse.tycho.p2.artifact.provider.streaming.ArtifactSinkFactory.rawWriteToStream; -import static org.eclipse.tycho.p2.artifact.provider.streaming.ArtifactSinkFactory.writeToStream; -import static org.eclipse.tycho.repository.util.BundleConstants.BUNDLE_ID; +import static org.eclipse.tycho.p2.repository.BundleConstants.BUNDLE_ID; +import static org.eclipse.tycho.p2.repository.streaming.ArtifactSinkFactory.rawWriteToStream; +import static org.eclipse.tycho.p2.repository.streaming.ArtifactSinkFactory.writeToStream; import java.io.IOException; import java.io.OutputStream; @@ -35,10 +35,10 @@ import org.eclipse.equinox.p2.repository.artifact.IArtifactRepository; import org.eclipse.equinox.p2.repository.artifact.IArtifactRequest; import org.eclipse.equinox.p2.repository.artifact.spi.AbstractArtifactRepository; -import org.eclipse.tycho.p2.artifact.provider.IRawArtifactProvider; -import org.eclipse.tycho.p2.artifact.provider.streaming.ArtifactSinkException; -import org.eclipse.tycho.p2.artifact.provider.streaming.IArtifactSink; -import org.eclipse.tycho.p2.artifact.provider.streaming.IRawArtifactSink; +import org.eclipse.tycho.ArtifactSinkException; +import org.eclipse.tycho.IArtifactSink; +import org.eclipse.tycho.IRawArtifactProvider; +import org.eclipse.tycho.IRawArtifactSink; /** * Base class for {@link IArtifactRepository} implementations that fixes some problems in the p2 API diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/AbstractMetadataRepository2.java b/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/AbstractMetadataRepository2.java index 831c1d659a..45fc6cd561 100644 --- a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/AbstractMetadataRepository2.java +++ b/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/AbstractMetadataRepository2.java @@ -12,7 +12,7 @@ *******************************************************************************/ package org.eclipse.tycho.p2.repository; -import static org.eclipse.tycho.repository.util.BundleConstants.BUNDLE_ID; +import static org.eclipse.tycho.p2.repository.BundleConstants.BUNDLE_ID; import java.io.File; import java.net.URI; diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/artifact/provider/ArtifactProviderImplUtilities.java b/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/ArtifactProviderImplUtilities.java similarity index 93% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/artifact/provider/ArtifactProviderImplUtilities.java rename to tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/ArtifactProviderImplUtilities.java index e1958cd608..b9a6f82732 100644 --- a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/artifact/provider/ArtifactProviderImplUtilities.java +++ b/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/ArtifactProviderImplUtilities.java @@ -10,7 +10,7 @@ * Contributors: * Tobias Oberlies (SAP SE) - initial API and implementation *******************************************************************************/ -package org.eclipse.tycho.p2.artifact.provider; +package org.eclipse.tycho.p2.repository; import static org.eclipse.tycho.p2.repository.ArtifactTransferPolicy.isCanonicalFormat; @@ -18,8 +18,8 @@ import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.MultiStatus; -import org.eclipse.tycho.p2.artifact.provider.streaming.IArtifactSink; -import org.eclipse.tycho.p2.artifact.provider.streaming.IRawArtifactSink; +import org.eclipse.tycho.IArtifactSink; +import org.eclipse.tycho.IRawArtifactSink; public final class ArtifactProviderImplUtilities { diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/ArtifactRepositoryBaseImpl.java b/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/ArtifactRepositoryBaseImpl.java index 65b81ddb2c..bbdbc5be10 100644 --- a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/ArtifactRepositoryBaseImpl.java +++ b/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/ArtifactRepositoryBaseImpl.java @@ -13,9 +13,9 @@ *******************************************************************************/ package org.eclipse.tycho.p2.repository; -import static org.eclipse.tycho.p2.artifact.provider.ArtifactProviderImplUtilities.canWriteCanonicalArtifactToSink; -import static org.eclipse.tycho.p2.artifact.provider.ArtifactProviderImplUtilities.canWriteToSink; -import static org.eclipse.tycho.repository.util.BundleConstants.BUNDLE_ID; +import static org.eclipse.tycho.p2.repository.ArtifactProviderImplUtilities.canWriteCanonicalArtifactToSink; +import static org.eclipse.tycho.p2.repository.ArtifactProviderImplUtilities.canWriteToSink; +import static org.eclipse.tycho.p2.repository.BundleConstants.BUNDLE_ID; import java.io.File; import java.io.FileInputStream; @@ -47,10 +47,10 @@ import org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor; import org.eclipse.equinox.p2.repository.artifact.IArtifactRepository; import org.eclipse.equinox.p2.repository.artifact.IFileArtifactRepository; -import org.eclipse.tycho.p2.artifact.provider.IRawArtifactFileProvider; -import org.eclipse.tycho.p2.artifact.provider.streaming.ArtifactSinkException; -import org.eclipse.tycho.p2.artifact.provider.streaming.IArtifactSink; -import org.eclipse.tycho.p2.artifact.provider.streaming.IRawArtifactSink; +import org.eclipse.tycho.ArtifactSinkException; +import org.eclipse.tycho.IArtifactSink; +import org.eclipse.tycho.IRawArtifactFileProvider; +import org.eclipse.tycho.IRawArtifactSink; /** * Base implementation of a mutable, file system based p2 artifact repository. This class manages diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/ArtifactRepositoryBlackboard.java b/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/ArtifactRepositoryBlackboard.java index c4a64658d7..6e94fa628d 100644 --- a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/ArtifactRepositoryBlackboard.java +++ b/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/ArtifactRepositoryBlackboard.java @@ -21,8 +21,6 @@ import org.eclipse.equinox.p2.core.ProvisionException; import org.eclipse.equinox.p2.repository.artifact.IArtifactRepository; import org.eclipse.equinox.p2.repository.artifact.spi.ArtifactRepositoryFactory; -import org.eclipse.tycho.repository.registry.facade.RepositoryBlackboardKey; -import org.eclipse.tycho.repository.util.RepositoryFactoryTools; public class ArtifactRepositoryBlackboard extends ArtifactRepositoryFactory { diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/ArtifactTransferPolicy.java b/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/ArtifactTransferPolicy.java index 4e78090187..2471d03099 100644 --- a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/ArtifactTransferPolicy.java +++ b/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/ArtifactTransferPolicy.java @@ -18,7 +18,7 @@ import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.equinox.p2.metadata.IArtifactKey; import org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor; -import org.eclipse.tycho.p2.artifact.provider.IArtifactProvider; +import org.eclipse.tycho.IArtifactProvider; /** * Policy for picking the internally used artifact format when obtaining an artifact. Different diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/ArtifactsIO.java b/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/ArtifactsIO.java index b8326181e2..cf87395016 100644 --- a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/ArtifactsIO.java +++ b/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/ArtifactsIO.java @@ -24,7 +24,6 @@ import javax.xml.parsers.ParserConfigurationException; import org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor; -import org.eclipse.tycho.repository.util.BundleConstants; import org.xml.sax.Attributes; import org.xml.sax.InputSource; import org.xml.sax.SAXException; diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/repository/util/BundleConstants.java b/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/BundleConstants.java similarity index 93% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/repository/util/BundleConstants.java rename to tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/BundleConstants.java index 85c9ebd264..a810bfd3ba 100644 --- a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/repository/util/BundleConstants.java +++ b/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/BundleConstants.java @@ -10,7 +10,7 @@ * Contributors: * SAP SE - initial API and implementation *******************************************************************************/ -package org.eclipse.tycho.repository.util; +package org.eclipse.tycho.p2.repository; public final class BundleConstants { diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/CompositeArtifactProvider.java b/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/CompositeArtifactProvider.java index a8e6a9e724..ea02f3e55a 100644 --- a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/CompositeArtifactProvider.java +++ b/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/CompositeArtifactProvider.java @@ -12,7 +12,7 @@ *******************************************************************************/ package org.eclipse.tycho.p2.repository; -import static org.eclipse.tycho.repository.util.BundleConstants.BUNDLE_ID; +import static org.eclipse.tycho.p2.repository.BundleConstants.BUNDLE_ID; import java.io.File; import java.util.ArrayList; @@ -30,11 +30,11 @@ import org.eclipse.equinox.p2.query.IQueryResult; import org.eclipse.equinox.p2.query.IQueryable; import org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor; -import org.eclipse.tycho.p2.artifact.provider.IArtifactProvider; -import org.eclipse.tycho.p2.artifact.provider.IRawArtifactFileProvider; -import org.eclipse.tycho.p2.artifact.provider.streaming.ArtifactSinkException; -import org.eclipse.tycho.p2.artifact.provider.streaming.IArtifactSink; -import org.eclipse.tycho.p2.artifact.provider.streaming.IRawArtifactSink; +import org.eclipse.tycho.ArtifactSinkException; +import org.eclipse.tycho.IArtifactProvider; +import org.eclipse.tycho.IArtifactSink; +import org.eclipse.tycho.IRawArtifactFileProvider; +import org.eclipse.tycho.IRawArtifactSink; public class CompositeArtifactProvider extends CompositeArtifactProviderBaseImpl implements IRawArtifactFileProvider { diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/CompositeArtifactProviderBaseImpl.java b/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/CompositeArtifactProviderBaseImpl.java index 13d14e7d4e..57b144d769 100644 --- a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/CompositeArtifactProviderBaseImpl.java +++ b/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/CompositeArtifactProviderBaseImpl.java @@ -12,10 +12,10 @@ *******************************************************************************/ package org.eclipse.tycho.p2.repository; -import static org.eclipse.tycho.p2.artifact.provider.ArtifactProviderImplUtilities.canWriteCanonicalArtifactToSink; -import static org.eclipse.tycho.p2.artifact.provider.ArtifactProviderImplUtilities.canWriteToSink; -import static org.eclipse.tycho.p2.artifact.provider.ArtifactProviderImplUtilities.createMultiStatusWithFixedSeverity; -import static org.eclipse.tycho.repository.util.BundleConstants.BUNDLE_ID; +import static org.eclipse.tycho.p2.repository.ArtifactProviderImplUtilities.canWriteCanonicalArtifactToSink; +import static org.eclipse.tycho.p2.repository.ArtifactProviderImplUtilities.canWriteToSink; +import static org.eclipse.tycho.p2.repository.ArtifactProviderImplUtilities.createMultiStatusWithFixedSeverity; +import static org.eclipse.tycho.p2.repository.BundleConstants.BUNDLE_ID; import java.util.ArrayList; import java.util.HashSet; @@ -28,10 +28,10 @@ import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.equinox.p2.metadata.IArtifactKey; import org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor; -import org.eclipse.tycho.p2.artifact.provider.IRawArtifactProvider; -import org.eclipse.tycho.p2.artifact.provider.streaming.ArtifactSinkException; -import org.eclipse.tycho.p2.artifact.provider.streaming.IArtifactSink; -import org.eclipse.tycho.p2.artifact.provider.streaming.IRawArtifactSink; +import org.eclipse.tycho.ArtifactSinkException; +import org.eclipse.tycho.IArtifactSink; +import org.eclipse.tycho.IRawArtifactProvider; +import org.eclipse.tycho.IRawArtifactSink; public abstract class CompositeArtifactProviderBaseImpl implements IRawArtifactProvider { diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/FileBasedTychoRepositoryIndex.java b/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/FileBasedTychoRepositoryIndex.java index e110eb639f..a4f3814b39 100644 --- a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/FileBasedTychoRepositoryIndex.java +++ b/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/FileBasedTychoRepositoryIndex.java @@ -29,10 +29,10 @@ import java.util.LinkedHashSet; import java.util.Set; +import org.eclipse.tycho.FileLockService; +import org.eclipse.tycho.FileLocker; import org.eclipse.tycho.core.shared.MavenContext; import org.eclipse.tycho.core.shared.MavenLogger; -import org.eclipse.tycho.locking.facade.FileLockService; -import org.eclipse.tycho.locking.facade.FileLocker; /** * Simplistic local Maven repository index to allow efficient lookup of all installed Tycho diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/FileRepositoryArtifactProvider.java b/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/FileRepositoryArtifactProvider.java index d34a8e76c0..7080e1658f 100644 --- a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/FileRepositoryArtifactProvider.java +++ b/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/FileRepositoryArtifactProvider.java @@ -22,7 +22,7 @@ import org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor; import org.eclipse.equinox.p2.repository.artifact.IArtifactRepository; import org.eclipse.equinox.p2.repository.artifact.IFileArtifactRepository; -import org.eclipse.tycho.p2.artifact.provider.IRawArtifactFileProvider; +import org.eclipse.tycho.IRawArtifactFileProvider; /** * {@link RepositoryArtifactProvider} implementation which adds file access capabilities. diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/GAVArtifactDescriptor.java b/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/GAVArtifactDescriptor.java index f782d286d5..81c163d05f 100644 --- a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/GAVArtifactDescriptor.java +++ b/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/GAVArtifactDescriptor.java @@ -16,7 +16,6 @@ import org.eclipse.equinox.p2.metadata.IArtifactKey; import org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor; -import org.eclipse.tycho.repository.util.GAVArtifactDescriptorBase; /** * Key which uniquely identifies an artifact in both the p2 ("artifact descriptor") and Maven diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/repository/util/GAVArtifactDescriptorBase.java b/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/GAVArtifactDescriptorBase.java similarity index 94% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/repository/util/GAVArtifactDescriptorBase.java rename to tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/GAVArtifactDescriptorBase.java index 52d8ab16dc..9f9a6bb0ed 100644 --- a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/repository/util/GAVArtifactDescriptorBase.java +++ b/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/GAVArtifactDescriptorBase.java @@ -10,7 +10,7 @@ * Contributors: * SAP SE - initial API and implementation *******************************************************************************/ -package org.eclipse.tycho.repository.util; +package org.eclipse.tycho.p2.repository; import java.util.Map; @@ -18,9 +18,6 @@ import org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor; import org.eclipse.equinox.p2.repository.artifact.spi.ArtifactDescriptor; import org.eclipse.tycho.TychoConstants; -import org.eclipse.tycho.p2.repository.GAV; -import org.eclipse.tycho.p2.repository.MavenRepositoryCoordinates; -import org.eclipse.tycho.p2.repository.RepositoryLayoutHelper; public class GAVArtifactDescriptorBase extends ArtifactDescriptor { diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/ImmutableInMemoryMetadataRepository.java b/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/ImmutableInMemoryMetadataRepository.java index deca9f9245..286ac3d312 100644 --- a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/ImmutableInMemoryMetadataRepository.java +++ b/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/ImmutableInMemoryMetadataRepository.java @@ -12,7 +12,7 @@ *******************************************************************************/ package org.eclipse.tycho.p2.repository; -import static org.eclipse.tycho.repository.util.BundleConstants.BUNDLE_ID; +import static org.eclipse.tycho.p2.repository.BundleConstants.BUNDLE_ID; import java.net.URI; import java.util.Collection; diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/LocalArtifactRepositoryFactory.java b/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/LocalArtifactRepositoryFactory.java index 299ad4430d..5a95bfdeed 100644 --- a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/LocalArtifactRepositoryFactory.java +++ b/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/LocalArtifactRepositoryFactory.java @@ -20,7 +20,6 @@ import org.eclipse.equinox.p2.core.ProvisionException; import org.eclipse.equinox.p2.repository.artifact.IArtifactRepository; import org.eclipse.equinox.p2.repository.artifact.spi.ArtifactRepositoryFactory; -import org.eclipse.tycho.repository.util.RepositoryFactoryTools; import org.osgi.framework.BundleContext; import org.osgi.framework.FrameworkUtil; import org.osgi.framework.ServiceReference; diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/MetadataIO.java b/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/MetadataIO.java index bb6e1f7153..188d4cae1b 100644 --- a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/MetadataIO.java +++ b/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/MetadataIO.java @@ -37,7 +37,6 @@ import org.eclipse.equinox.p2.metadata.IInstallableUnit; import org.eclipse.equinox.p2.metadata.MetadataFactory; import org.eclipse.equinox.p2.metadata.MetadataFactory.InstallableUnitDescription; -import org.eclipse.tycho.repository.util.BundleConstants; import org.xml.sax.Attributes; import org.xml.sax.InputSource; import org.xml.sax.SAXException; diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/MirroringArtifactProvider.java b/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/MirroringArtifactProvider.java index e8832bba15..6a11010030 100644 --- a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/MirroringArtifactProvider.java +++ b/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/MirroringArtifactProvider.java @@ -14,7 +14,7 @@ *******************************************************************************/ package org.eclipse.tycho.p2.repository; -import static org.eclipse.tycho.repository.util.BundleConstants.BUNDLE_ID; +import static org.eclipse.tycho.p2.repository.BundleConstants.BUNDLE_ID; import java.io.File; import java.io.FileInputStream; @@ -40,20 +40,20 @@ import org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor; import org.eclipse.equinox.p2.repository.artifact.IArtifactRepository; import org.eclipse.equinox.p2.repository.artifact.spi.ArtifactDescriptor; +import org.eclipse.tycho.ArtifactSinkException; +import org.eclipse.tycho.IArtifactSink; +import org.eclipse.tycho.IRawArtifactFileProvider; +import org.eclipse.tycho.IRawArtifactProvider; +import org.eclipse.tycho.IRawArtifactSink; import org.eclipse.tycho.PackagingType; import org.eclipse.tycho.TychoConstants; +import org.eclipse.tycho.core.shared.DuplicateFilteringLoggingProgressMonitor; +import org.eclipse.tycho.core.shared.LoggingProgressMonitor; import org.eclipse.tycho.core.shared.MavenContext; import org.eclipse.tycho.core.shared.MavenContext.ChecksumPolicy; import org.eclipse.tycho.core.shared.MavenLogger; import org.eclipse.tycho.core.shared.MultiLineLogger; -import org.eclipse.tycho.p2.artifact.provider.IRawArtifactFileProvider; -import org.eclipse.tycho.p2.artifact.provider.IRawArtifactProvider; -import org.eclipse.tycho.p2.artifact.provider.streaming.ArtifactSinkException; -import org.eclipse.tycho.p2.artifact.provider.streaming.IArtifactSink; -import org.eclipse.tycho.p2.artifact.provider.streaming.IRawArtifactSink; -import org.eclipse.tycho.repository.util.DuplicateFilteringLoggingProgressMonitor; -import org.eclipse.tycho.repository.util.LoggingProgressMonitor; -import org.eclipse.tycho.repository.util.StatusTool; +import org.eclipse.tycho.core.shared.StatusTool; /** * {@link IRawArtifactFileProvider} which caches all accessed artifacts in the local Maven diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/ProviderOnlyArtifactRepository.java b/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/ProviderOnlyArtifactRepository.java index de60e2aa22..63b92ff368 100644 --- a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/ProviderOnlyArtifactRepository.java +++ b/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/ProviderOnlyArtifactRepository.java @@ -25,10 +25,10 @@ import org.eclipse.equinox.p2.query.IQueryable; import org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor; import org.eclipse.equinox.p2.repository.artifact.IFileArtifactRepository; -import org.eclipse.tycho.p2.artifact.provider.IRawArtifactFileProvider; -import org.eclipse.tycho.p2.artifact.provider.streaming.ArtifactSinkException; -import org.eclipse.tycho.p2.artifact.provider.streaming.IArtifactSink; -import org.eclipse.tycho.p2.artifact.provider.streaming.IRawArtifactSink; +import org.eclipse.tycho.ArtifactSinkException; +import org.eclipse.tycho.IArtifactSink; +import org.eclipse.tycho.IRawArtifactFileProvider; +import org.eclipse.tycho.IRawArtifactSink; /** * Read-only repository which delegates artifact read operations to a provider instance. Adapter diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/repository/publishing/PublishingRepository.java b/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/PublishingRepository.java similarity index 91% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/repository/publishing/PublishingRepository.java rename to tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/PublishingRepository.java index 242ee547c0..93632ff8d1 100644 --- a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/repository/publishing/PublishingRepository.java +++ b/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/PublishingRepository.java @@ -10,7 +10,7 @@ * Contributors: * SAP SE - initial API and implementation *******************************************************************************/ -package org.eclipse.tycho.repository.publishing; +package org.eclipse.tycho.p2.repository; import java.io.File; @@ -18,9 +18,10 @@ import org.eclipse.equinox.p2.repository.artifact.IArtifactRepository; import org.eclipse.equinox.p2.repository.artifact.IFileArtifactRepository; import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository; +import org.eclipse.tycho.IRawArtifactFileProvider; +import org.eclipse.tycho.PublishingRepositoryFacade; import org.eclipse.tycho.ReactorProjectIdentities; -import org.eclipse.tycho.p2.artifact.provider.IRawArtifactFileProvider; -import org.eclipse.tycho.repository.registry.facade.PublishingRepositoryFacade; +import org.eclipse.tycho.WriteSessionContext; /** * Representation of the p2 repositories that receive the artifacts produced by a project. diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/RepositoryArtifactProvider.java b/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/RepositoryArtifactProvider.java index 1d52b7fca0..285b22729f 100644 --- a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/RepositoryArtifactProvider.java +++ b/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/RepositoryArtifactProvider.java @@ -13,7 +13,7 @@ *******************************************************************************/ package org.eclipse.tycho.p2.repository; -import static org.eclipse.tycho.repository.util.BundleConstants.BUNDLE_ID; +import static org.eclipse.tycho.p2.repository.BundleConstants.BUNDLE_ID; import java.net.URI; import java.util.ArrayList; @@ -38,9 +38,9 @@ import org.eclipse.equinox.p2.repository.artifact.IArtifactRepository; import org.eclipse.equinox.p2.repository.artifact.IArtifactRepositoryManager; import org.eclipse.equinox.p2.repository.artifact.IArtifactRequest; -import org.eclipse.tycho.p2.artifact.provider.streaming.ArtifactSinkException; -import org.eclipse.tycho.p2.artifact.provider.streaming.IArtifactSink; -import org.eclipse.tycho.p2.artifact.provider.streaming.IRawArtifactSink; +import org.eclipse.tycho.ArtifactSinkException; +import org.eclipse.tycho.IArtifactSink; +import org.eclipse.tycho.IRawArtifactSink; public class RepositoryArtifactProvider extends CompositeArtifactProviderBaseImpl { diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/repository/registry/facade/RepositoryBlackboardKey.java b/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/RepositoryBlackboardKey.java similarity index 97% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/repository/registry/facade/RepositoryBlackboardKey.java rename to tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/RepositoryBlackboardKey.java index fe97bc255c..d99860a301 100644 --- a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/repository/registry/facade/RepositoryBlackboardKey.java +++ b/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/RepositoryBlackboardKey.java @@ -11,7 +11,7 @@ * SAP AG - initial API and implementation * Gunnar Wagenknecht (Salesforce) - fix for bug 509028 *******************************************************************************/ -package org.eclipse.tycho.repository.registry.facade; +package org.eclipse.tycho.p2.repository; import java.io.File; import java.net.URI; diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/repository/util/RepositoryFactoryTools.java b/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/RepositoryFactoryTools.java similarity index 95% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/repository/util/RepositoryFactoryTools.java rename to tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/RepositoryFactoryTools.java index 8ed0e5d38b..e0d8fba03f 100644 --- a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/repository/util/RepositoryFactoryTools.java +++ b/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/RepositoryFactoryTools.java @@ -10,9 +10,9 @@ * Contributors: * SAP SE - initial API and implementation *******************************************************************************/ -package org.eclipse.tycho.repository.util; +package org.eclipse.tycho.p2.repository; -import static org.eclipse.tycho.repository.util.BundleConstants.BUNDLE_ID; +import static org.eclipse.tycho.p2.repository.BundleConstants.BUNDLE_ID; import java.io.File; import java.net.URI; diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/module/ModuleArtifactMap.java b/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/module/ModuleArtifactMap.java index 1f3f30b0af..8c566bcc96 100644 --- a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/module/ModuleArtifactMap.java +++ b/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/module/ModuleArtifactMap.java @@ -12,7 +12,7 @@ *******************************************************************************/ package org.eclipse.tycho.p2.repository.module; -import static org.eclipse.tycho.repository.util.BundleConstants.BUNDLE_ID; +import static org.eclipse.tycho.p2.repository.BundleConstants.BUNDLE_ID; import java.io.File; import java.io.FileInputStream; diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/module/ModuleArtifactRepository.java b/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/module/ModuleArtifactRepository.java index 8a0b38090f..fad2fa4a2f 100644 --- a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/module/ModuleArtifactRepository.java +++ b/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/module/ModuleArtifactRepository.java @@ -13,7 +13,7 @@ package org.eclipse.tycho.p2.repository.module; import static java.util.stream.Collectors.toSet; -import static org.eclipse.tycho.repository.util.BundleConstants.BUNDLE_ID; +import static org.eclipse.tycho.p2.repository.BundleConstants.BUNDLE_ID; import java.io.File; import java.io.FileInputStream; @@ -34,17 +34,17 @@ import org.eclipse.equinox.p2.repository.artifact.IArtifactRepository; import org.eclipse.equinox.p2.repository.artifact.IArtifactRepositoryManager; import org.eclipse.equinox.p2.repository.artifact.spi.ArtifactDescriptor; +import org.eclipse.tycho.IArtifactSink; import org.eclipse.tycho.TychoConstants; -import org.eclipse.tycho.p2.artifact.provider.streaming.IArtifactSink; +import org.eclipse.tycho.WriteSessionContext; +import org.eclipse.tycho.WriteSessionContext.ClassifierAndExtension; import org.eclipse.tycho.p2.repository.ArtifactRepositoryBaseImpl; import org.eclipse.tycho.p2.repository.ArtifactTransferPolicies; import org.eclipse.tycho.p2.repository.ArtifactsIO; import org.eclipse.tycho.p2.repository.GAV; +import org.eclipse.tycho.p2.repository.GAVArtifactDescriptorBase; import org.eclipse.tycho.p2.repository.MavenRepositoryCoordinates; import org.eclipse.tycho.p2.repository.module.ModuleArtifactRepository.ModuleArtifactDescriptor; -import org.eclipse.tycho.repository.publishing.WriteSessionContext; -import org.eclipse.tycho.repository.publishing.WriteSessionContext.ClassifierAndExtension; -import org.eclipse.tycho.repository.util.GAVArtifactDescriptorBase; /** * A p2 artifact repository implementation for the build output directory. Instances are persisted diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/module/ModuleArtifactRepositoryDelegate.java b/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/module/ModuleArtifactRepositoryDelegate.java index 889cc1751f..fddd396f18 100644 --- a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/module/ModuleArtifactRepositoryDelegate.java +++ b/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/module/ModuleArtifactRepositoryDelegate.java @@ -30,7 +30,7 @@ import org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor; import org.eclipse.equinox.p2.repository.artifact.IArtifactRequest; import org.eclipse.equinox.p2.repository.artifact.IFileArtifactRepository; -import org.eclipse.tycho.repository.publishing.WriteSessionContext; +import org.eclipse.tycho.WriteSessionContext; /** * Delegate for a {@link ModuleArtifactRepository} which additionally passes a diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/module/ModuleArtifactRepositoryFactory.java b/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/module/ModuleArtifactRepositoryFactory.java index 747696cd71..4026f45cd4 100644 --- a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/module/ModuleArtifactRepositoryFactory.java +++ b/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/module/ModuleArtifactRepositoryFactory.java @@ -20,7 +20,7 @@ import org.eclipse.equinox.p2.core.ProvisionException; import org.eclipse.equinox.p2.repository.artifact.IArtifactRepository; import org.eclipse.equinox.p2.repository.artifact.spi.ArtifactRepositoryFactory; -import org.eclipse.tycho.repository.util.RepositoryFactoryTools; +import org.eclipse.tycho.p2.repository.RepositoryFactoryTools; public class ModuleArtifactRepositoryFactory extends ArtifactRepositoryFactory { diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/module/ModuleMetadataRepository.java b/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/module/ModuleMetadataRepository.java index 97881e1694..14c35342b3 100644 --- a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/module/ModuleMetadataRepository.java +++ b/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/module/ModuleMetadataRepository.java @@ -12,7 +12,7 @@ *******************************************************************************/ package org.eclipse.tycho.p2.repository.module; -import static org.eclipse.tycho.repository.util.BundleConstants.BUNDLE_ID; +import static org.eclipse.tycho.p2.repository.BundleConstants.BUNDLE_ID; import java.io.File; import java.io.FileInputStream; diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/module/ModuleMetadataRepositoryFactory.java b/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/module/ModuleMetadataRepositoryFactory.java index f16d62c9d3..fc4ad222d4 100644 --- a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/module/ModuleMetadataRepositoryFactory.java +++ b/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/module/ModuleMetadataRepositoryFactory.java @@ -20,7 +20,7 @@ import org.eclipse.equinox.p2.core.ProvisionException; import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository; import org.eclipse.equinox.p2.repository.metadata.spi.MetadataRepositoryFactory; -import org.eclipse.tycho.repository.util.RepositoryFactoryTools; +import org.eclipse.tycho.p2.repository.RepositoryFactoryTools; public class ModuleMetadataRepositoryFactory extends MetadataRepositoryFactory { diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/module/PublishingRepositoryImpl.java b/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/module/PublishingRepositoryImpl.java index 9012306ee7..4ca1927511 100644 --- a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/module/PublishingRepositoryImpl.java +++ b/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/module/PublishingRepositoryImpl.java @@ -23,11 +23,11 @@ import org.eclipse.equinox.p2.repository.artifact.IArtifactRepository; import org.eclipse.equinox.p2.repository.artifact.IFileArtifactRepository; import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository; +import org.eclipse.tycho.IRawArtifactFileProvider; import org.eclipse.tycho.ReactorProjectIdentities; import org.eclipse.tycho.TychoConstants; -import org.eclipse.tycho.p2.artifact.provider.IRawArtifactFileProvider; -import org.eclipse.tycho.repository.publishing.PublishingRepository; -import org.eclipse.tycho.repository.publishing.WriteSessionContext; +import org.eclipse.tycho.WriteSessionContext; +import org.eclipse.tycho.p2.repository.PublishingRepository; public class PublishingRepositoryImpl implements PublishingRepository { private final ReactorProjectIdentities project; diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/artifact/provider/streaming/ArtifactSinkFactory.java b/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/streaming/ArtifactSinkFactory.java similarity index 95% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/artifact/provider/streaming/ArtifactSinkFactory.java rename to tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/streaming/ArtifactSinkFactory.java index 79fbc442e4..87945c39df 100644 --- a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/artifact/provider/streaming/ArtifactSinkFactory.java +++ b/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/streaming/ArtifactSinkFactory.java @@ -10,12 +10,14 @@ * Contributors: * Tobias Oberlies (SAP SE) - initial API and implementation *******************************************************************************/ -package org.eclipse.tycho.p2.artifact.provider.streaming; +package org.eclipse.tycho.p2.repository.streaming; import java.io.OutputStream; import org.eclipse.equinox.p2.metadata.IArtifactKey; import org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor; +import org.eclipse.tycho.IArtifactSink; +import org.eclipse.tycho.IRawArtifactSink; public final class ArtifactSinkFactory { diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/artifact/provider/streaming/StreamArtifactSink.java b/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/streaming/StreamArtifactSink.java similarity index 92% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/artifact/provider/streaming/StreamArtifactSink.java rename to tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/streaming/StreamArtifactSink.java index 97a4081608..5a6aabdb66 100644 --- a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/artifact/provider/streaming/StreamArtifactSink.java +++ b/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/streaming/StreamArtifactSink.java @@ -10,11 +10,13 @@ * Contributors: * Tobias Oberlies (SAP SE) - initial API and implementation *******************************************************************************/ -package org.eclipse.tycho.p2.artifact.provider.streaming; +package org.eclipse.tycho.p2.repository.streaming; import java.io.OutputStream; import org.eclipse.equinox.p2.metadata.IArtifactKey; +import org.eclipse.tycho.ArtifactSinkException; +import org.eclipse.tycho.IArtifactSink; class StreamArtifactSink implements IArtifactSink { diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/artifact/provider/streaming/StreamRawArtifactSink.java b/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/streaming/StreamRawArtifactSink.java similarity index 92% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/artifact/provider/streaming/StreamRawArtifactSink.java rename to tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/streaming/StreamRawArtifactSink.java index b2083cf006..429bd3e9b3 100644 --- a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/artifact/provider/streaming/StreamRawArtifactSink.java +++ b/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/repository/streaming/StreamRawArtifactSink.java @@ -10,11 +10,12 @@ * Contributors: * Tobias Oberlies (SAP SE) - initial API and implementation *******************************************************************************/ -package org.eclipse.tycho.p2.artifact.provider.streaming; +package org.eclipse.tycho.p2.repository.streaming; import java.io.OutputStream; import org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor; +import org.eclipse.tycho.IRawArtifactSink; final class StreamRawArtifactSink extends StreamArtifactSink implements IRawArtifactSink { diff --git a/tycho-bundles/pom.xml b/tycho-bundles/pom.xml index 2f92c627d2..4995b7f4ff 100644 --- a/tycho-bundles/pom.xml +++ b/tycho-bundles/pom.xml @@ -25,7 +25,7 @@ Tycho OSGi Bundles Parent - org.eclipse.tycho.embedder.shared + org.eclipse.tycho.core.shared \ No newline at end of file diff --git a/tycho-compiler-plugin/pom.xml b/tycho-compiler-plugin/pom.xml index 34f27115ae..543a85d573 100644 --- a/tycho-compiler-plugin/pom.xml +++ b/tycho-compiler-plugin/pom.xml @@ -22,7 +22,9 @@ tycho-compiler-plugin maven-plugin - + + ${minimal-maven-version} + Tycho OSGi Compiler Plugin A plugin for compiling OSGi bundles diff --git a/tycho-compiler-plugin/src/main/java/org/eclipse/tycho/compiler/AbstractOsgiCompilerMojo.java b/tycho-compiler-plugin/src/main/java/org/eclipse/tycho/compiler/AbstractOsgiCompilerMojo.java index d9310995c0..3a8c594234 100644 --- a/tycho-compiler-plugin/src/main/java/org/eclipse/tycho/compiler/AbstractOsgiCompilerMojo.java +++ b/tycho-compiler-plugin/src/main/java/org/eclipse/tycho/compiler/AbstractOsgiCompilerMojo.java @@ -69,6 +69,7 @@ import org.eclipse.tycho.ClasspathEntry; import org.eclipse.tycho.ClasspathEntry.AccessRule; import org.eclipse.tycho.DefaultArtifactKey; +import org.eclipse.tycho.ExecutionEnvironment; import org.eclipse.tycho.ReactorProject; import org.eclipse.tycho.SourcepathEntry; import org.eclipse.tycho.classpath.ClasspathContributor; @@ -77,7 +78,6 @@ import org.eclipse.tycho.core.TychoProjectManager; import org.eclipse.tycho.core.ee.ExecutionEnvironmentUtils; import org.eclipse.tycho.core.ee.StandardExecutionEnvironment; -import org.eclipse.tycho.core.ee.shared.ExecutionEnvironment; import org.eclipse.tycho.core.maven.MavenDependenciesResolver; import org.eclipse.tycho.core.maven.OSGiJavaToolchain; import org.eclipse.tycho.core.maven.ToolchainProvider; diff --git a/tycho-core/pom.xml b/tycho-core/pom.xml index 512fad0dcb..ea6f9bae5a 100644 --- a/tycho-core/pom.xml +++ b/tycho-core/pom.xml @@ -312,7 +312,18 @@ org.eclipse.jdt.core 3.33.0 - + + org.eclipse.pde + org.eclipse.pde.core + 3.16.100 + test + + + * + * + + + \ No newline at end of file diff --git a/tycho-core/src/main/java/org/eclipse/m2e/pde/target/shared/MavenBundleWrapper.java b/tycho-core/src/main/java/org/eclipse/m2e/pde/target/shared/MavenBundleWrapper.java index 60ff5ca609..4bf026ec04 100644 --- a/tycho-core/src/main/java/org/eclipse/m2e/pde/target/shared/MavenBundleWrapper.java +++ b/tycho-core/src/main/java/org/eclipse/m2e/pde/target/shared/MavenBundleWrapper.java @@ -27,6 +27,7 @@ import java.util.Set; import java.util.function.Function; import java.util.jar.Manifest; +import java.util.regex.Pattern; import java.util.stream.Collectors; import java.util.stream.Stream; @@ -40,9 +41,9 @@ import org.eclipse.aether.graph.Dependency; import org.eclipse.aether.graph.DependencyNode; import org.eclipse.aether.graph.DependencyVisitor; -import org.eclipse.aether.impl.SyncContextFactory; import org.eclipse.aether.repository.RemoteRepository; import org.eclipse.aether.resolution.DependencyRequest; +import org.eclipse.aether.spi.synccontext.SyncContextFactory; import org.eclipse.core.runtime.Platform; import org.eclipse.m2e.pde.target.shared.ProcessingMessage.Type; import org.osgi.framework.Constants; @@ -66,6 +67,8 @@ * */ public class MavenBundleWrapper { + private MavenBundleWrapper() { + } /** * Wraps an artifact (and possible its dependents if required) to produce a @@ -111,7 +114,7 @@ public boolean visitEnter(DependencyNode n) { } }); syncContext.acquire(lockList, null); - HashMap visited = new HashMap<>(); + Map visited = new HashMap<>(); WrappedBundle wrappedNode = getWrappedNode(node, instructionsLookup, visited); for (WrappedBundle wrap : visited.values()) { wrap.getJar().close(); @@ -230,17 +233,14 @@ public static Version createOSGiVersion(Model model) { return createOSGiVersion(model.getVersion()); } + private static final Pattern DASH = Pattern.compile("-"); + public static Version createOSGiVersion(String version) { if (version == null || version.isEmpty()) { return new Version(0, 0, 1); } try { - int index = version.indexOf('-'); - if (index > -1) { - StringBuilder sb = new StringBuilder(version); - sb.setCharAt(index, '.'); - return Version.parseVersion(sb.toString()); - } + version = DASH.matcher(version).replaceFirst("."); return Version.parseVersion(version); } catch (IllegalArgumentException e) { return new Version(0, 0, 1, version); diff --git a/tycho-core/src/main/java/org/eclipse/m2e/pde/target/shared/ProcessingMessage.java b/tycho-core/src/main/java/org/eclipse/m2e/pde/target/shared/ProcessingMessage.java index d57dfcc881..c1ca8122bb 100644 --- a/tycho-core/src/main/java/org/eclipse/m2e/pde/target/shared/ProcessingMessage.java +++ b/tycho-core/src/main/java/org/eclipse/m2e/pde/target/shared/ProcessingMessage.java @@ -17,31 +17,10 @@ /** * represents a message that occurred while processing the jar. */ -public final class ProcessingMessage { +public record ProcessingMessage(Artifact artifact, Type type, String message) { - private Artifact artifact; - private Type type; - private String message; - - ProcessingMessage(Artifact artifact, Type type, String message) { - this.artifact = artifact; - this.type = type; - this.message = message; - } - - public static enum Type { - ERROR, WARN + public enum Type { + ERROR, WARN } - public Artifact getArtifact() { - return artifact; - } - - public String getMessage() { - return message; - } - - public Type getType() { - return type; - } } diff --git a/tycho-core/src/main/java/org/eclipse/m2e/pde/target/shared/WrappedBundle.java b/tycho-core/src/main/java/org/eclipse/m2e/pde/target/shared/WrappedBundle.java index 88a83413e8..05137989c0 100644 --- a/tycho-core/src/main/java/org/eclipse/m2e/pde/target/shared/WrappedBundle.java +++ b/tycho-core/src/main/java/org/eclipse/m2e/pde/target/shared/WrappedBundle.java @@ -23,12 +23,12 @@ public final class WrappedBundle { - private DependencyNode node; - private List depends; - private String instructionsKey; - private Path file; - private Jar jar; - private List messages; + private final DependencyNode node; + private final List depends; + private final String instructionsKey; + private final Path file; + private final Jar jar; + private final List messages; WrappedBundle(DependencyNode node, List depends, String key, Path file, Jar jar, List messages) { @@ -48,16 +48,12 @@ Jar getJar() { return jar; } - /** - * @return the file where the wrappes bundle is located - */ + /** @return the location of the wrapped bundle's files */ public Path getFile() { return file; } - /** - * @return the messages that where produced - */ + /** @return the messages that where produced */ public Stream messages() { return Stream.concat(messages.stream(), depends.stream().flatMap(dep -> dep.messages())); } @@ -72,14 +68,9 @@ public boolean equals(Object obj) { if (this == obj) { return true; } - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - WrappedBundle other = (WrappedBundle) obj; - return Objects.equals(instructionsKey, other.instructionsKey) && Objects.equals(node, other.node); + return obj instanceof WrappedBundle other // + && Objects.equals(instructionsKey, other.instructionsKey) // + && Objects.equals(node, other.node); } } \ No newline at end of file diff --git a/tycho-core/src/main/java/org/eclipse/tycho/artifacts/configuration/TargetPlatformFilterConfigurationReader.java b/tycho-core/src/main/java/org/eclipse/tycho/artifacts/configuration/TargetPlatformFilterConfigurationReader.java index c91017c58f..8d7e315bbe 100644 --- a/tycho-core/src/main/java/org/eclipse/tycho/artifacts/configuration/TargetPlatformFilterConfigurationReader.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/artifacts/configuration/TargetPlatformFilterConfigurationReader.java @@ -17,10 +17,10 @@ import org.codehaus.plexus.component.annotations.Component; import org.codehaus.plexus.util.xml.Xpp3Dom; -import org.eclipse.tycho.artifacts.TargetPlatformFilter; -import org.eclipse.tycho.artifacts.TargetPlatformFilter.CapabilityPattern; -import org.eclipse.tycho.artifacts.TargetPlatformFilter.CapabilityType; -import org.eclipse.tycho.artifacts.TargetPlatformFilterSyntaxException; +import org.eclipse.tycho.targetplatform.TargetPlatformFilter; +import org.eclipse.tycho.targetplatform.TargetPlatformFilterSyntaxException; +import org.eclipse.tycho.targetplatform.TargetPlatformFilter.CapabilityPattern; +import org.eclipse.tycho.targetplatform.TargetPlatformFilter.CapabilityType; @Component(role = TargetPlatformFilterConfigurationReader.class) public class TargetPlatformFilterConfigurationReader { diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/core/shared/BuildPropertiesImpl.java b/tycho-core/src/main/java/org/eclipse/tycho/core/BuildPropertiesImpl.java similarity index 99% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/core/shared/BuildPropertiesImpl.java rename to tycho-core/src/main/java/org/eclipse/tycho/core/BuildPropertiesImpl.java index cca180abc8..42b3212d31 100644 --- a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/core/shared/BuildPropertiesImpl.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/core/BuildPropertiesImpl.java @@ -13,7 +13,7 @@ * [Bug 572481] Tycho does not understand "additional.bundles" directive in build.properties *******************************************************************************/ -package org.eclipse.tycho.core.shared; +package org.eclipse.tycho.core; import static java.util.Collections.unmodifiableMap; diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/core/shared/DependencyResolutionException.java b/tycho-core/src/main/java/org/eclipse/tycho/core/DependencyResolutionException.java similarity index 96% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/core/shared/DependencyResolutionException.java rename to tycho-core/src/main/java/org/eclipse/tycho/core/DependencyResolutionException.java index a73859ded6..d2cab989c0 100644 --- a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/core/shared/DependencyResolutionException.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/core/DependencyResolutionException.java @@ -10,7 +10,7 @@ * Contributors: * Christoph Läubrich - initial API and implementation *******************************************************************************/ -package org.eclipse.tycho.core.shared; +package org.eclipse.tycho.core; import java.util.Collection; import java.util.stream.Collectors; diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/core/shared/LRUCache.java b/tycho-core/src/main/java/org/eclipse/tycho/core/LRUCache.java similarity index 96% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/core/shared/LRUCache.java rename to tycho-core/src/main/java/org/eclipse/tycho/core/LRUCache.java index 04e8986a51..34f28f2a97 100644 --- a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/core/shared/LRUCache.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/core/LRUCache.java @@ -11,7 +11,7 @@ * SAP AG - initial API and implementation *******************************************************************************/ -package org.eclipse.tycho.core.shared; +package org.eclipse.tycho.core; import java.util.LinkedHashMap; import java.util.Map; diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/core/shared/MavenContextImpl.java b/tycho-core/src/main/java/org/eclipse/tycho/core/MavenContextImpl.java similarity index 94% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/core/shared/MavenContextImpl.java rename to tycho-core/src/main/java/org/eclipse/tycho/core/MavenContextImpl.java index bfccda0566..c69a2bd82d 100644 --- a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/core/shared/MavenContextImpl.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/core/MavenContextImpl.java @@ -11,7 +11,7 @@ * SAP AG - initial API and implementation * Christoph Läubrich - Bug 564363 - Make ReactorProject available in MavenContext *******************************************************************************/ -package org.eclipse.tycho.core.shared; +package org.eclipse.tycho.core; import java.io.File; import java.util.ArrayList; @@ -21,6 +21,8 @@ import java.util.Properties; import org.eclipse.tycho.ReactorProject; +import org.eclipse.tycho.core.shared.MavenContext; +import org.eclipse.tycho.core.shared.MavenLogger; public abstract class MavenContextImpl implements MavenContext { diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/core/shared/MavenDependenciesResolver.java b/tycho-core/src/main/java/org/eclipse/tycho/core/MavenDependenciesResolver.java similarity index 98% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/core/shared/MavenDependenciesResolver.java rename to tycho-core/src/main/java/org/eclipse/tycho/core/MavenDependenciesResolver.java index a85d4bd9ea..04ba1ad963 100644 --- a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/core/shared/MavenDependenciesResolver.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/core/MavenDependenciesResolver.java @@ -10,7 +10,7 @@ * Contributors: * Christoph Läubrich - initial API and implementation *******************************************************************************/ -package org.eclipse.tycho.core.shared; +package org.eclipse.tycho.core; import java.io.File; import java.io.IOException; diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/core/shared/MavenModelFacade.java b/tycho-core/src/main/java/org/eclipse/tycho/core/MavenModelFacade.java similarity index 96% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/core/shared/MavenModelFacade.java rename to tycho-core/src/main/java/org/eclipse/tycho/core/MavenModelFacade.java index 3a3e29a6aa..4962926008 100644 --- a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/core/shared/MavenModelFacade.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/core/MavenModelFacade.java @@ -10,7 +10,7 @@ * Contributors: * Christoph Läubrich - initial API and implementation *******************************************************************************/ -package org.eclipse.tycho.core.shared; +package org.eclipse.tycho.core; import java.util.stream.Stream; diff --git a/tycho-core/src/main/java/org/eclipse/tycho/core/TargetPlatformConfiguration.java b/tycho-core/src/main/java/org/eclipse/tycho/core/TargetPlatformConfiguration.java index 4520a0fa68..186b55c3f6 100644 --- a/tycho-core/src/main/java/org/eclipse/tycho/core/TargetPlatformConfiguration.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/core/TargetPlatformConfiguration.java @@ -32,10 +32,10 @@ import org.eclipse.tycho.ArtifactKey; import org.eclipse.tycho.OptionalResolutionAction; import org.eclipse.tycho.TargetEnvironment; -import org.eclipse.tycho.artifacts.TargetPlatformFilter; import org.eclipse.tycho.core.resolver.shared.IncludeSourceMode; import org.eclipse.tycho.core.resolver.shared.PomDependencies; import org.eclipse.tycho.targetplatform.TargetDefinitionFile; +import org.eclipse.tycho.targetplatform.TargetPlatformFilter; public class TargetPlatformConfiguration implements DependencyResolverConfiguration { diff --git a/tycho-core/src/main/java/org/eclipse/tycho/core/TychoProjectManager.java b/tycho-core/src/main/java/org/eclipse/tycho/core/TychoProjectManager.java index cae86b1f1f..89d9481778 100644 --- a/tycho-core/src/main/java/org/eclipse/tycho/core/TychoProjectManager.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/core/TychoProjectManager.java @@ -33,10 +33,10 @@ import org.codehaus.plexus.logging.Logger; import org.eclipse.tycho.ArtifactKey; import org.eclipse.tycho.DefaultArtifactKey; +import org.eclipse.tycho.ExecutionEnvironmentConfiguration; import org.eclipse.tycho.ReactorProject; import org.eclipse.tycho.TychoConstants; import org.eclipse.tycho.core.ee.ExecutionEnvironmentConfigurationImpl; -import org.eclipse.tycho.core.ee.shared.ExecutionEnvironmentConfiguration; import org.eclipse.tycho.core.osgitools.AbstractTychoProject; import org.eclipse.tycho.core.osgitools.BundleReader; import org.eclipse.tycho.core.osgitools.DefaultReactorProject; diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/core/shared/VersioningHelper.java b/tycho-core/src/main/java/org/eclipse/tycho/core/VersioningHelper.java similarity index 97% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/core/shared/VersioningHelper.java rename to tycho-core/src/main/java/org/eclipse/tycho/core/VersioningHelper.java index 74f180cf25..a58f74bf08 100644 --- a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/core/shared/VersioningHelper.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/core/VersioningHelper.java @@ -10,7 +10,7 @@ * Contributors: * SAP SE - initial API and implementation *******************************************************************************/ -package org.eclipse.tycho.core.shared; +package org.eclipse.tycho.core; public class VersioningHelper { diff --git a/tycho-core/src/main/java/org/eclipse/tycho/core/ee/CustomExecutionEnvironment.java b/tycho-core/src/main/java/org/eclipse/tycho/core/ee/CustomExecutionEnvironment.java index 4c4fcea89c..dcf6a26b64 100644 --- a/tycho-core/src/main/java/org/eclipse/tycho/core/ee/CustomExecutionEnvironment.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/core/ee/CustomExecutionEnvironment.java @@ -25,9 +25,9 @@ import java.util.stream.Collectors; import org.eclipse.osgi.internal.framework.EquinoxConfiguration; -import org.eclipse.tycho.core.ee.shared.ExecutionEnvironment; -import org.eclipse.tycho.core.ee.shared.SystemCapability; -import org.eclipse.tycho.core.ee.shared.SystemCapability.Type; +import org.eclipse.tycho.ExecutionEnvironment; +import org.eclipse.tycho.SystemCapability; +import org.eclipse.tycho.SystemCapability.Type; import org.osgi.framework.Constants; public class CustomExecutionEnvironment implements ExecutionEnvironment { diff --git a/tycho-core/src/main/java/org/eclipse/tycho/core/ee/ExecutionEnvironmentConfigurationImpl.java b/tycho-core/src/main/java/org/eclipse/tycho/core/ee/ExecutionEnvironmentConfigurationImpl.java index 56edd435e9..4610e10d11 100644 --- a/tycho-core/src/main/java/org/eclipse/tycho/core/ee/ExecutionEnvironmentConfigurationImpl.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/core/ee/ExecutionEnvironmentConfigurationImpl.java @@ -20,9 +20,9 @@ import org.apache.maven.toolchain.ToolchainManager; import org.codehaus.plexus.logging.Logger; import org.eclipse.tycho.BuildFailureException; -import org.eclipse.tycho.core.ee.shared.ExecutionEnvironment; -import org.eclipse.tycho.core.ee.shared.ExecutionEnvironmentConfiguration; -import org.eclipse.tycho.core.ee.shared.SystemCapability; +import org.eclipse.tycho.ExecutionEnvironment; +import org.eclipse.tycho.ExecutionEnvironmentConfiguration; +import org.eclipse.tycho.SystemCapability; public class ExecutionEnvironmentConfigurationImpl implements ExecutionEnvironmentConfiguration { // Most likely best to always be the latest known supported EE diff --git a/tycho-core/src/main/java/org/eclipse/tycho/core/ee/ExecutionEnvironmentUtils.java b/tycho-core/src/main/java/org/eclipse/tycho/core/ee/ExecutionEnvironmentUtils.java index 09252ef0a1..a618a962a4 100644 --- a/tycho-core/src/main/java/org/eclipse/tycho/core/ee/ExecutionEnvironmentUtils.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/core/ee/ExecutionEnvironmentUtils.java @@ -33,10 +33,10 @@ import org.codehaus.plexus.logging.Logger; import org.eclipse.equinox.p2.metadata.IInstallableUnit; import org.eclipse.osgi.internal.framework.EquinoxConfiguration; +import org.eclipse.tycho.ExecutionEnvironment; import org.eclipse.tycho.TargetEnvironment; +import org.eclipse.tycho.ExecutionEnvironment.SystemPackageEntry; import org.eclipse.tycho.core.ee.StandardExecutionEnvironment.JavaInfo; -import org.eclipse.tycho.core.ee.shared.ExecutionEnvironment; -import org.eclipse.tycho.core.ee.shared.ExecutionEnvironment.SystemPackageEntry; import org.osgi.framework.BundleActivator; import org.osgi.framework.Constants; import org.osgi.framework.Version; diff --git a/tycho-core/src/main/java/org/eclipse/tycho/core/ee/NoExecutionEnvironment.java b/tycho-core/src/main/java/org/eclipse/tycho/core/ee/NoExecutionEnvironment.java index 7e7667089f..539d796859 100644 --- a/tycho-core/src/main/java/org/eclipse/tycho/core/ee/NoExecutionEnvironment.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/core/ee/NoExecutionEnvironment.java @@ -13,7 +13,7 @@ import java.util.Collections; import java.util.Properties; -import org.eclipse.tycho.core.ee.shared.ExecutionEnvironment; +import org.eclipse.tycho.ExecutionEnvironment; public class NoExecutionEnvironment implements ExecutionEnvironment { diff --git a/tycho-core/src/main/java/org/eclipse/tycho/core/ee/StandardExecutionEnvironment.java b/tycho-core/src/main/java/org/eclipse/tycho/core/ee/StandardExecutionEnvironment.java index 7c908b9198..41a5ed4204 100644 --- a/tycho-core/src/main/java/org/eclipse/tycho/core/ee/StandardExecutionEnvironment.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/core/ee/StandardExecutionEnvironment.java @@ -35,8 +35,8 @@ import org.codehaus.plexus.logging.Logger; import org.eclipse.osgi.internal.framework.EquinoxConfiguration; import org.eclipse.osgi.util.ManifestElement; +import org.eclipse.tycho.ExecutionEnvironment; import org.eclipse.tycho.core.ee.EEVersion.EEType; -import org.eclipse.tycho.core.ee.shared.ExecutionEnvironment; import org.osgi.framework.BundleException; import org.osgi.framework.Constants; import org.osgi.framework.Version; diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/core/ee/impl/AllKnownEEsResolutionHints.java b/tycho-core/src/main/java/org/eclipse/tycho/core/ee/impl/AllKnownEEsResolutionHints.java similarity index 97% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/core/ee/impl/AllKnownEEsResolutionHints.java rename to tycho-core/src/main/java/org/eclipse/tycho/core/ee/impl/AllKnownEEsResolutionHints.java index 0d99762030..96070d55f5 100644 --- a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/core/ee/impl/AllKnownEEsResolutionHints.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/core/ee/impl/AllKnownEEsResolutionHints.java @@ -21,8 +21,8 @@ import org.eclipse.equinox.p2.metadata.IInstallableUnit; import org.eclipse.equinox.p2.metadata.IRequirement; import org.eclipse.equinox.p2.metadata.VersionedId; +import org.eclipse.tycho.ExecutionEnvironment; import org.eclipse.tycho.ExecutionEnvironmentResolutionHints; -import org.eclipse.tycho.core.ee.shared.ExecutionEnvironment; public class AllKnownEEsResolutionHints implements ExecutionEnvironmentResolutionHints { diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/core/ee/impl/CustomEEResolutionHandler.java b/tycho-core/src/main/java/org/eclipse/tycho/core/ee/impl/CustomEEResolutionHandler.java similarity index 94% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/core/ee/impl/CustomEEResolutionHandler.java rename to tycho-core/src/main/java/org/eclipse/tycho/core/ee/impl/CustomEEResolutionHandler.java index 9a22f7963b..26234c739c 100644 --- a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/core/ee/impl/CustomEEResolutionHandler.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/core/ee/impl/CustomEEResolutionHandler.java @@ -20,10 +20,10 @@ import org.eclipse.equinox.p2.metadata.IProvidedCapability; import org.eclipse.equinox.p2.publisher.actions.JREAction; import org.eclipse.equinox.spi.p2.publisher.PublisherHelper; +import org.eclipse.tycho.ExecutionEnvironmentConfiguration; import org.eclipse.tycho.ExecutionEnvironmentResolutionHints; -import org.eclipse.tycho.core.ee.shared.ExecutionEnvironmentConfiguration; -import org.eclipse.tycho.core.ee.shared.SystemCapability; -import org.eclipse.tycho.core.ee.shared.SystemCapability.Type; +import org.eclipse.tycho.SystemCapability; +import org.eclipse.tycho.SystemCapability.Type; class CustomEEResolutionHandler extends ExecutionEnvironmentResolutionHandler { diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/core/ee/impl/CustomEEResolutionHints.java b/tycho-core/src/main/java/org/eclipse/tycho/core/ee/impl/CustomEEResolutionHints.java similarity index 100% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/core/ee/impl/CustomEEResolutionHints.java rename to tycho-core/src/main/java/org/eclipse/tycho/core/ee/impl/CustomEEResolutionHints.java diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/core/ee/impl/ExecutionEnvironmentResolutionHandler.java b/tycho-core/src/main/java/org/eclipse/tycho/core/ee/impl/ExecutionEnvironmentResolutionHandler.java similarity index 97% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/core/ee/impl/ExecutionEnvironmentResolutionHandler.java rename to tycho-core/src/main/java/org/eclipse/tycho/core/ee/impl/ExecutionEnvironmentResolutionHandler.java index e8740c5b4f..ee01a4b618 100644 --- a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/core/ee/impl/ExecutionEnvironmentResolutionHandler.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/core/ee/impl/ExecutionEnvironmentResolutionHandler.java @@ -16,8 +16,8 @@ import java.util.Collection; import org.eclipse.equinox.p2.metadata.IInstallableUnit; +import org.eclipse.tycho.ExecutionEnvironmentConfiguration; import org.eclipse.tycho.ExecutionEnvironmentResolutionHints; -import org.eclipse.tycho.core.ee.shared.ExecutionEnvironmentConfiguration; import org.eclipse.tycho.core.shared.MavenLogger; public abstract class ExecutionEnvironmentResolutionHandler { diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/core/ee/impl/InvalidEENameException.java b/tycho-core/src/main/java/org/eclipse/tycho/core/ee/impl/InvalidEENameException.java similarity index 100% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/core/ee/impl/InvalidEENameException.java rename to tycho-core/src/main/java/org/eclipse/tycho/core/ee/impl/InvalidEENameException.java diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/core/ee/impl/NoExecutionEnvironmentResolutionHints.java b/tycho-core/src/main/java/org/eclipse/tycho/core/ee/impl/NoExecutionEnvironmentResolutionHints.java similarity index 100% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/core/ee/impl/NoExecutionEnvironmentResolutionHints.java rename to tycho-core/src/main/java/org/eclipse/tycho/core/ee/impl/NoExecutionEnvironmentResolutionHints.java diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/core/ee/impl/StandardEEResolutionHandler.java b/tycho-core/src/main/java/org/eclipse/tycho/core/ee/impl/StandardEEResolutionHandler.java similarity index 97% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/core/ee/impl/StandardEEResolutionHandler.java rename to tycho-core/src/main/java/org/eclipse/tycho/core/ee/impl/StandardEEResolutionHandler.java index fbe89e13ac..316487aa56 100644 --- a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/core/ee/impl/StandardEEResolutionHandler.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/core/ee/impl/StandardEEResolutionHandler.java @@ -24,8 +24,8 @@ import org.eclipse.equinox.p2.metadata.IInstallableUnit; import org.eclipse.equinox.p2.publisher.actions.JREAction; +import org.eclipse.tycho.ExecutionEnvironmentConfiguration; import org.eclipse.tycho.ExecutionEnvironmentResolutionHints; -import org.eclipse.tycho.core.ee.shared.ExecutionEnvironmentConfiguration; import org.eclipse.tycho.core.shared.MavenLogger; class StandardEEResolutionHandler extends ExecutionEnvironmentResolutionHandler { diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/core/ee/impl/StandardEEResolutionHints.java b/tycho-core/src/main/java/org/eclipse/tycho/core/ee/impl/StandardEEResolutionHints.java similarity index 99% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/core/ee/impl/StandardEEResolutionHints.java rename to tycho-core/src/main/java/org/eclipse/tycho/core/ee/impl/StandardEEResolutionHints.java index 25c400ee24..59e0e0a614 100644 --- a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/core/ee/impl/StandardEEResolutionHints.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/core/ee/impl/StandardEEResolutionHints.java @@ -32,8 +32,8 @@ import org.eclipse.equinox.p2.metadata.VersionedId; import org.eclipse.equinox.spi.p2.publisher.PublisherHelper; import org.eclipse.osgi.util.ManifestElement; +import org.eclipse.tycho.ExecutionEnvironment; import org.eclipse.tycho.ExecutionEnvironmentResolutionHints; -import org.eclipse.tycho.core.ee.shared.ExecutionEnvironment; import org.osgi.framework.BundleException; import org.osgi.framework.Constants; diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/core/ee/shared/ExecutionEnvironmentConfigurationStub.java b/tycho-core/src/main/java/org/eclipse/tycho/core/ee/shared/ExecutionEnvironmentConfigurationStub.java similarity index 94% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/core/ee/shared/ExecutionEnvironmentConfigurationStub.java rename to tycho-core/src/main/java/org/eclipse/tycho/core/ee/shared/ExecutionEnvironmentConfigurationStub.java index d5dfd552a1..00b3322311 100644 --- a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/core/ee/shared/ExecutionEnvironmentConfigurationStub.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/core/ee/shared/ExecutionEnvironmentConfigurationStub.java @@ -15,6 +15,10 @@ import java.util.Collection; import java.util.List; +import org.eclipse.tycho.ExecutionEnvironment; +import org.eclipse.tycho.ExecutionEnvironmentConfiguration; +import org.eclipse.tycho.SystemCapability; + /** * {@link ExecutionEnvironmentConfiguration} instance usable for additional calls of the target * platform computation and dependency resolution. diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/core/ee/shared/ExecutionEnvironmentStub.java b/tycho-core/src/main/java/org/eclipse/tycho/core/ee/shared/ExecutionEnvironmentStub.java similarity index 97% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/core/ee/shared/ExecutionEnvironmentStub.java rename to tycho-core/src/main/java/org/eclipse/tycho/core/ee/shared/ExecutionEnvironmentStub.java index 7f12a8e436..681dc18b20 100644 --- a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/core/ee/shared/ExecutionEnvironmentStub.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/core/ee/shared/ExecutionEnvironmentStub.java @@ -14,6 +14,8 @@ import java.util.List; import java.util.Properties; +import org.eclipse.tycho.ExecutionEnvironment; + public class ExecutionEnvironmentStub implements ExecutionEnvironment { private final String profileName; diff --git a/tycho-core/src/main/java/org/eclipse/tycho/core/locking/FileLockServiceImpl.java b/tycho-core/src/main/java/org/eclipse/tycho/core/locking/FileLockServiceImpl.java index 98bdd75a3e..270afe2d9f 100644 --- a/tycho-core/src/main/java/org/eclipse/tycho/core/locking/FileLockServiceImpl.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/core/locking/FileLockServiceImpl.java @@ -19,7 +19,7 @@ import java.util.concurrent.ConcurrentHashMap; import org.codehaus.plexus.component.annotations.Component; -import org.eclipse.tycho.locking.facade.FileLockService; +import org.eclipse.tycho.FileLockService; @Component(role = FileLockService.class) public class FileLockServiceImpl implements FileLockService { diff --git a/tycho-core/src/main/java/org/eclipse/tycho/core/locking/FileLockerImpl.java b/tycho-core/src/main/java/org/eclipse/tycho/core/locking/FileLockerImpl.java index 8f5649106c..7fcb2a07ff 100644 --- a/tycho-core/src/main/java/org/eclipse/tycho/core/locking/FileLockerImpl.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/core/locking/FileLockerImpl.java @@ -21,8 +21,8 @@ import java.nio.file.Path; import java.nio.file.StandardOpenOption; -import org.eclipse.tycho.locking.facade.FileLocker; -import org.eclipse.tycho.locking.facade.LockTimeoutException; +import org.eclipse.tycho.FileLocker; +import org.eclipse.tycho.LockTimeoutException; public class FileLockerImpl implements FileLocker { diff --git a/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/AbstractTychoProject.java b/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/AbstractTychoProject.java index edf727a8d0..3082711f07 100644 --- a/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/AbstractTychoProject.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/AbstractTychoProject.java @@ -32,6 +32,7 @@ import org.eclipse.aether.collection.DependencyCollectionException; import org.eclipse.aether.resolution.DependencyResolutionException; import org.eclipse.tycho.DependencyArtifacts; +import org.eclipse.tycho.ExecutionEnvironmentConfiguration; import org.eclipse.tycho.IArtifactFacade; import org.eclipse.tycho.ReactorProject; import org.eclipse.tycho.TargetEnvironment; @@ -39,7 +40,6 @@ import org.eclipse.tycho.core.TargetPlatformConfiguration; import org.eclipse.tycho.core.TychoProject; import org.eclipse.tycho.core.TychoProjectManager; -import org.eclipse.tycho.core.ee.shared.ExecutionEnvironmentConfiguration; import org.eclipse.tycho.core.maven.MavenArtifactFacade; import org.eclipse.tycho.core.maven.MavenDependenciesResolver; import org.eclipse.tycho.core.osgitools.targetplatform.MultiEnvironmentDependencyArtifacts; diff --git a/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/BaselineServiceImpl.java b/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/BaselineServiceImpl.java index a0841444d8..cc049a7c68 100644 --- a/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/BaselineServiceImpl.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/BaselineServiceImpl.java @@ -43,11 +43,11 @@ import org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor; import org.eclipse.equinox.p2.repository.artifact.IArtifactRepository; import org.eclipse.tycho.MavenRepositoryLocation; +import org.eclipse.tycho.core.shared.StatusTool; import org.eclipse.tycho.p2.metadata.IP2Artifact; import org.eclipse.tycho.p2.publisher.P2Artifact; import org.eclipse.tycho.p2maven.ListQueryable; import org.eclipse.tycho.p2maven.repository.P2RepositoryManager; -import org.eclipse.tycho.repository.util.StatusTool; @Component(role = BaselineService.class) public class BaselineServiceImpl implements BaselineService { diff --git a/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/BuildPropertiesParserImpl.java b/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/BuildPropertiesParserImpl.java index be084dd857..d28cdc5be0 100644 --- a/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/BuildPropertiesParserImpl.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/BuildPropertiesParserImpl.java @@ -35,8 +35,8 @@ import org.eclipse.tycho.BuildPropertiesParser; import org.eclipse.tycho.Interpolator; import org.eclipse.tycho.ReactorProject; +import org.eclipse.tycho.core.BuildPropertiesImpl; import org.eclipse.tycho.core.maven.TychoInterpolator; -import org.eclipse.tycho.core.shared.BuildPropertiesImpl; @Component(role = BuildPropertiesParser.class) public class BuildPropertiesParserImpl implements BuildPropertiesParser, Disposable { diff --git a/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/DefaultBundleReader.java b/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/DefaultBundleReader.java index 72b0f639f9..841247215c 100644 --- a/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/DefaultBundleReader.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/DefaultBundleReader.java @@ -35,9 +35,9 @@ import org.codehaus.plexus.component.annotations.Component; import org.codehaus.plexus.component.annotations.Requirement; import org.codehaus.plexus.logging.AbstractLogEnabled; +import org.eclipse.tycho.FileLockService; +import org.eclipse.tycho.FileLocker; import org.eclipse.tycho.TychoConstants; -import org.eclipse.tycho.locking.facade.FileLockService; -import org.eclipse.tycho.locking.facade.FileLocker; @Component(role = BundleReader.class) public class DefaultBundleReader extends AbstractLogEnabled implements BundleReader { diff --git a/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/EquinoxResolver.java b/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/EquinoxResolver.java index 043df68c01..c317116728 100644 --- a/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/EquinoxResolver.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/EquinoxResolver.java @@ -62,14 +62,14 @@ import org.eclipse.tycho.BuildPropertiesParser; import org.eclipse.tycho.ClasspathEntry.AccessRule; import org.eclipse.tycho.DependencyArtifacts; +import org.eclipse.tycho.ExecutionEnvironment; +import org.eclipse.tycho.ExecutionEnvironmentConfiguration; import org.eclipse.tycho.ReactorProject; import org.eclipse.tycho.TargetEnvironment; import org.eclipse.tycho.core.TargetPlatformConfiguration; import org.eclipse.tycho.core.TychoProjectManager; import org.eclipse.tycho.core.ee.ExecutionEnvironmentUtils; import org.eclipse.tycho.core.ee.StandardExecutionEnvironment; -import org.eclipse.tycho.core.ee.shared.ExecutionEnvironment; -import org.eclipse.tycho.core.ee.shared.ExecutionEnvironmentConfiguration; import org.eclipse.tycho.core.osgitools.DependencyComputer.DependencyEntry; import org.eclipse.tycho.core.utils.TychoProjectUtils; import org.osgi.framework.Bundle; diff --git a/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/OsgiBundleProject.java b/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/OsgiBundleProject.java index 9eae7a3c43..2d26410479 100644 --- a/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/OsgiBundleProject.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/OsgiBundleProject.java @@ -50,6 +50,7 @@ import org.eclipse.tycho.ClasspathEntry.AccessRule; import org.eclipse.tycho.DefaultArtifactKey; import org.eclipse.tycho.DependencyArtifacts; +import org.eclipse.tycho.ExecutionEnvironmentConfiguration; import org.eclipse.tycho.PackagingType; import org.eclipse.tycho.PlatformPropertiesUtils; import org.eclipse.tycho.ReactorProject; @@ -64,7 +65,6 @@ import org.eclipse.tycho.core.TychoProject; import org.eclipse.tycho.core.ee.ExecutionEnvironmentUtils; import org.eclipse.tycho.core.ee.StandardExecutionEnvironment; -import org.eclipse.tycho.core.ee.shared.ExecutionEnvironmentConfiguration; import org.eclipse.tycho.core.osgitools.DefaultClasspathEntry.DefaultAccessRule; import org.eclipse.tycho.core.osgitools.DependencyComputer.DependencyEntry; import org.eclipse.tycho.core.osgitools.project.BuildOutputJar; diff --git a/tycho-core/src/main/java/org/eclipse/tycho/core/resolver/DefaultP2ResolutionResult.java b/tycho-core/src/main/java/org/eclipse/tycho/core/resolver/DefaultP2ResolutionResult.java index 1b907f6ab4..1c0145c602 100644 --- a/tycho-core/src/main/java/org/eclipse/tycho/core/resolver/DefaultP2ResolutionResult.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/core/resolver/DefaultP2ResolutionResult.java @@ -29,9 +29,9 @@ import org.eclipse.tycho.ArtifactType; import org.eclipse.tycho.DefaultArtifactKey; import org.eclipse.tycho.core.resolver.target.ArtifactTypeHelper; -import org.eclipse.tycho.core.resolver.target.P2TargetPlatform; import org.eclipse.tycho.p2.resolver.ClassifiedArtifactKey; import org.eclipse.tycho.p2.resolver.ClassifiedLocation; +import org.eclipse.tycho.targetplatform.P2TargetPlatform; public class DefaultP2ResolutionResult implements P2ResolutionResult { diff --git a/tycho-core/src/main/java/org/eclipse/tycho/core/resolver/MavenTargetDefinitionContent.java b/tycho-core/src/main/java/org/eclipse/tycho/core/resolver/MavenTargetDefinitionContent.java index 4106a84537..fc4e016f03 100644 --- a/tycho-core/src/main/java/org/eclipse/tycho/core/resolver/MavenTargetDefinitionContent.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/core/resolver/MavenTargetDefinitionContent.java @@ -66,16 +66,15 @@ import org.eclipse.osgi.service.resolver.BundleDescription; import org.eclipse.tycho.IArtifactFacade; import org.eclipse.tycho.TychoConstants; +import org.eclipse.tycho.core.DependencyResolutionException; +import org.eclipse.tycho.core.MavenDependenciesResolver; +import org.eclipse.tycho.core.MavenModelFacade; import org.eclipse.tycho.core.publisher.TychoMavenPropertiesAdvice; import org.eclipse.tycho.core.resolver.shared.IncludeSourceMode; import org.eclipse.tycho.core.resolver.target.FileArtifactRepository; import org.eclipse.tycho.core.resolver.target.SupplierMetadataRepository; -import org.eclipse.tycho.core.resolver.target.TargetDefinitionContent; -import org.eclipse.tycho.core.shared.DependencyResolutionException; import org.eclipse.tycho.core.shared.MavenContext; -import org.eclipse.tycho.core.shared.MavenDependenciesResolver; import org.eclipse.tycho.core.shared.MavenLogger; -import org.eclipse.tycho.core.shared.MavenModelFacade; import org.eclipse.tycho.osgi.configuration.MavenDependenciesResolverConfigurer; import org.eclipse.tycho.p2.repository.GAV; import org.eclipse.tycho.p2.resolver.BundlePublisher; @@ -89,6 +88,7 @@ import org.eclipse.tycho.targetplatform.TargetDefinition.MavenGAVLocation; import org.eclipse.tycho.targetplatform.TargetDefinition.MavenGAVLocation.DependencyDepth; import org.eclipse.tycho.targetplatform.TargetDefinition.MavenGAVLocation.MissingManifestStrategy; +import org.eclipse.tycho.targetplatform.TargetDefinitionContent; import org.eclipse.tycho.targetplatform.TargetDefinitionResolutionException; import org.osgi.framework.BundleException; import org.osgi.framework.Constants; diff --git a/tycho-core/src/main/java/org/eclipse/tycho/core/resolver/MavenTargetLocationFactory.java b/tycho-core/src/main/java/org/eclipse/tycho/core/resolver/MavenTargetLocationFactory.java index db92d357fb..9679c66305 100644 --- a/tycho-core/src/main/java/org/eclipse/tycho/core/resolver/MavenTargetLocationFactory.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/core/resolver/MavenTargetLocationFactory.java @@ -18,10 +18,10 @@ import org.codehaus.plexus.component.annotations.Requirement; import org.eclipse.aether.impl.SyncContextFactory; import org.eclipse.equinox.p2.core.IProvisioningAgent; +import org.eclipse.tycho.core.MavenDependenciesResolver; import org.eclipse.tycho.core.resolver.shared.IncludeSourceMode; -import org.eclipse.tycho.core.resolver.target.TargetDefinitionContent; import org.eclipse.tycho.core.shared.MavenContext; -import org.eclipse.tycho.core.shared.MavenDependenciesResolver; +import org.eclipse.tycho.targetplatform.TargetDefinitionContent; import org.eclipse.tycho.targetplatform.TargetDefinition.MavenGAVLocation; @Component(role = MavenTargetLocationFactory.class) diff --git a/tycho-core/src/main/java/org/eclipse/tycho/core/resolver/P2Resolver.java b/tycho-core/src/main/java/org/eclipse/tycho/core/resolver/P2Resolver.java index 71763037f9..4b9c54060e 100644 --- a/tycho-core/src/main/java/org/eclipse/tycho/core/resolver/P2Resolver.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/core/resolver/P2Resolver.java @@ -20,11 +20,11 @@ import org.eclipse.equinox.p2.metadata.IRequirement; import org.eclipse.tycho.ArtifactKey; +import org.eclipse.tycho.ExecutionEnvironmentConfiguration; import org.eclipse.tycho.IllegalArtifactReferenceException; import org.eclipse.tycho.ReactorProject; import org.eclipse.tycho.TargetEnvironment; import org.eclipse.tycho.TargetPlatform; -import org.eclipse.tycho.core.ee.shared.ExecutionEnvironmentConfiguration; import org.eclipse.tycho.core.resolver.shared.PomDependencies; import org.eclipse.tycho.p2.target.facade.TargetPlatformConfigurationStub; diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/core/resolver/shared/DependencySeed.java b/tycho-core/src/main/java/org/eclipse/tycho/core/resolver/shared/DependencySeed.java similarity index 100% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/core/resolver/shared/DependencySeed.java rename to tycho-core/src/main/java/org/eclipse/tycho/core/resolver/shared/DependencySeed.java diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/core/resolver/shared/IncludeSourceMode.java b/tycho-core/src/main/java/org/eclipse/tycho/core/resolver/shared/IncludeSourceMode.java similarity index 100% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/core/resolver/shared/IncludeSourceMode.java rename to tycho-core/src/main/java/org/eclipse/tycho/core/resolver/shared/IncludeSourceMode.java diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/core/resolver/shared/PomDependencies.java b/tycho-core/src/main/java/org/eclipse/tycho/core/resolver/shared/PomDependencies.java similarity index 100% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/core/resolver/shared/PomDependencies.java rename to tycho-core/src/main/java/org/eclipse/tycho/core/resolver/shared/PomDependencies.java diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/core/resolver/target/ArtifactMatcher.java b/tycho-core/src/main/java/org/eclipse/tycho/core/resolver/target/ArtifactMatcher.java similarity index 100% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/core/resolver/target/ArtifactMatcher.java rename to tycho-core/src/main/java/org/eclipse/tycho/core/resolver/target/ArtifactMatcher.java diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/core/resolver/target/ArtifactTypeHelper.java b/tycho-core/src/main/java/org/eclipse/tycho/core/resolver/target/ArtifactTypeHelper.java similarity index 100% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/core/resolver/target/ArtifactTypeHelper.java rename to tycho-core/src/main/java/org/eclipse/tycho/core/resolver/target/ArtifactTypeHelper.java diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/core/resolver/target/DuplicateReactorIUsException.java b/tycho-core/src/main/java/org/eclipse/tycho/core/resolver/target/DuplicateReactorIUsException.java similarity index 100% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/core/resolver/target/DuplicateReactorIUsException.java rename to tycho-core/src/main/java/org/eclipse/tycho/core/resolver/target/DuplicateReactorIUsException.java diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/core/resolver/target/FileArtifactRepository.java b/tycho-core/src/main/java/org/eclipse/tycho/core/resolver/target/FileArtifactRepository.java similarity index 100% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/core/resolver/target/FileArtifactRepository.java rename to tycho-core/src/main/java/org/eclipse/tycho/core/resolver/target/FileArtifactRepository.java diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/core/resolver/target/MavenBundleInfo.java b/tycho-core/src/main/java/org/eclipse/tycho/core/resolver/target/MavenBundleInfo.java similarity index 100% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/core/resolver/target/MavenBundleInfo.java rename to tycho-core/src/main/java/org/eclipse/tycho/core/resolver/target/MavenBundleInfo.java diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/core/resolver/target/MavenBundlesArtifactRepository.java b/tycho-core/src/main/java/org/eclipse/tycho/core/resolver/target/MavenBundlesArtifactRepository.java similarity index 100% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/core/resolver/target/MavenBundlesArtifactRepository.java rename to tycho-core/src/main/java/org/eclipse/tycho/core/resolver/target/MavenBundlesArtifactRepository.java diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/core/resolver/target/SupplierMetadataRepository.java b/tycho-core/src/main/java/org/eclipse/tycho/core/resolver/target/SupplierMetadataRepository.java similarity index 100% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/core/resolver/target/SupplierMetadataRepository.java rename to tycho-core/src/main/java/org/eclipse/tycho/core/resolver/target/SupplierMetadataRepository.java diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/core/resolver/target/TargetPlatformFilterEvaluator.java b/tycho-core/src/main/java/org/eclipse/tycho/core/resolver/target/TargetPlatformFilterEvaluator.java similarity index 97% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/core/resolver/target/TargetPlatformFilterEvaluator.java rename to tycho-core/src/main/java/org/eclipse/tycho/core/resolver/target/TargetPlatformFilterEvaluator.java index 4b7298b4ec..70437f18e3 100644 --- a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/core/resolver/target/TargetPlatformFilterEvaluator.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/core/resolver/target/TargetPlatformFilterEvaluator.java @@ -24,11 +24,11 @@ import org.eclipse.equinox.p2.metadata.VersionRange; import org.eclipse.equinox.p2.publisher.eclipse.BundlesAction; import org.eclipse.equinox.spi.p2.publisher.PublisherHelper; -import org.eclipse.tycho.artifacts.TargetPlatformFilter; -import org.eclipse.tycho.artifacts.TargetPlatformFilter.CapabilityPattern; -import org.eclipse.tycho.artifacts.TargetPlatformFilter.CapabilityType; -import org.eclipse.tycho.artifacts.TargetPlatformFilterSyntaxException; import org.eclipse.tycho.core.shared.MavenLogger; +import org.eclipse.tycho.targetplatform.TargetPlatformFilter; +import org.eclipse.tycho.targetplatform.TargetPlatformFilterSyntaxException; +import org.eclipse.tycho.targetplatform.TargetPlatformFilter.CapabilityPattern; +import org.eclipse.tycho.targetplatform.TargetPlatformFilter.CapabilityType; public class TargetPlatformFilterEvaluator { diff --git a/tycho-core/src/main/java/org/eclipse/tycho/osgi/configuration/FileLockServiceConfigurator.java b/tycho-core/src/main/java/org/eclipse/tycho/osgi/configuration/FileLockServiceConfigurator.java index ce2ed1c7e6..b0be87c017 100644 --- a/tycho-core/src/main/java/org/eclipse/tycho/osgi/configuration/FileLockServiceConfigurator.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/osgi/configuration/FileLockServiceConfigurator.java @@ -17,7 +17,7 @@ import org.codehaus.plexus.component.annotations.Requirement; import org.eclipse.sisu.equinox.embedder.EmbeddedEquinox; import org.eclipse.sisu.equinox.embedder.EquinoxLifecycleListener; -import org.eclipse.tycho.locking.facade.FileLockService; +import org.eclipse.tycho.FileLockService; @Component(role = EquinoxLifecycleListener.class, hint = "FileLockServiceConfigurator") public class FileLockServiceConfigurator implements EquinoxLifecycleListener { diff --git a/tycho-core/src/main/java/org/eclipse/tycho/osgi/configuration/MavenDependenciesResolverConfigurer.java b/tycho-core/src/main/java/org/eclipse/tycho/osgi/configuration/MavenDependenciesResolverConfigurer.java index dac2a10f44..2b1e660de9 100644 --- a/tycho-core/src/main/java/org/eclipse/tycho/osgi/configuration/MavenDependenciesResolverConfigurer.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/osgi/configuration/MavenDependenciesResolverConfigurer.java @@ -41,10 +41,10 @@ import org.codehaus.plexus.logging.Logger; import org.codehaus.plexus.util.xml.pull.XmlPullParserException; import org.eclipse.tycho.MavenArtifactRepositoryReference; +import org.eclipse.tycho.core.DependencyResolutionException; +import org.eclipse.tycho.core.MavenDependenciesResolver; +import org.eclipse.tycho.core.MavenModelFacade; import org.eclipse.tycho.core.maven.MavenArtifactFacade; -import org.eclipse.tycho.core.shared.DependencyResolutionException; -import org.eclipse.tycho.core.shared.MavenDependenciesResolver; -import org.eclipse.tycho.core.shared.MavenModelFacade; @Component(role = MavenDependenciesResolver.class) public class MavenDependenciesResolverConfigurer implements MavenDependenciesResolver { diff --git a/tycho-core/src/main/java/org/eclipse/tycho/osgi/framework/EclipseApplicationFactory.java b/tycho-core/src/main/java/org/eclipse/tycho/osgi/framework/EclipseApplicationFactory.java index f2e916934d..f5c97f535f 100644 --- a/tycho-core/src/main/java/org/eclipse/tycho/osgi/framework/EclipseApplicationFactory.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/osgi/framework/EclipseApplicationFactory.java @@ -24,11 +24,11 @@ import org.codehaus.plexus.component.annotations.Component; import org.codehaus.plexus.component.annotations.Requirement; import org.codehaus.plexus.logging.Logger; +import org.eclipse.tycho.ExecutionEnvironmentConfiguration; import org.eclipse.tycho.MavenRepositoryLocation; import org.eclipse.tycho.TargetEnvironment; import org.eclipse.tycho.TargetPlatform; import org.eclipse.tycho.core.ee.ExecutionEnvironmentConfigurationImpl; -import org.eclipse.tycho.core.ee.shared.ExecutionEnvironmentConfiguration; import org.eclipse.tycho.core.resolver.P2Resolver; import org.eclipse.tycho.core.resolver.P2ResolverFactory; import org.eclipse.tycho.core.resolver.shared.IncludeSourceMode; diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/metadata/ArtifactFacadeProxy.java b/tycho-core/src/main/java/org/eclipse/tycho/p2/metadata/ArtifactFacadeProxy.java similarity index 100% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/metadata/ArtifactFacadeProxy.java rename to tycho-core/src/main/java/org/eclipse/tycho/p2/metadata/ArtifactFacadeProxy.java diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/metadata/DependencyMetadataGenerator.java b/tycho-core/src/main/java/org/eclipse/tycho/p2/metadata/DependencyMetadataGenerator.java similarity index 100% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/metadata/DependencyMetadataGenerator.java rename to tycho-core/src/main/java/org/eclipse/tycho/p2/metadata/DependencyMetadataGenerator.java diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/metadata/IP2Artifact.java b/tycho-core/src/main/java/org/eclipse/tycho/p2/metadata/IP2Artifact.java similarity index 100% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/metadata/IP2Artifact.java rename to tycho-core/src/main/java/org/eclipse/tycho/p2/metadata/IP2Artifact.java diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/metadata/P2Generator.java b/tycho-core/src/main/java/org/eclipse/tycho/p2/metadata/P2Generator.java similarity index 100% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/metadata/P2Generator.java rename to tycho-core/src/main/java/org/eclipse/tycho/p2/metadata/P2Generator.java diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/metadata/PublisherOptions.java b/tycho-core/src/main/java/org/eclipse/tycho/p2/metadata/PublisherOptions.java similarity index 100% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/metadata/PublisherOptions.java rename to tycho-core/src/main/java/org/eclipse/tycho/p2/metadata/PublisherOptions.java diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/metadata/ReactorProjectFacade.java b/tycho-core/src/main/java/org/eclipse/tycho/p2/metadata/ReactorProjectFacade.java similarity index 100% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/metadata/ReactorProjectFacade.java rename to tycho-core/src/main/java/org/eclipse/tycho/p2/metadata/ReactorProjectFacade.java diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/publisher/AbstractDependenciesAction.java b/tycho-core/src/main/java/org/eclipse/tycho/p2/publisher/AbstractDependenciesAction.java similarity index 100% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/publisher/AbstractDependenciesAction.java rename to tycho-core/src/main/java/org/eclipse/tycho/p2/publisher/AbstractDependenciesAction.java diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/publisher/AbstractMetadataGenerator.java b/tycho-core/src/main/java/org/eclipse/tycho/p2/publisher/AbstractMetadataGenerator.java similarity index 99% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/publisher/AbstractMetadataGenerator.java rename to tycho-core/src/main/java/org/eclipse/tycho/p2/publisher/AbstractMetadataGenerator.java index 39174b478d..c8c7dc7795 100644 --- a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/publisher/AbstractMetadataGenerator.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/p2/publisher/AbstractMetadataGenerator.java @@ -38,11 +38,11 @@ import org.eclipse.tycho.BuildPropertiesParser; import org.eclipse.tycho.IArtifactFacade; import org.eclipse.tycho.IDependencyMetadata.DependencyMetadataType; +import org.eclipse.tycho.core.shared.StatusTool; import org.eclipse.tycho.OptionalResolutionAction; import org.eclipse.tycho.TargetEnvironment; import org.eclipse.tycho.TychoConstants; import org.eclipse.tycho.p2.metadata.PublisherOptions; -import org.eclipse.tycho.repository.util.StatusTool; public abstract class AbstractMetadataGenerator { diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/publisher/AbstractSiteDependenciesAction.java b/tycho-core/src/main/java/org/eclipse/tycho/p2/publisher/AbstractSiteDependenciesAction.java similarity index 100% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/publisher/AbstractSiteDependenciesAction.java rename to tycho-core/src/main/java/org/eclipse/tycho/p2/publisher/AbstractSiteDependenciesAction.java diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/publisher/AuthoredIUAction.java b/tycho-core/src/main/java/org/eclipse/tycho/p2/publisher/AuthoredIUAction.java similarity index 100% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/publisher/AuthoredIUAction.java rename to tycho-core/src/main/java/org/eclipse/tycho/p2/publisher/AuthoredIUAction.java diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/publisher/BundleDependenciesAction.java b/tycho-core/src/main/java/org/eclipse/tycho/p2/publisher/BundleDependenciesAction.java similarity index 100% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/publisher/BundleDependenciesAction.java rename to tycho-core/src/main/java/org/eclipse/tycho/p2/publisher/BundleDependenciesAction.java diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/publisher/CategoryDependenciesAction.java b/tycho-core/src/main/java/org/eclipse/tycho/p2/publisher/CategoryDependenciesAction.java similarity index 100% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/publisher/CategoryDependenciesAction.java rename to tycho-core/src/main/java/org/eclipse/tycho/p2/publisher/CategoryDependenciesAction.java diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/publisher/DependencyMetadata.java b/tycho-core/src/main/java/org/eclipse/tycho/p2/publisher/DependencyMetadata.java similarity index 100% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/publisher/DependencyMetadata.java rename to tycho-core/src/main/java/org/eclipse/tycho/p2/publisher/DependencyMetadata.java diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/publisher/DownloadStatsAdvice.java b/tycho-core/src/main/java/org/eclipse/tycho/p2/publisher/DownloadStatsAdvice.java similarity index 100% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/publisher/DownloadStatsAdvice.java rename to tycho-core/src/main/java/org/eclipse/tycho/p2/publisher/DownloadStatsAdvice.java diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/publisher/FeatureDependenciesAction.java b/tycho-core/src/main/java/org/eclipse/tycho/p2/publisher/FeatureDependenciesAction.java similarity index 100% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/publisher/FeatureDependenciesAction.java rename to tycho-core/src/main/java/org/eclipse/tycho/p2/publisher/FeatureDependenciesAction.java diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/publisher/P2Artifact.java b/tycho-core/src/main/java/org/eclipse/tycho/p2/publisher/P2Artifact.java similarity index 100% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/publisher/P2Artifact.java rename to tycho-core/src/main/java/org/eclipse/tycho/p2/publisher/P2Artifact.java diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/publisher/ProductDependenciesAction.java b/tycho-core/src/main/java/org/eclipse/tycho/p2/publisher/ProductDependenciesAction.java similarity index 100% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/publisher/ProductDependenciesAction.java rename to tycho-core/src/main/java/org/eclipse/tycho/p2/publisher/ProductDependenciesAction.java diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/publisher/ProductFile2.java b/tycho-core/src/main/java/org/eclipse/tycho/p2/publisher/ProductFile2.java similarity index 100% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/publisher/ProductFile2.java rename to tycho-core/src/main/java/org/eclipse/tycho/p2/publisher/ProductFile2.java diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/publisher/TransientArtifactRepository.java b/tycho-core/src/main/java/org/eclipse/tycho/p2/publisher/TransientArtifactRepository.java similarity index 100% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/publisher/TransientArtifactRepository.java rename to tycho-core/src/main/java/org/eclipse/tycho/p2/publisher/TransientArtifactRepository.java diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/publisher/rootfiles/AbstractFileSet.java b/tycho-core/src/main/java/org/eclipse/tycho/p2/publisher/rootfiles/AbstractFileSet.java similarity index 100% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/publisher/rootfiles/AbstractFileSet.java rename to tycho-core/src/main/java/org/eclipse/tycho/p2/publisher/rootfiles/AbstractFileSet.java diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/publisher/rootfiles/ConfigSpec.java b/tycho-core/src/main/java/org/eclipse/tycho/p2/publisher/rootfiles/ConfigSpec.java similarity index 100% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/publisher/rootfiles/ConfigSpec.java rename to tycho-core/src/main/java/org/eclipse/tycho/p2/publisher/rootfiles/ConfigSpec.java diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/publisher/rootfiles/FeatureRootAdvice.java b/tycho-core/src/main/java/org/eclipse/tycho/p2/publisher/rootfiles/FeatureRootAdvice.java similarity index 100% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/publisher/rootfiles/FeatureRootAdvice.java rename to tycho-core/src/main/java/org/eclipse/tycho/p2/publisher/rootfiles/FeatureRootAdvice.java diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/publisher/rootfiles/FileSet.java b/tycho-core/src/main/java/org/eclipse/tycho/p2/publisher/rootfiles/FileSet.java similarity index 100% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/publisher/rootfiles/FileSet.java rename to tycho-core/src/main/java/org/eclipse/tycho/p2/publisher/rootfiles/FileSet.java diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/publisher/rootfiles/FileToPathMap.java b/tycho-core/src/main/java/org/eclipse/tycho/p2/publisher/rootfiles/FileToPathMap.java similarity index 100% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/publisher/rootfiles/FileToPathMap.java rename to tycho-core/src/main/java/org/eclipse/tycho/p2/publisher/rootfiles/FileToPathMap.java diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/publisher/rootfiles/RootFilePath.java b/tycho-core/src/main/java/org/eclipse/tycho/p2/publisher/rootfiles/RootFilePath.java similarity index 100% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/publisher/rootfiles/RootFilePath.java rename to tycho-core/src/main/java/org/eclipse/tycho/p2/publisher/rootfiles/RootFilePath.java diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/publisher/rootfiles/RootFilePatternParser.java b/tycho-core/src/main/java/org/eclipse/tycho/p2/publisher/rootfiles/RootFilePatternParser.java similarity index 100% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/publisher/rootfiles/RootFilePatternParser.java rename to tycho-core/src/main/java/org/eclipse/tycho/p2/publisher/rootfiles/RootFilePatternParser.java diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/publisher/rootfiles/RootFilesProperties.java b/tycho-core/src/main/java/org/eclipse/tycho/p2/publisher/rootfiles/RootFilesProperties.java similarity index 100% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/publisher/rootfiles/RootFilesProperties.java rename to tycho-core/src/main/java/org/eclipse/tycho/p2/publisher/rootfiles/RootFilesProperties.java diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/publisher/rootfiles/RootPropertiesParser.java b/tycho-core/src/main/java/org/eclipse/tycho/p2/publisher/rootfiles/RootPropertiesParser.java similarity index 100% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/publisher/rootfiles/RootPropertiesParser.java rename to tycho-core/src/main/java/org/eclipse/tycho/p2/publisher/rootfiles/RootPropertiesParser.java diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/publisher/rootfiles/SegmentHelper.java b/tycho-core/src/main/java/org/eclipse/tycho/p2/publisher/rootfiles/SegmentHelper.java similarity index 100% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/publisher/rootfiles/SegmentHelper.java rename to tycho-core/src/main/java/org/eclipse/tycho/p2/publisher/rootfiles/SegmentHelper.java diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/publisher/rootfiles/VirtualFileSet.java b/tycho-core/src/main/java/org/eclipse/tycho/p2/publisher/rootfiles/VirtualFileSet.java similarity index 100% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/publisher/rootfiles/VirtualFileSet.java rename to tycho-core/src/main/java/org/eclipse/tycho/p2/publisher/rootfiles/VirtualFileSet.java diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/resolver/BundlePublisher.java b/tycho-core/src/main/java/org/eclipse/tycho/p2/resolver/BundlePublisher.java similarity index 100% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/resolver/BundlePublisher.java rename to tycho-core/src/main/java/org/eclipse/tycho/p2/resolver/BundlePublisher.java diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/resolver/ClassifiedArtifactKey.java b/tycho-core/src/main/java/org/eclipse/tycho/p2/resolver/ClassifiedArtifactKey.java similarity index 100% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/resolver/ClassifiedArtifactKey.java rename to tycho-core/src/main/java/org/eclipse/tycho/p2/resolver/ClassifiedArtifactKey.java diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/resolver/ClassifiedLocation.java b/tycho-core/src/main/java/org/eclipse/tycho/p2/resolver/ClassifiedLocation.java similarity index 100% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/resolver/ClassifiedLocation.java rename to tycho-core/src/main/java/org/eclipse/tycho/p2/resolver/ClassifiedLocation.java diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/resolver/FeatureGenerator.java b/tycho-core/src/main/java/org/eclipse/tycho/p2/resolver/FeatureGenerator.java similarity index 98% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/resolver/FeatureGenerator.java rename to tycho-core/src/main/java/org/eclipse/tycho/p2/resolver/FeatureGenerator.java index e1cfd49550..4e14fc0695 100644 --- a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/resolver/FeatureGenerator.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/p2/resolver/FeatureGenerator.java @@ -47,9 +47,9 @@ import org.eclipse.equinox.p2.metadata.VersionedId; import org.eclipse.equinox.p2.publisher.eclipse.BundlesAction; import org.eclipse.equinox.p2.publisher.eclipse.Feature; +import org.eclipse.tycho.core.MavenModelFacade; +import org.eclipse.tycho.core.MavenModelFacade.MavenLicense; import org.eclipse.tycho.core.shared.MavenLogger; -import org.eclipse.tycho.core.shared.MavenModelFacade; -import org.eclipse.tycho.core.shared.MavenModelFacade.MavenLicense; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.xml.sax.SAXException; diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/resolver/FeaturePublisher.java b/tycho-core/src/main/java/org/eclipse/tycho/p2/resolver/FeaturePublisher.java similarity index 100% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/resolver/FeaturePublisher.java rename to tycho-core/src/main/java/org/eclipse/tycho/p2/resolver/FeaturePublisher.java diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/resolver/FileTargetDefinitionContent.java b/tycho-core/src/main/java/org/eclipse/tycho/p2/resolver/FileTargetDefinitionContent.java similarity index 99% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/resolver/FileTargetDefinitionContent.java rename to tycho-core/src/main/java/org/eclipse/tycho/p2/resolver/FileTargetDefinitionContent.java index e889a8a2fc..0a4c95d916 100644 --- a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/resolver/FileTargetDefinitionContent.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/p2/resolver/FileTargetDefinitionContent.java @@ -37,7 +37,7 @@ import org.eclipse.osgi.service.resolver.BundleDescription; import org.eclipse.tycho.core.resolver.target.FileArtifactRepository; import org.eclipse.tycho.core.resolver.target.SupplierMetadataRepository; -import org.eclipse.tycho.core.resolver.target.TargetDefinitionContent; +import org.eclipse.tycho.targetplatform.TargetDefinitionContent; import org.eclipse.tycho.targetplatform.TargetDefinitionResolutionException; import org.osgi.framework.BundleException; diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/resolver/ResolverException.java b/tycho-core/src/main/java/org/eclipse/tycho/p2/resolver/ResolverException.java similarity index 97% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/resolver/ResolverException.java rename to tycho-core/src/main/java/org/eclipse/tycho/p2/resolver/ResolverException.java index bfa3c82c96..195d42d137 100644 --- a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/resolver/ResolverException.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/p2/resolver/ResolverException.java @@ -14,7 +14,7 @@ package org.eclipse.tycho.p2.resolver; import org.eclipse.core.runtime.IStatus; -import org.eclipse.tycho.repository.util.StatusTool; +import org.eclipse.tycho.core.shared.StatusTool; /** * Exception thrown by Tycho's p2 resolution implementations. It is a checked exception to encourage diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/resolver/URITargetDefinitionContent.java b/tycho-core/src/main/java/org/eclipse/tycho/p2/resolver/URITargetDefinitionContent.java similarity index 98% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/resolver/URITargetDefinitionContent.java rename to tycho-core/src/main/java/org/eclipse/tycho/p2/resolver/URITargetDefinitionContent.java index 69382e3be8..9e37d989e5 100644 --- a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/resolver/URITargetDefinitionContent.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/p2/resolver/URITargetDefinitionContent.java @@ -25,9 +25,9 @@ import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository; import org.eclipse.equinox.p2.repository.metadata.IMetadataRepositoryManager; import org.eclipse.tycho.IRepositoryIdManager; -import org.eclipse.tycho.core.resolver.target.TargetDefinitionContent; import org.eclipse.tycho.p2.repository.LazyArtifactRepository; import org.eclipse.tycho.p2.repository.RepositoryArtifactProvider; +import org.eclipse.tycho.targetplatform.TargetDefinitionContent; import org.eclipse.tycho.targetplatform.TargetDefinitionResolutionException; public class URITargetDefinitionContent implements TargetDefinitionContent { diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/resolver/WrappedArtifact.java b/tycho-core/src/main/java/org/eclipse/tycho/p2/resolver/WrappedArtifact.java similarity index 100% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/resolver/WrappedArtifact.java rename to tycho-core/src/main/java/org/eclipse/tycho/p2/resolver/WrappedArtifact.java diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/target/facade/PomDependencyCollector.java b/tycho-core/src/main/java/org/eclipse/tycho/p2/target/facade/PomDependencyCollector.java similarity index 100% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/target/facade/PomDependencyCollector.java rename to tycho-core/src/main/java/org/eclipse/tycho/p2/target/facade/PomDependencyCollector.java diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/target/facade/TargetPlatformConfigurationStub.java b/tycho-core/src/main/java/org/eclipse/tycho/p2/target/facade/TargetPlatformConfigurationStub.java similarity index 98% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/target/facade/TargetPlatformConfigurationStub.java rename to tycho-core/src/main/java/org/eclipse/tycho/p2/target/facade/TargetPlatformConfigurationStub.java index b424279281..69ab0a5658 100644 --- a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/target/facade/TargetPlatformConfigurationStub.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/p2/target/facade/TargetPlatformConfigurationStub.java @@ -21,9 +21,9 @@ import org.eclipse.tycho.MavenRepositoryLocation; import org.eclipse.tycho.TargetEnvironment; -import org.eclipse.tycho.artifacts.TargetPlatformFilter; import org.eclipse.tycho.core.resolver.shared.IncludeSourceMode; import org.eclipse.tycho.targetplatform.TargetDefinition; +import org.eclipse.tycho.targetplatform.TargetPlatformFilter; // TODO 412416 add an TargetPlatformConfiguration interface with only getters, and add implementation backed by the POM configuration public class TargetPlatformConfigurationStub { diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/target/facade/TargetPlatformFactory.java b/tycho-core/src/main/java/org/eclipse/tycho/p2/target/facade/TargetPlatformFactory.java similarity index 94% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/target/facade/TargetPlatformFactory.java rename to tycho-core/src/main/java/org/eclipse/tycho/p2/target/facade/TargetPlatformFactory.java index 6e69ebce99..20a46a7333 100644 --- a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/target/facade/TargetPlatformFactory.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/p2/target/facade/TargetPlatformFactory.java @@ -15,9 +15,9 @@ import java.util.List; +import org.eclipse.tycho.ExecutionEnvironmentConfiguration; import org.eclipse.tycho.ReactorProject; import org.eclipse.tycho.TargetPlatform; -import org.eclipse.tycho.core.ee.shared.ExecutionEnvironmentConfiguration; // TODO 412416 javadoc public interface TargetPlatformFactory { diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/tools/BuildContext.java b/tycho-core/src/main/java/org/eclipse/tycho/p2/tools/BuildContext.java similarity index 100% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/tools/BuildContext.java rename to tycho-core/src/main/java/org/eclipse/tycho/p2/tools/BuildContext.java diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/tools/DestinationRepositoryDescriptor.java b/tycho-core/src/main/java/org/eclipse/tycho/p2/tools/DestinationRepositoryDescriptor.java similarity index 100% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/tools/DestinationRepositoryDescriptor.java rename to tycho-core/src/main/java/org/eclipse/tycho/p2/tools/DestinationRepositoryDescriptor.java diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/tools/FacadeException.java b/tycho-core/src/main/java/org/eclipse/tycho/p2/tools/FacadeException.java similarity index 100% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/tools/FacadeException.java rename to tycho-core/src/main/java/org/eclipse/tycho/p2/tools/FacadeException.java diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/tools/RepositoryReference.java b/tycho-core/src/main/java/org/eclipse/tycho/p2/tools/RepositoryReference.java similarity index 100% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/tools/RepositoryReference.java rename to tycho-core/src/main/java/org/eclipse/tycho/p2/tools/RepositoryReference.java diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/tools/RepositoryReferences.java b/tycho-core/src/main/java/org/eclipse/tycho/p2/tools/RepositoryReferences.java similarity index 97% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/tools/RepositoryReferences.java rename to tycho-core/src/main/java/org/eclipse/tycho/p2/tools/RepositoryReferences.java index 4941811b53..fd5238179e 100644 --- a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/tools/RepositoryReferences.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/p2/tools/RepositoryReferences.java @@ -19,7 +19,7 @@ import java.util.List; import org.eclipse.tycho.TargetPlatform; -import org.eclipse.tycho.repository.registry.facade.RepositoryBlackboardKey; +import org.eclipse.tycho.p2.repository.RepositoryBlackboardKey; /** * List of p2 repositories for a p2 operation. Instances of this class store a list of metadata and diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/tools/director/shared/AbstractDirectorApplicationCommand.java b/tycho-core/src/main/java/org/eclipse/tycho/p2/tools/director/shared/AbstractDirectorApplicationCommand.java similarity index 100% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/tools/director/shared/AbstractDirectorApplicationCommand.java rename to tycho-core/src/main/java/org/eclipse/tycho/p2/tools/director/shared/AbstractDirectorApplicationCommand.java diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/tools/director/shared/DirectorCommandException.java b/tycho-core/src/main/java/org/eclipse/tycho/p2/tools/director/shared/DirectorCommandException.java similarity index 100% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/tools/director/shared/DirectorCommandException.java rename to tycho-core/src/main/java/org/eclipse/tycho/p2/tools/director/shared/DirectorCommandException.java diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/tools/director/shared/DirectorRuntime.java b/tycho-core/src/main/java/org/eclipse/tycho/p2/tools/director/shared/DirectorRuntime.java similarity index 100% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/tools/director/shared/DirectorRuntime.java rename to tycho-core/src/main/java/org/eclipse/tycho/p2/tools/director/shared/DirectorRuntime.java diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/tools/mirroring/facade/IUDescription.java b/tycho-core/src/main/java/org/eclipse/tycho/p2/tools/mirroring/facade/IUDescription.java similarity index 100% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/tools/mirroring/facade/IUDescription.java rename to tycho-core/src/main/java/org/eclipse/tycho/p2/tools/mirroring/facade/IUDescription.java diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/tools/mirroring/facade/MirrorApplicationService.java b/tycho-core/src/main/java/org/eclipse/tycho/p2/tools/mirroring/facade/MirrorApplicationService.java similarity index 100% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/tools/mirroring/facade/MirrorApplicationService.java rename to tycho-core/src/main/java/org/eclipse/tycho/p2/tools/mirroring/facade/MirrorApplicationService.java diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/tools/mirroring/facade/MirrorOptions.java b/tycho-core/src/main/java/org/eclipse/tycho/p2/tools/mirroring/facade/MirrorOptions.java similarity index 100% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/tools/mirroring/facade/MirrorOptions.java rename to tycho-core/src/main/java/org/eclipse/tycho/p2/tools/mirroring/facade/MirrorOptions.java diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/tools/publisher/DependencySeedUtil.java b/tycho-core/src/main/java/org/eclipse/tycho/p2/tools/publisher/DependencySeedUtil.java similarity index 100% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/tools/publisher/DependencySeedUtil.java rename to tycho-core/src/main/java/org/eclipse/tycho/p2/tools/publisher/DependencySeedUtil.java diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/tools/publisher/ExecutionEnvironmentAction.java b/tycho-core/src/main/java/org/eclipse/tycho/p2/tools/publisher/ExecutionEnvironmentAction.java similarity index 95% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/tools/publisher/ExecutionEnvironmentAction.java rename to tycho-core/src/main/java/org/eclipse/tycho/p2/tools/publisher/ExecutionEnvironmentAction.java index 886d5daea3..af0e25217b 100644 --- a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/tools/publisher/ExecutionEnvironmentAction.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/p2/tools/publisher/ExecutionEnvironmentAction.java @@ -15,9 +15,9 @@ import org.eclipse.equinox.p2.publisher.IPublisherAction; import org.eclipse.equinox.p2.publisher.IPublisherInfo; import org.eclipse.equinox.p2.publisher.IPublisherResult; +import org.eclipse.tycho.ExecutionEnvironment; import org.eclipse.tycho.ExecutionEnvironmentResolutionHints; import org.eclipse.tycho.core.ee.impl.StandardEEResolutionHints; -import org.eclipse.tycho.core.ee.shared.ExecutionEnvironment; public class ExecutionEnvironmentAction implements IPublisherAction { diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/tools/publisher/ExpandedProduct.java b/tycho-core/src/main/java/org/eclipse/tycho/p2/tools/publisher/ExpandedProduct.java similarity index 98% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/tools/publisher/ExpandedProduct.java rename to tycho-core/src/main/java/org/eclipse/tycho/p2/tools/publisher/ExpandedProduct.java index f6a4863df9..67738ca904 100644 --- a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/tools/publisher/ExpandedProduct.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/p2/tools/publisher/ExpandedProduct.java @@ -30,10 +30,10 @@ import org.eclipse.equinox.p2.repository.IRepositoryReference; import org.eclipse.tycho.ArtifactType; import org.eclipse.tycho.Interpolator; -import org.eclipse.tycho.core.resolver.target.P2TargetPlatform; +import org.eclipse.tycho.core.VersioningHelper; import org.eclipse.tycho.core.shared.MavenLogger; import org.eclipse.tycho.core.shared.MultiLineLogger; -import org.eclipse.tycho.core.shared.VersioningHelper; +import org.eclipse.tycho.targetplatform.P2TargetPlatform; @SuppressWarnings({}) class ExpandedProduct implements IProductDescriptor { diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/tools/publisher/ProductBinariesWriteSession.java b/tycho-core/src/main/java/org/eclipse/tycho/p2/tools/publisher/ProductBinariesWriteSession.java similarity index 96% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/tools/publisher/ProductBinariesWriteSession.java rename to tycho-core/src/main/java/org/eclipse/tycho/p2/tools/publisher/ProductBinariesWriteSession.java index 03ea5fec17..58bd8dad82 100644 --- a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/tools/publisher/ProductBinariesWriteSession.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/p2/tools/publisher/ProductBinariesWriteSession.java @@ -15,7 +15,7 @@ import org.eclipse.core.runtime.AssertionFailedException; import org.eclipse.equinox.p2.metadata.IArtifactKey; import org.eclipse.equinox.spi.p2.publisher.PublisherHelper; -import org.eclipse.tycho.repository.publishing.WriteSessionContext; +import org.eclipse.tycho.WriteSessionContext; /** * {@link WriteSessionContext} for publishing the binary executables artifacts. diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/tools/publisher/ProductVersionExpansionRun.java b/tycho-core/src/main/java/org/eclipse/tycho/p2/tools/publisher/ProductVersionExpansionRun.java similarity index 98% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/tools/publisher/ProductVersionExpansionRun.java rename to tycho-core/src/main/java/org/eclipse/tycho/p2/tools/publisher/ProductVersionExpansionRun.java index 9b06b0c275..9459a386b2 100644 --- a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/tools/publisher/ProductVersionExpansionRun.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/p2/tools/publisher/ProductVersionExpansionRun.java @@ -21,8 +21,8 @@ import org.eclipse.equinox.p2.metadata.VersionedId; import org.eclipse.tycho.DependencyResolutionException; import org.eclipse.tycho.IllegalArtifactReferenceException; -import org.eclipse.tycho.core.resolver.target.P2TargetPlatform; import org.eclipse.tycho.core.shared.MavenLogger; +import org.eclipse.tycho.targetplatform.P2TargetPlatform; class ProductVersionExpansionRun { diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/tools/publisher/PublishProductToolImpl.java b/tycho-core/src/main/java/org/eclipse/tycho/p2/tools/publisher/PublishProductToolImpl.java similarity index 98% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/tools/publisher/PublishProductToolImpl.java rename to tycho-core/src/main/java/org/eclipse/tycho/p2/tools/publisher/PublishProductToolImpl.java index 325da59591..7ae086009b 100644 --- a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/tools/publisher/PublishProductToolImpl.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/p2/tools/publisher/PublishProductToolImpl.java @@ -37,10 +37,10 @@ import org.eclipse.tycho.Interpolator; import org.eclipse.tycho.core.resolver.shared.DependencySeed; import org.eclipse.tycho.core.resolver.target.ArtifactTypeHelper; -import org.eclipse.tycho.core.resolver.target.P2TargetPlatform; import org.eclipse.tycho.core.shared.MavenLogger; +import org.eclipse.tycho.p2.repository.PublishingRepository; import org.eclipse.tycho.p2.tools.publisher.facade.PublishProductTool; -import org.eclipse.tycho.repository.publishing.PublishingRepository; +import org.eclipse.tycho.targetplatform.P2TargetPlatform; /** * Tool for transforming product definition source files into p2 metadata and artifacts. Includes diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/tools/publisher/PublisherActionRunner.java b/tycho-core/src/main/java/org/eclipse/tycho/p2/tools/publisher/PublisherActionRunner.java similarity index 98% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/tools/publisher/PublisherActionRunner.java rename to tycho-core/src/main/java/org/eclipse/tycho/p2/tools/publisher/PublisherActionRunner.java index 68ad8b474a..ed5c02b328 100644 --- a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/tools/publisher/PublisherActionRunner.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/p2/tools/publisher/PublisherActionRunner.java @@ -26,7 +26,7 @@ import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository; import org.eclipse.tycho.TargetEnvironment; import org.eclipse.tycho.core.shared.MavenLogger; -import org.eclipse.tycho.repository.util.StatusTool; +import org.eclipse.tycho.core.shared.StatusTool; /** * Helper for running publisher actions in the context of a project. diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/tools/publisher/PublisherServiceImpl.java b/tycho-core/src/main/java/org/eclipse/tycho/p2/tools/publisher/PublisherServiceImpl.java similarity index 98% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/tools/publisher/PublisherServiceImpl.java rename to tycho-core/src/main/java/org/eclipse/tycho/p2/tools/publisher/PublisherServiceImpl.java index aa1540b9ac..6c89091243 100644 --- a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/tools/publisher/PublisherServiceImpl.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/p2/tools/publisher/PublisherServiceImpl.java @@ -24,12 +24,12 @@ import org.eclipse.equinox.p2.metadata.IInstallableUnit; import org.eclipse.equinox.p2.publisher.IPublisherAction; import org.eclipse.equinox.p2.publisher.actions.JREAction; +import org.eclipse.tycho.ExecutionEnvironment; import org.eclipse.tycho.core.ee.impl.CustomEEResolutionHints; -import org.eclipse.tycho.core.ee.shared.ExecutionEnvironment; import org.eclipse.tycho.core.resolver.shared.DependencySeed; +import org.eclipse.tycho.p2.repository.PublishingRepository; import org.eclipse.tycho.p2.tools.FacadeException; import org.eclipse.tycho.p2.tools.publisher.facade.PublisherService; -import org.eclipse.tycho.repository.publishing.PublishingRepository; public class PublisherServiceImpl implements PublisherService { diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/tools/publisher/ResultSpyAction.java b/tycho-core/src/main/java/org/eclipse/tycho/p2/tools/publisher/ResultSpyAction.java similarity index 100% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/tools/publisher/ResultSpyAction.java rename to tycho-core/src/main/java/org/eclipse/tycho/p2/tools/publisher/ResultSpyAction.java diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/tools/publisher/facade/PublishProductTool.java b/tycho-core/src/main/java/org/eclipse/tycho/p2/tools/publisher/facade/PublishProductTool.java similarity index 100% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/tools/publisher/facade/PublishProductTool.java rename to tycho-core/src/main/java/org/eclipse/tycho/p2/tools/publisher/facade/PublishProductTool.java diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/tools/publisher/facade/PublisherService.java b/tycho-core/src/main/java/org/eclipse/tycho/p2/tools/publisher/facade/PublisherService.java similarity index 97% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/tools/publisher/facade/PublisherService.java rename to tycho-core/src/main/java/org/eclipse/tycho/p2/tools/publisher/facade/PublisherService.java index 9e3dfd562e..b62278fa3e 100644 --- a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/tools/publisher/facade/PublisherService.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/p2/tools/publisher/facade/PublisherService.java @@ -15,7 +15,7 @@ import java.io.File; import java.util.Collection; -import org.eclipse.tycho.core.ee.shared.ExecutionEnvironment; +import org.eclipse.tycho.ExecutionEnvironment; import org.eclipse.tycho.core.resolver.shared.DependencySeed; import org.eclipse.tycho.p2.tools.FacadeException; diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/tools/publisher/facade/PublisherServiceFactory.java b/tycho-core/src/main/java/org/eclipse/tycho/p2/tools/publisher/facade/PublisherServiceFactory.java similarity index 100% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/p2/tools/publisher/facade/PublisherServiceFactory.java rename to tycho-core/src/main/java/org/eclipse/tycho/p2/tools/publisher/facade/PublisherServiceFactory.java diff --git a/tycho-core/src/main/java/org/eclipse/tycho/p2resolver/AbstractSlicerResolutionStrategy.java b/tycho-core/src/main/java/org/eclipse/tycho/p2resolver/AbstractSlicerResolutionStrategy.java index df22e96617..25631f6cbf 100644 --- a/tycho-core/src/main/java/org/eclipse/tycho/p2resolver/AbstractSlicerResolutionStrategy.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/p2resolver/AbstractSlicerResolutionStrategy.java @@ -46,9 +46,9 @@ import org.eclipse.equinox.p2.query.IQueryResult; import org.eclipse.equinox.p2.query.IQueryable; import org.eclipse.tycho.core.shared.MavenLogger; +import org.eclipse.tycho.core.shared.StatusTool; import org.eclipse.tycho.p2.repository.QueryableCollection; import org.eclipse.tycho.p2.resolver.ResolverException; -import org.eclipse.tycho.repository.util.StatusTool; abstract class AbstractSlicerResolutionStrategy extends AbstractResolutionStrategy { diff --git a/tycho-core/src/main/java/org/eclipse/tycho/p2resolver/DefaultTargetDefinitionVariableResolver.java b/tycho-core/src/main/java/org/eclipse/tycho/p2resolver/DefaultTargetDefinitionVariableResolver.java new file mode 100644 index 0000000000..7e2c480071 --- /dev/null +++ b/tycho-core/src/main/java/org/eclipse/tycho/p2resolver/DefaultTargetDefinitionVariableResolver.java @@ -0,0 +1,112 @@ +/******************************************************************************* + * Copyright (c) 2023 Vaclav Hala and others. + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * Contributors: + * Vaclav Hala - extraction code from TargetDefinitionResolver into dedicated component + * + *******************************************************************************/ +package org.eclipse.tycho.p2resolver; + +import java.util.function.Function; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import org.codehaus.plexus.component.annotations.Component; +import org.codehaus.plexus.component.annotations.Requirement; +import org.codehaus.plexus.logging.Logger; +import org.eclipse.tycho.ReactorProject; +import org.eclipse.tycho.core.shared.MavenContext; + +@Component(role = TargetDefinitionVariableResolver.class) +public class DefaultTargetDefinitionVariableResolver implements TargetDefinitionVariableResolver { + + private static final Pattern SYSTEM_PROPERTY_PATTERN = createVariablePatternArgument("system_property"); + private static final Pattern PROJECT_LOC_PATTERN = createVariablePatternArgument("project_loc"); + private static final Pattern ENV_VAR_PATTERN = createVariablePatternArgument("env_var"); + + @Requirement + private MavenContext mavenContext; + @Requirement + private Logger logger; + + public DefaultTargetDefinitionVariableResolver() { + } + + /** for tests */ + public DefaultTargetDefinitionVariableResolver(MavenContext mavenContext, Logger logger) { + this.mavenContext = mavenContext; + this.logger = logger; + } + + @Override + public String resolve(String raw) { + raw = resolvePattern(raw, SYSTEM_PROPERTY_PATTERN, key -> property(key, "")); + raw = resolvePattern(raw, ENV_VAR_PATTERN, key -> { + String env = System.getenv(key); + return env == null ? "" : env; + }); + raw = resolvePattern(raw, PROJECT_LOC_PATTERN, this::findProjectLocation); + return raw; + } + + private String findProjectLocation(String projectName) { + if (projectName.startsWith("/")) { + projectName = projectName.substring(1); + } + logger.debug("Find project location for project " + projectName); + for (ReactorProject project : projects()) { + String name = project.getName(); + logger.debug("check reactor project name: " + name); + if (name.equals(projectName)) { + return project.getBasedir().getAbsolutePath(); + } + } + for (ReactorProject project : projects()) { + String artifactId = project.getArtifactId(); + logger.debug("check reactor project artifact id: " + artifactId); + if (artifactId.equals(projectName)) { + return project.getBasedir().getAbsolutePath(); + } + } + for (ReactorProject project : projects()) { + String name = project.getBasedir().getName(); + logger.debug("check reactor project base directory: " + name); + if (name.equals(projectName)) { + return project.getBasedir().getAbsolutePath(); + } + } + //if we can't resolve this, we will return the original one as this might be intentional to not include the project in the build + String defaultValue = "${project_loc:" + projectName + "}"; + logger.warn("Cannot resolve " + defaultValue + " target resolution might be incomplete"); + return defaultValue; + } + + private String property(String key, String defaultValue) { + return mavenContext.getSessionProperties().getProperty(key, defaultValue); + } + + private Iterable projects() { + return mavenContext.getProjects(); + } + + private static String resolvePattern(String input, Pattern pattern, Function parameterResolver) { + Matcher matcher = pattern.matcher(input); + StringBuffer sb = new StringBuffer(); + while (matcher.find()) { + String group = matcher.group(1); + String resolved = parameterResolver.apply(group); + matcher.appendReplacement(sb, Matcher.quoteReplacement(resolved)); + } + matcher.appendTail(sb); + return sb.toString(); + } + + private static Pattern createVariablePatternArgument(String variableName) { + return Pattern.compile("\\$\\{" + variableName + ":([^}]+)\\}", Pattern.CASE_INSENSITIVE); + } +} diff --git a/tycho-core/src/main/java/org/eclipse/tycho/p2resolver/FinalTargetPlatformImpl.java b/tycho-core/src/main/java/org/eclipse/tycho/p2resolver/FinalTargetPlatformImpl.java index 49d0efe6b8..fd15069b48 100644 --- a/tycho-core/src/main/java/org/eclipse/tycho/p2resolver/FinalTargetPlatformImpl.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/p2resolver/FinalTargetPlatformImpl.java @@ -22,8 +22,8 @@ import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository; import org.eclipse.tycho.ExecutionEnvironmentResolutionHints; import org.eclipse.tycho.IArtifactFacade; +import org.eclipse.tycho.IRawArtifactFileProvider; import org.eclipse.tycho.ReactorProjectIdentities; -import org.eclipse.tycho.p2.artifact.provider.IRawArtifactFileProvider; import org.eclipse.tycho.p2.repository.ImmutableInMemoryMetadataRepository; import org.eclipse.tycho.p2.repository.LocalArtifactRepository; 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 6dfc2b9055..6194935b5d 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 @@ -39,9 +39,9 @@ import org.eclipse.tycho.ExecutionEnvironmentResolutionHints; import org.eclipse.tycho.TargetEnvironment; import org.eclipse.tycho.core.resolver.shared.IncludeSourceMode; +import org.eclipse.tycho.core.shared.DuplicateFilteringLoggingProgressMonitor; import org.eclipse.tycho.core.shared.MavenLogger; import org.eclipse.tycho.p2.resolver.ResolverException; -import org.eclipse.tycho.repository.util.DuplicateFilteringLoggingProgressMonitor; import org.eclipse.tycho.targetplatform.TargetDefinition.IncludeMode; import org.eclipse.tycho.targetplatform.TargetDefinition.InstallableUnitLocation; import org.eclipse.tycho.targetplatform.TargetDefinition.Unit; diff --git a/tycho-core/src/main/java/org/eclipse/tycho/p2resolver/LocalRepositoryP2IndicesImpl.java b/tycho-core/src/main/java/org/eclipse/tycho/p2resolver/LocalRepositoryP2IndicesImpl.java index 6529afb01f..8c4c9063b1 100644 --- a/tycho-core/src/main/java/org/eclipse/tycho/p2resolver/LocalRepositoryP2IndicesImpl.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/p2resolver/LocalRepositoryP2IndicesImpl.java @@ -18,8 +18,8 @@ import org.codehaus.plexus.component.annotations.Component; import org.codehaus.plexus.component.annotations.Requirement; +import org.eclipse.tycho.FileLockService; import org.eclipse.tycho.core.shared.MavenContext; -import org.eclipse.tycho.locking.facade.FileLockService; import org.eclipse.tycho.p2.repository.FileBasedTychoRepositoryIndex; import org.eclipse.tycho.p2.repository.GAV; import org.eclipse.tycho.p2.repository.LocalRepositoryP2Indices; diff --git a/tycho-core/src/main/java/org/eclipse/tycho/p2resolver/P2DependencyResolver.java b/tycho-core/src/main/java/org/eclipse/tycho/p2resolver/P2DependencyResolver.java index 2ae25d74c3..c0e380fd68 100644 --- a/tycho-core/src/main/java/org/eclipse/tycho/p2resolver/P2DependencyResolver.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/p2resolver/P2DependencyResolver.java @@ -52,6 +52,7 @@ import org.eclipse.tycho.BuildPropertiesParser; import org.eclipse.tycho.DefaultArtifactKey; import org.eclipse.tycho.DependencyArtifacts; +import org.eclipse.tycho.ExecutionEnvironmentConfiguration; import org.eclipse.tycho.IDependencyMetadata; import org.eclipse.tycho.IDependencyMetadata.DependencyMetadataType; import org.eclipse.tycho.IllegalArtifactReferenceException; @@ -66,7 +67,6 @@ import org.eclipse.tycho.core.TargetPlatformConfiguration; import org.eclipse.tycho.core.TargetPlatformConfiguration.LocalArtifactHandling; import org.eclipse.tycho.core.TychoProjectManager; -import org.eclipse.tycho.core.ee.shared.ExecutionEnvironmentConfiguration; import org.eclipse.tycho.core.maven.MavenDependencyInjector; import org.eclipse.tycho.core.osgitools.AbstractTychoProject; import org.eclipse.tycho.core.osgitools.BundleReader; diff --git a/tycho-core/src/main/java/org/eclipse/tycho/p2resolver/P2ResolverImpl.java b/tycho-core/src/main/java/org/eclipse/tycho/p2resolver/P2ResolverImpl.java index 49aaf51f9b..9074167ca2 100644 --- a/tycho-core/src/main/java/org/eclipse/tycho/p2resolver/P2ResolverImpl.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/p2resolver/P2ResolverImpl.java @@ -51,6 +51,7 @@ import org.eclipse.tycho.ArtifactType; import org.eclipse.tycho.DefaultArtifactKey; import org.eclipse.tycho.DependencyResolutionException; +import org.eclipse.tycho.ExecutionEnvironmentConfiguration; import org.eclipse.tycho.IArtifactFacade; import org.eclipse.tycho.IDependencyMetadata.DependencyMetadataType; import org.eclipse.tycho.IllegalArtifactReferenceException; @@ -60,7 +61,6 @@ import org.eclipse.tycho.TargetEnvironment; import org.eclipse.tycho.TargetPlatform; import org.eclipse.tycho.TychoConstants; -import org.eclipse.tycho.core.ee.shared.ExecutionEnvironmentConfiguration; import org.eclipse.tycho.core.ee.shared.ExecutionEnvironmentConfigurationStub; import org.eclipse.tycho.core.resolver.DefaultP2ResolutionResult; import org.eclipse.tycho.core.resolver.MetadataOnlyP2ResolutionResult; @@ -68,14 +68,14 @@ import org.eclipse.tycho.core.resolver.P2Resolver; import org.eclipse.tycho.core.resolver.shared.PomDependencies; import org.eclipse.tycho.core.resolver.target.ArtifactTypeHelper; -import org.eclipse.tycho.core.resolver.target.P2TargetPlatform; +import org.eclipse.tycho.core.shared.LoggingProgressMonitor; import org.eclipse.tycho.core.shared.MavenLogger; import org.eclipse.tycho.core.shared.MultiLineLogger; import org.eclipse.tycho.p2.publisher.AuthoredIUAction; import org.eclipse.tycho.p2.repository.QueryableCollection; import org.eclipse.tycho.p2.resolver.ResolverException; import org.eclipse.tycho.p2.target.facade.TargetPlatformConfigurationStub; -import org.eclipse.tycho.repository.util.LoggingProgressMonitor; +import org.eclipse.tycho.targetplatform.P2TargetPlatform; public class P2ResolverImpl implements P2Resolver { diff --git a/tycho-core/src/main/java/org/eclipse/tycho/p2resolver/PomDependencyCollectorImpl.java b/tycho-core/src/main/java/org/eclipse/tycho/p2resolver/PomDependencyCollectorImpl.java index f32dbb6e12..d77a7e6b63 100644 --- a/tycho-core/src/main/java/org/eclipse/tycho/p2resolver/PomDependencyCollectorImpl.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/p2resolver/PomDependencyCollectorImpl.java @@ -39,11 +39,11 @@ import org.eclipse.tycho.ArtifactType; import org.eclipse.tycho.DefaultArtifactKey; import org.eclipse.tycho.IArtifactFacade; +import org.eclipse.tycho.IRawArtifactFileProvider; import org.eclipse.tycho.ReactorProject; import org.eclipse.tycho.TychoConstants; import org.eclipse.tycho.core.resolver.target.ArtifactTypeHelper; import org.eclipse.tycho.core.resolver.target.FileArtifactRepository; -import org.eclipse.tycho.p2.artifact.provider.IRawArtifactFileProvider; import org.eclipse.tycho.p2.repository.ArtifactTransferPolicies; import org.eclipse.tycho.p2.repository.FileRepositoryArtifactProvider; import org.eclipse.tycho.p2.repository.GAV; diff --git a/tycho-core/src/main/java/org/eclipse/tycho/p2resolver/PreliminaryTargetPlatformImpl.java b/tycho-core/src/main/java/org/eclipse/tycho/p2resolver/PreliminaryTargetPlatformImpl.java index 813bd009a6..9a1a94a2e9 100644 --- a/tycho-core/src/main/java/org/eclipse/tycho/p2resolver/PreliminaryTargetPlatformImpl.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/p2resolver/PreliminaryTargetPlatformImpl.java @@ -26,10 +26,10 @@ import org.eclipse.equinox.p2.repository.artifact.IArtifactRepository; import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository; import org.eclipse.tycho.ExecutionEnvironmentResolutionHints; +import org.eclipse.tycho.IRawArtifactFileProvider; import org.eclipse.tycho.ReactorProjectIdentities; import org.eclipse.tycho.core.resolver.target.TargetPlatformFilterEvaluator; import org.eclipse.tycho.core.shared.MavenLogger; -import org.eclipse.tycho.p2.artifact.provider.IRawArtifactFileProvider; import org.eclipse.tycho.p2.repository.LocalArtifactRepository; import org.eclipse.tycho.p2.repository.LocalMetadataRepository; diff --git a/tycho-core/src/main/java/org/eclipse/tycho/p2resolver/ProjectorResolutionStrategy.java b/tycho-core/src/main/java/org/eclipse/tycho/p2resolver/ProjectorResolutionStrategy.java index dd3b271fc9..c63125a946 100644 --- a/tycho-core/src/main/java/org/eclipse/tycho/p2resolver/ProjectorResolutionStrategy.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/p2resolver/ProjectorResolutionStrategy.java @@ -36,8 +36,8 @@ import org.eclipse.equinox.p2.metadata.IRequirement; import org.eclipse.equinox.p2.query.IQueryable; import org.eclipse.tycho.core.shared.MavenLogger; +import org.eclipse.tycho.core.shared.StatusTool; import org.eclipse.tycho.p2.resolver.ResolverException; -import org.eclipse.tycho.repository.util.StatusTool; public class ProjectorResolutionStrategy extends AbstractSlicerResolutionStrategy { diff --git a/tycho-core/src/main/java/org/eclipse/tycho/p2resolver/PublisherServiceFactoryImpl.java b/tycho-core/src/main/java/org/eclipse/tycho/p2resolver/PublisherServiceFactoryImpl.java index 42ebaf73b2..639411c019 100644 --- a/tycho-core/src/main/java/org/eclipse/tycho/p2resolver/PublisherServiceFactoryImpl.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/p2resolver/PublisherServiceFactoryImpl.java @@ -19,16 +19,16 @@ import org.eclipse.tycho.Interpolator; import org.eclipse.tycho.ReactorProject; import org.eclipse.tycho.TargetEnvironment; -import org.eclipse.tycho.core.resolver.target.P2TargetPlatform; import org.eclipse.tycho.core.shared.MavenContext; +import org.eclipse.tycho.p2.repository.PublishingRepository; import org.eclipse.tycho.p2.tools.publisher.PublishProductToolImpl; import org.eclipse.tycho.p2.tools.publisher.PublisherActionRunner; import org.eclipse.tycho.p2.tools.publisher.PublisherServiceImpl; import org.eclipse.tycho.p2.tools.publisher.facade.PublishProductTool; import org.eclipse.tycho.p2.tools.publisher.facade.PublisherService; import org.eclipse.tycho.p2.tools.publisher.facade.PublisherServiceFactory; -import org.eclipse.tycho.repository.publishing.PublishingRepository; import org.eclipse.tycho.repository.registry.facade.ReactorRepositoryManager; +import org.eclipse.tycho.targetplatform.P2TargetPlatform; @Component(role = PublisherServiceFactory.class) public class PublisherServiceFactoryImpl implements PublisherServiceFactory { diff --git a/tycho-core/src/main/java/org/eclipse/tycho/p2resolver/ReactorRepositoryManagerImpl.java b/tycho-core/src/main/java/org/eclipse/tycho/p2resolver/ReactorRepositoryManagerImpl.java index 7cf2b99ae2..98c6799d8d 100644 --- a/tycho-core/src/main/java/org/eclipse/tycho/p2resolver/ReactorRepositoryManagerImpl.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/p2resolver/ReactorRepositoryManagerImpl.java @@ -22,20 +22,20 @@ import org.codehaus.plexus.component.annotations.Component; import org.codehaus.plexus.component.annotations.Requirement; import org.eclipse.equinox.p2.core.IProvisioningAgent; +import org.eclipse.tycho.ExecutionEnvironmentConfiguration; import org.eclipse.tycho.MavenArtifactRepositoryReference; import org.eclipse.tycho.ReactorProject; import org.eclipse.tycho.ReactorProjectIdentities; import org.eclipse.tycho.TargetPlatform; import org.eclipse.tycho.TychoConstants; import org.eclipse.tycho.core.DependencyResolver; -import org.eclipse.tycho.core.ee.shared.ExecutionEnvironmentConfiguration; import org.eclipse.tycho.core.osgitools.DefaultReactorProject; import org.eclipse.tycho.core.resolver.P2ResolverFactory; +import org.eclipse.tycho.p2.repository.PublishingRepository; import org.eclipse.tycho.p2.repository.module.PublishingRepositoryImpl; import org.eclipse.tycho.p2.target.facade.PomDependencyCollector; import org.eclipse.tycho.p2.target.facade.TargetPlatformConfigurationStub; import org.eclipse.tycho.p2.target.facade.TargetPlatformFactory; -import org.eclipse.tycho.repository.publishing.PublishingRepository; import org.eclipse.tycho.repository.registry.facade.ReactorRepositoryManager; import org.eclipse.tycho.targetplatform.TargetDefinition.MavenGAVLocation; diff --git a/tycho-core/src/main/java/org/eclipse/tycho/p2resolver/ShadowedUnitsQueryable.java b/tycho-core/src/main/java/org/eclipse/tycho/p2resolver/ShadowedUnitsQueryable.java index 8d493efa76..1b7d2f21a1 100644 --- a/tycho-core/src/main/java/org/eclipse/tycho/p2resolver/ShadowedUnitsQueryable.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/p2resolver/ShadowedUnitsQueryable.java @@ -19,7 +19,7 @@ import org.eclipse.equinox.p2.query.IQuery; import org.eclipse.equinox.p2.query.IQueryResult; import org.eclipse.equinox.p2.query.IQueryable; -import org.eclipse.tycho.core.resolver.target.P2TargetPlatform; +import org.eclipse.tycho.targetplatform.P2TargetPlatform; final class ShadowedUnitsQueryable implements IQueryable { private final P2TargetPlatform targetPlatform; 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 9df955f3a0..0b3d111fc0 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 @@ -26,9 +26,6 @@ import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -import java.util.function.Function; -import java.util.regex.Matcher; -import java.util.regex.Pattern; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.equinox.p2.core.IProvisioningAgent; @@ -43,11 +40,10 @@ import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository; import org.eclipse.tycho.BuildFailureException; import org.eclipse.tycho.ExecutionEnvironmentResolutionHints; -import org.eclipse.tycho.ReactorProject; import org.eclipse.tycho.TargetEnvironment; import org.eclipse.tycho.core.resolver.MavenTargetLocationFactory; import org.eclipse.tycho.core.resolver.shared.IncludeSourceMode; -import org.eclipse.tycho.core.resolver.target.TargetDefinitionContent; +import org.eclipse.tycho.core.shared.LoggingProgressMonitor; import org.eclipse.tycho.core.shared.MavenContext; import org.eclipse.tycho.core.shared.MavenLogger; import org.eclipse.tycho.core.shared.MultiLineLogger; @@ -56,8 +52,8 @@ import org.eclipse.tycho.p2.resolver.ResolverException; import org.eclipse.tycho.p2.resolver.URITargetDefinitionContent; import org.eclipse.tycho.p2maven.ListCompositeArtifactRepository; -import org.eclipse.tycho.repository.util.LoggingProgressMonitor; import org.eclipse.tycho.targetplatform.TargetDefinition; +import org.eclipse.tycho.targetplatform.TargetDefinitionContent; import org.eclipse.tycho.targetplatform.TargetDefinition.DirectoryLocation; import org.eclipse.tycho.targetplatform.TargetDefinition.FeaturesLocation; import org.eclipse.tycho.targetplatform.TargetDefinition.InstallableUnitLocation; @@ -79,29 +75,26 @@ */ public final class TargetDefinitionResolver { - private static final Pattern SYSTEM_PROPERTY_PATTERN = createVariablePatternArgument("system_property"); - private static final Pattern PROJECT_LOC_PATTERN = createVariablePatternArgument("project_loc"); - private static final Pattern ENV_VAR_PATTERN = createVariablePatternArgument("env_var"); - private final MavenLogger logger; private final List environments; private final ExecutionEnvironmentResolutionHints executionEnvironment; - private MavenContext mavenContext; private IncludeSourceMode includeSourceMode; private MavenTargetLocationFactory mavenDependenciesResolver; + private TargetDefinitionVariableResolver varResolver; public TargetDefinitionResolver(List environments, ExecutionEnvironmentResolutionHints executionEnvironment, IncludeSourceMode includeSourceMode, - MavenContext mavenContext, MavenTargetLocationFactory mavenDependenciesResolver) { + MavenContext mavenContext, MavenTargetLocationFactory mavenDependenciesResolver, + TargetDefinitionVariableResolver varResolver) { this.environments = environments; this.executionEnvironment = executionEnvironment; this.includeSourceMode = includeSourceMode; - this.mavenContext = mavenContext; this.mavenDependenciesResolver = mavenDependenciesResolver; this.logger = mavenContext.getLogger(); + this.varResolver = varResolver; } public TargetDefinitionContent resolveContent(TargetDefinition definition, IProvisioningAgent provisioningAgent) { @@ -142,7 +135,7 @@ public TargetDefinitionContent resolveContentWithExceptions(TargetDefinition def } List locations = new ArrayList<>(); for (Repository repository : installableUnitLocation.getRepositories()) { - URI location = repository.getLocation(); + URI location = resolveRepositoryLocation(repository.getLocation()); String key = location.normalize().toASCIIString(); locations.add(uriRepositories.computeIfAbsent(key, s -> new URITargetDefinitionContent(provisioningAgent, location, repository.getId()))); @@ -298,62 +291,15 @@ public static String convertRawToUri(String raw) { } protected String resolvePath(String path, TargetDefinition definition) { - path = resolvePattern(path, SYSTEM_PROPERTY_PATTERN, - key -> mavenContext.getSessionProperties().getProperty(key, "")); - path = resolvePattern(path, ENV_VAR_PATTERN, key -> { - String env = System.getenv(key); - return env == null ? "" : env; - }); - path = resolvePattern(path, PROJECT_LOC_PATTERN, this::findProjectLocation); - return path; + return varResolver.resolve(path); } - private String findProjectLocation(String projectName) { - if (projectName.startsWith("/")) { - projectName = projectName.substring(1); - } - logger.debug("Find project location for project " + projectName); - for (ReactorProject project : mavenContext.getProjects()) { - String name = project.getName(); - logger.debug("check reactor project name: " + name); - if (name.equals(projectName)) { - return project.getBasedir().getAbsolutePath(); - } - } - for (ReactorProject project : mavenContext.getProjects()) { - String artifactId = project.getArtifactId(); - logger.debug("check reactor project artifact id: " + artifactId); - if (artifactId.equals(projectName)) { - return project.getBasedir().getAbsolutePath(); - } - } - for (ReactorProject project : mavenContext.getProjects()) { - String name = project.getBasedir().getName(); - logger.debug("check reactor project base directory: " + name); - if (name.equals(projectName)) { - return project.getBasedir().getAbsolutePath(); - } - } - //if we can't resolve this, we will return the original one as this might be intentional to not include the project in the build - String defaultValue = "${project_loc:" + projectName + "}"; - logger.warn("Cannot resolve " + defaultValue + " target resolution might be incomplete"); - return defaultValue; - } - - private static String resolvePattern(String input, Pattern pattern, Function parameterResolver) { - Matcher matcher = pattern.matcher(input); - StringBuffer sb = new StringBuffer(); - while (matcher.find()) { - String group = matcher.group(1); - String resolved = parameterResolver.apply(group); - matcher.appendReplacement(sb, Matcher.quoteReplacement(resolved)); + protected URI resolveRepositoryLocation(String location) { + try { + return new URI(varResolver.resolve(location)); + } catch (URISyntaxException e) { + throw new TargetDefinitionSyntaxException("Invalid URI: " + location); } - matcher.appendTail(sb); - return sb.toString(); - } - - private static Pattern createVariablePatternArgument(String variableName) { - return Pattern.compile("\\$\\{" + variableName + ":([^}]+)\\}", Pattern.CASE_INSENSITIVE); } } diff --git a/tycho-core/src/main/java/org/eclipse/tycho/p2resolver/TargetDefinitionResolverService.java b/tycho-core/src/main/java/org/eclipse/tycho/p2resolver/TargetDefinitionResolverService.java index 9a97b79495..f99d3d7b1f 100644 --- a/tycho-core/src/main/java/org/eclipse/tycho/p2resolver/TargetDefinitionResolverService.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/p2resolver/TargetDefinitionResolverService.java @@ -31,9 +31,9 @@ import org.eclipse.tycho.TargetEnvironment; import org.eclipse.tycho.core.resolver.MavenTargetLocationFactory; import org.eclipse.tycho.core.resolver.shared.IncludeSourceMode; -import org.eclipse.tycho.core.resolver.target.TargetDefinitionContent; import org.eclipse.tycho.core.shared.MavenContext; import org.eclipse.tycho.targetplatform.TargetDefinition; +import org.eclipse.tycho.targetplatform.TargetDefinitionContent; /** * Service instance for resolving target definitions. Results are cached so that there is no @@ -53,6 +53,9 @@ public class TargetDefinitionResolverService { @Requirement private MavenTargetLocationFactory dependenciesResolver; + @Requirement + private TargetDefinitionVariableResolver varResolver; + // constructor for DS public TargetDefinitionResolverService() { } @@ -85,7 +88,7 @@ private CompletableFuture resolveFromArguments(Resoluti } TargetDefinitionResolver resolver = new TargetDefinitionResolver(arguments.environments, arguments.jreIUs, - arguments.includeSourceMode, mavenContext, dependenciesResolver); + arguments.includeSourceMode, mavenContext, dependenciesResolver, varResolver); try { return CompletableFuture.completedFuture(resolver.resolveContent(arguments.definition, arguments.agent)); } catch (Exception e) { @@ -127,6 +130,11 @@ public void setMavenDependenciesResolver(MavenTargetLocationFactory mavenDepende this.dependenciesResolver = mavenDependenciesResolver; } + // setter for DS + public void setTargetDefinitionVariableResolver(TargetDefinitionVariableResolver varResolver) { + this.varResolver = varResolver; + } + private static final class ResolutionArguments { final TargetDefinition definition; diff --git a/tycho-core/src/main/java/org/eclipse/tycho/p2resolver/TargetDefinitionVariableResolver.java b/tycho-core/src/main/java/org/eclipse/tycho/p2resolver/TargetDefinitionVariableResolver.java new file mode 100644 index 0000000000..e6d01d5e2d --- /dev/null +++ b/tycho-core/src/main/java/org/eclipse/tycho/p2resolver/TargetDefinitionVariableResolver.java @@ -0,0 +1,23 @@ +/******************************************************************************* + * Copyright (c) 2023 Vaclav Hala and others. + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * Contributors: + * Vaclav Hala - initial API and implementation + * + *******************************************************************************/ +package org.eclipse.tycho.p2resolver; + +public interface TargetDefinitionVariableResolver { + + /** + * Resolve variables of the form ${TYPE:VALUE} in the user-supplied raw value. Multiple + * variables may be present in single raw value. Example variable: ${env_var:MY_VAR} + */ + String resolve(String raw); + +} diff --git a/tycho-core/src/main/java/org/eclipse/tycho/p2resolver/TargetPlatformBaseImpl.java b/tycho-core/src/main/java/org/eclipse/tycho/p2resolver/TargetPlatformBaseImpl.java index 1eb1eb0b15..d99f477a9a 100644 --- a/tycho-core/src/main/java/org/eclipse/tycho/p2resolver/TargetPlatformBaseImpl.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/p2resolver/TargetPlatformBaseImpl.java @@ -30,13 +30,13 @@ import org.eclipse.tycho.DependencyResolutionException; import org.eclipse.tycho.ExecutionEnvironmentResolutionHints; import org.eclipse.tycho.IArtifactFacade; +import org.eclipse.tycho.IRawArtifactFileProvider; import org.eclipse.tycho.IllegalArtifactReferenceException; import org.eclipse.tycho.ReactorProjectIdentities; import org.eclipse.tycho.core.resolver.target.ArtifactMatcher; import org.eclipse.tycho.core.resolver.target.ArtifactTypeHelper; -import org.eclipse.tycho.core.resolver.target.P2TargetPlatform; -import org.eclipse.tycho.p2.artifact.provider.IRawArtifactFileProvider; import org.eclipse.tycho.p2.repository.LocalArtifactRepository; +import org.eclipse.tycho.targetplatform.P2TargetPlatform; abstract class TargetPlatformBaseImpl implements P2TargetPlatform { diff --git a/tycho-core/src/main/java/org/eclipse/tycho/p2resolver/TargetPlatformFactoryImpl.java b/tycho-core/src/main/java/org/eclipse/tycho/p2resolver/TargetPlatformFactoryImpl.java index 8c7786d9ce..079436a479 100644 --- a/tycho-core/src/main/java/org/eclipse/tycho/p2resolver/TargetPlatformFactoryImpl.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/p2resolver/TargetPlatformFactoryImpl.java @@ -46,25 +46,23 @@ import org.eclipse.equinox.p2.repository.artifact.IArtifactRepositoryManager; import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository; import org.eclipse.equinox.p2.repository.metadata.IMetadataRepositoryManager; +import org.eclipse.tycho.ExecutionEnvironmentConfiguration; import org.eclipse.tycho.ExecutionEnvironmentResolutionHints; import org.eclipse.tycho.IArtifactFacade; +import org.eclipse.tycho.IRawArtifactFileProvider; import org.eclipse.tycho.IDependencyMetadata.DependencyMetadataType; import org.eclipse.tycho.IRepositoryIdManager; import org.eclipse.tycho.MavenRepositoryLocation; import org.eclipse.tycho.ReactorProject; import org.eclipse.tycho.ReactorProjectIdentities; import org.eclipse.tycho.TargetPlatform; -import org.eclipse.tycho.artifacts.TargetPlatformFilter; import org.eclipse.tycho.core.ee.impl.ExecutionEnvironmentResolutionHandler; -import org.eclipse.tycho.core.ee.shared.ExecutionEnvironmentConfiguration; import org.eclipse.tycho.core.resolver.target.DuplicateReactorIUsException; import org.eclipse.tycho.core.resolver.target.FileArtifactRepository; -import org.eclipse.tycho.core.resolver.target.P2TargetPlatform; -import org.eclipse.tycho.core.resolver.target.TargetDefinitionContent; import org.eclipse.tycho.core.resolver.target.TargetPlatformFilterEvaluator; +import org.eclipse.tycho.core.shared.DuplicateFilteringLoggingProgressMonitor; import org.eclipse.tycho.core.shared.MavenContext; import org.eclipse.tycho.core.shared.MavenLogger; -import org.eclipse.tycho.p2.artifact.provider.IRawArtifactFileProvider; import org.eclipse.tycho.p2.metadata.ReactorProjectFacade; import org.eclipse.tycho.p2.repository.ArtifactRepositoryBlackboard; import org.eclipse.tycho.p2.repository.ArtifactTransferPolicies; @@ -75,15 +73,17 @@ import org.eclipse.tycho.p2.repository.LocalMetadataRepository; import org.eclipse.tycho.p2.repository.MirroringArtifactProvider; import org.eclipse.tycho.p2.repository.ProviderOnlyArtifactRepository; +import org.eclipse.tycho.p2.repository.PublishingRepository; import org.eclipse.tycho.p2.repository.RepositoryArtifactProvider; +import org.eclipse.tycho.p2.repository.RepositoryBlackboardKey; import org.eclipse.tycho.p2.target.facade.PomDependencyCollector; import org.eclipse.tycho.p2.target.facade.TargetPlatformConfigurationStub; import org.eclipse.tycho.p2.target.facade.TargetPlatformFactory; import org.eclipse.tycho.p2maven.ListCompositeArtifactRepository; -import org.eclipse.tycho.repository.publishing.PublishingRepository; -import org.eclipse.tycho.repository.registry.facade.RepositoryBlackboardKey; -import org.eclipse.tycho.repository.util.DuplicateFilteringLoggingProgressMonitor; +import org.eclipse.tycho.targetplatform.P2TargetPlatform; import org.eclipse.tycho.targetplatform.TargetDefinition; +import org.eclipse.tycho.targetplatform.TargetDefinitionContent; +import org.eclipse.tycho.targetplatform.TargetPlatformFilter; public class TargetPlatformFactoryImpl implements TargetPlatformFactory { diff --git a/tycho-core/src/main/java/org/eclipse/tycho/p2tools/MirrorApplicationServiceImpl.java b/tycho-core/src/main/java/org/eclipse/tycho/p2tools/MirrorApplicationServiceImpl.java index 8ad4898a48..b68face24c 100644 --- a/tycho-core/src/main/java/org/eclipse/tycho/p2tools/MirrorApplicationServiceImpl.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/p2tools/MirrorApplicationServiceImpl.java @@ -53,6 +53,7 @@ import org.eclipse.tycho.BuildDirectory; import org.eclipse.tycho.TargetEnvironment; import org.eclipse.tycho.core.resolver.shared.DependencySeed; +import org.eclipse.tycho.core.shared.StatusTool; import org.eclipse.tycho.p2.repository.GAV; import org.eclipse.tycho.p2.repository.RepositoryLayoutHelper; import org.eclipse.tycho.p2.tools.BuildContext; @@ -62,7 +63,6 @@ import org.eclipse.tycho.p2.tools.mirroring.facade.IUDescription; import org.eclipse.tycho.p2.tools.mirroring.facade.MirrorApplicationService; import org.eclipse.tycho.p2.tools.mirroring.facade.MirrorOptions; -import org.eclipse.tycho.repository.util.StatusTool; @Component(role = MirrorApplicationService.class) public class MirrorApplicationServiceImpl implements MirrorApplicationService { diff --git a/tycho-core/src/main/java/org/eclipse/tycho/p2tools/RepositoryReferenceTool.java b/tycho-core/src/main/java/org/eclipse/tycho/p2tools/RepositoryReferenceTool.java index c305da2e3d..cbabf25713 100644 --- a/tycho-core/src/main/java/org/eclipse/tycho/p2tools/RepositoryReferenceTool.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/p2tools/RepositoryReferenceTool.java @@ -36,8 +36,8 @@ import org.eclipse.tycho.core.TychoProjectManager; import org.eclipse.tycho.core.osgitools.DefaultReactorProject; import org.eclipse.tycho.core.utils.TychoProjectUtils; +import org.eclipse.tycho.p2.repository.RepositoryBlackboardKey; import org.eclipse.tycho.p2.tools.RepositoryReferences; -import org.eclipse.tycho.repository.registry.facade.RepositoryBlackboardKey; /** * Tool to obtain the list of p2 repositories that contain the dependencies of a module. diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/repository/registry/facade/ReactorRepositoryManager.java b/tycho-core/src/main/java/org/eclipse/tycho/repository/registry/facade/ReactorRepositoryManager.java similarity index 94% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/repository/registry/facade/ReactorRepositoryManager.java rename to tycho-core/src/main/java/org/eclipse/tycho/repository/registry/facade/ReactorRepositoryManager.java index 4f77a123ac..8879386dfb 100644 --- a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/repository/registry/facade/ReactorRepositoryManager.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/repository/registry/facade/ReactorRepositoryManager.java @@ -15,13 +15,13 @@ import java.util.List; +import org.eclipse.tycho.ExecutionEnvironmentConfiguration; import org.eclipse.tycho.ReactorProject; import org.eclipse.tycho.ReactorProjectIdentities; import org.eclipse.tycho.TargetPlatform; -import org.eclipse.tycho.core.ee.shared.ExecutionEnvironmentConfiguration; +import org.eclipse.tycho.p2.repository.PublishingRepository; import org.eclipse.tycho.p2.target.facade.PomDependencyCollector; import org.eclipse.tycho.p2.target.facade.TargetPlatformConfigurationStub; -import org.eclipse.tycho.repository.publishing.PublishingRepository; /** * Manages the p2 repositories for the projects' build results ("publishing repository") and the p2 diff --git a/tycho-core/src/test/java/org/eclipse/m2e/pde/target/tests/AbstractMavenTargetTest.java b/tycho-core/src/test/java/org/eclipse/m2e/pde/target/tests/AbstractMavenTargetTest.java new file mode 100644 index 0000000000..cb260a500f --- /dev/null +++ b/tycho-core/src/test/java/org/eclipse/m2e/pde/target/tests/AbstractMavenTargetTest.java @@ -0,0 +1,225 @@ +/******************************************************************************* + * Copyright (c) 2023, 2023 Hannes Wellmann and others + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * https://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Hannes Wellmann - initial API and implementation + *******************************************************************************/ +package org.eclipse.m2e.pde.target.tests; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.fail; + +import java.io.File; +import java.io.IOException; +import java.net.URI; +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.ServiceLoader; +import java.util.ServiceLoader.Provider; +import java.util.Set; +import java.util.function.BiPredicate; +import java.util.function.Function; +import java.util.function.Predicate; +import java.util.jar.Attributes; +import java.util.jar.JarFile; +import java.util.stream.Collectors; + +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.URIUtil; +import org.eclipse.equinox.frameworkadmin.BundleInfo; +import org.eclipse.m2e.pde.target.tests.spi.TargetLocationLoader; +import org.eclipse.pde.core.target.ITargetLocation; +import org.eclipse.pde.core.target.NameVersionDescriptor; +import org.eclipse.pde.core.target.TargetBundle; +import org.eclipse.pde.core.target.TargetFeature; +import org.junit.Rule; +import org.junit.rules.TemporaryFolder; + +public abstract class AbstractMavenTargetTest { + static final String SOURCE_BUNDLE_SUFFIX = ".source"; + static final TargetBundle[] EMPTY = {}; + + @Rule + public TemporaryFolder temporaryFolder = new TemporaryFolder(); + + private static ServiceLoader LOCATION_LOADER = ServiceLoader.load(TargetLocationLoader.class, + AbstractMavenTargetTest.class.getClassLoader()); + private static TargetLocationLoader loader; + + ITargetLocation resolveMavenTarget(String targetXML) throws Exception { + return getLoader().resolveMavenTarget(targetXML, temporaryFolder.newFolder()); + } + + private static TargetLocationLoader getLoader() { + if (loader == null) { + Provider provider = LOCATION_LOADER.stream().sorted().findFirst().orElseThrow( + () -> new IllegalStateException("No TargetLocationLoader found on classpath of test!")); + loader = provider.get(); + } + return loader; + } + + protected static void assertStatusOk(IStatus status) { + if (!status.isOK()) { + throw new AssertionError(status.toString(), status.getException()); + } + } + + // --- common assertion utilities --- + + private static Map assertTargetContent(List expectedUnits, T[] allUnit, + BiPredicate matcher, Function getLocation, Predicate isSourceUnit, + Function getSourceTarget, Function toString) { + + Map units = new HashMap<>(); + List allElements = new ArrayList<>(Arrays.asList(allUnit)); + for (U expectedUnit : expectedUnits) { + List matchingUnits = allElements.stream().filter(u -> matcher.test(expectedUnit, u)).toList(); + + if (matchingUnits.isEmpty()) { + fail("Expected unit is missing: " + expectedUnit); + } else if (matchingUnits.size() == 1) { + T targetUnit = matchingUnits.get(0); + allElements.remove(targetUnit); + + assertEquals("Unexpected 'original' state of " + targetUnit, expectedUnit.isOriginal(), + isOriginalArtifact(expectedUnit, targetUnit, getLocation)); + assertEquals("Unexpected 'isSource' state of " + targetUnit, expectedUnit.isSourceBundle(), + isSourceUnit.test(targetUnit)); + if (expectedUnit.isSourceBundle()) { + String expectedSourceTarget = expectedUnit.id().substring(0, + expectedUnit.id().length() - SOURCE_BUNDLE_SUFFIX.length()); + assertEquals("Source target id", expectedSourceTarget, getSourceTarget.apply(targetUnit)); + } else { + assertNull(getSourceTarget.apply(targetUnit)); + } + units.put(expectedUnit, targetUnit); + } else { + fail("Expected bundle contaiend multiple times:" + expectedUnit); + } + } + if (!allElements.isEmpty()) { + String unepxectedBundlesList = allElements.stream().map(u -> " " + toString.apply(u)) + .collect(Collectors.joining("\n")); + fail("Encoutnered the following unexpected bundles:" + unepxectedBundlesList); + } + return units; + } + + private static boolean isOriginalArtifact(ExpectedUnit expectedUnit, T unit, Function getLocation) { + ArtifactKey key = expectedUnit.key(); + if (key == null) { + return false; + } + URI location = getLocation.apply(unit); + String expectedPathSuffix = "/" + String.join("/", ".m2", "repository", key.groupId().replace('.', '/'), + key.artifactId(), key.version(), key.artifactId() + "-" + key.version() + ".jar"); + return location.toASCIIString().endsWith(expectedPathSuffix); + } + + // --- assertion utilities for Bundles in target --- + + static ExpectedBundle originalOSGiBundle(String bsn, String version, String groupArtifact) { + return originalOSGiBundle(bsn, version, groupArtifact, version); + } + + static ExpectedBundle originalOSGiBundle(String bsn, String version, String groupArtifact, String mavenVersion) { + return new ExpectedBundle(bsn, version, false, true, + ArtifactKey.fromPortableString(groupArtifact + ":" + mavenVersion + "::")); + } + + static ExpectedBundle generatedBundle(String bsn, String version, String groupArtifact) { + return new ExpectedBundle(bsn, version, false, false, + ArtifactKey.fromPortableString(groupArtifact + ":" + version + "::")); + } + + static List withSourceBundles(List mainBundles) { + return mainBundles.stream().mapMulti((unit, downStream) -> { + downStream.accept(unit); + String sourceId = unit.bsn() + SOURCE_BUNDLE_SUFFIX; + ExpectedBundle sourceUnit = new ExpectedBundle(sourceId, unit.version(), true, false, unit.key()); + downStream.accept(sourceUnit); + }).toList(); + } + + static Attributes getManifestMainAttributes(TargetBundle targetBundle) throws IOException { + BundleInfo bundleInfo = targetBundle.getBundleInfo(); + File file = URIUtil.toFile(bundleInfo.getLocation()); + try (var jar = new JarFile(file)) { + return jar.getManifest().getMainAttributes(); + } + } + + static void assertTargetBundles(ITargetLocation target, List expectedUnits) { + assertTargetContent(expectedUnits, target.getBundles(), // + (expectedBundle, bundle) -> { + BundleInfo info = bundle.getBundleInfo(); + return expectedBundle.bsn().equals(info.getSymbolicName()) + && expectedBundle.version().equals(info.getVersion()); + }, // + tb -> tb.getBundleInfo().getLocation(), // + tb -> tb.isSourceBundle(), + tb -> tb.getSourceTarget() != null ? tb.getSourceTarget().getSymbolicName() : null, + tb -> tb.getBundleInfo().getSymbolicName() + ":" + tb.getBundleInfo().getVersion()); + } + + // --- assertion utilities for Features in a target --- + + static ExpectedFeature originalFeature(String id, String version, String groupArtifact, + List containedPlugins) { + ArtifactKey key = ArtifactKey.fromPortableString(groupArtifact + ":" + version + "::"); + return new ExpectedFeature(id, version, false, true, key, containedPlugins); + } + + static ExpectedFeature generatedFeature(String id, String version, List containedPlugins) { + return new ExpectedFeature(id, version, false, false, null, containedPlugins); + } + + static NameVersionDescriptor featurePlugin(String bsn, String version) { + return new NameVersionDescriptor(bsn, version); + } + + static List withSourceFeatures(List mainFeatures) { + return mainFeatures.stream().mapMulti((feature, downStream) -> { + downStream.accept(feature); + String sourceId = feature.id() + SOURCE_BUNDLE_SUFFIX; + List sourcePlugins = feature.containedPlugins().stream() + .map(d -> featurePlugin(d.getId() + SOURCE_BUNDLE_SUFFIX, d.getVersion())).toList(); + ExpectedFeature sourceUnit = new ExpectedFeature(sourceId, feature.version(), true, false, feature.key(), + sourcePlugins); + downStream.accept(sourceUnit); + }).toList(); + } + + static Map assertTargetFeatures(ITargetLocation target, + List expectedFeatures) { + var encounteredFeatures = assertTargetContent(expectedFeatures, target.getFeatures(), // + (expectedFeature, feature) -> expectedFeature.id().equals(feature.getId()) + && expectedFeature.version().equals(feature.getVersion()), // + f -> Path.of(f.getLocation()).toUri(), // + f -> isSourceFeature(f), // + f -> isSourceFeature(f) ? f.getId().substring(0, f.getId().length() - SOURCE_BUNDLE_SUFFIX.length()) + : null, // + f -> f.getId() + ":" + f.getVersion()); + encounteredFeatures.forEach((expectedFeature, feature) -> { + assertEquals(Set.copyOf(expectedFeature.containedPlugins()), Set.of(feature.getPlugins())); + }); + return encounteredFeatures; + } + + private static boolean isSourceFeature(TargetFeature f) { + return f.getId().endsWith(SOURCE_BUNDLE_SUFFIX) + && Arrays.stream(f.getPlugins()).allMatch(d -> d.getId().endsWith(SOURCE_BUNDLE_SUFFIX)); + } +} diff --git a/tycho-core/src/test/java/org/eclipse/m2e/pde/target/tests/ArtifactKey.java b/tycho-core/src/test/java/org/eclipse/m2e/pde/target/tests/ArtifactKey.java new file mode 100644 index 0000000000..098af99152 --- /dev/null +++ b/tycho-core/src/test/java/org/eclipse/m2e/pde/target/tests/ArtifactKey.java @@ -0,0 +1,55 @@ +/******************************************************************************* + * Copyright (c) 2008-2022 Sonatype, Inc. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Sonatype, Inc. - initial API and implementation + * Hannes Wellmann - Convert to record + *******************************************************************************/ + +package org.eclipse.m2e.pde.target.tests; + +import java.io.Serializable; + +import org.eclipse.osgi.util.NLS; + +public record ArtifactKey(String groupId, String artifactId, String version, String classifier) + implements Serializable { + public static ArtifactKey fromPortableString(String str) { + int p = 0; + int c = nextColonIndex(str, p); + String groupId = substring(str, p, c); + + p = c + 1; + c = nextColonIndex(str, p); + String artifactId = substring(str, p, c); + + p = c + 1; + c = nextColonIndex(str, p); + String version = substring(str, p, c); + + p = c + 1; + c = nextColonIndex(str, p); + String classifier = substring(str, p, c); + + return new ArtifactKey(groupId, artifactId, version, classifier); + } + + private static String substring(String str, int start, int end) { + String substring = str.substring(start, end); + return "".equals(substring) ? null : substring; //$NON-NLS-1$ + } + + private static int nextColonIndex(String str, int pos) { + int idx = str.indexOf(':', pos); + if (idx < 0) { + throw new IllegalArgumentException(NLS.bind("Invalid portable string: {0}", str)); + } + return idx; + } +} diff --git a/tycho-core/src/test/java/org/eclipse/m2e/pde/target/tests/DependencyExclusionTest.java b/tycho-core/src/test/java/org/eclipse/m2e/pde/target/tests/DependencyExclusionTest.java new file mode 100644 index 0000000000..28613dddb0 --- /dev/null +++ b/tycho-core/src/test/java/org/eclipse/m2e/pde/target/tests/DependencyExclusionTest.java @@ -0,0 +1,171 @@ +/******************************************************************************* + * Copyright (c) 2023, 2023 Hannes Wellmann and others + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * https://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Hannes Wellmann - initial API and implementation + *******************************************************************************/ +package org.eclipse.m2e.pde.target.tests; + +import static org.junit.Assert.assertArrayEquals; + +import java.util.List; + +import org.eclipse.pde.core.target.ITargetLocation; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.Parameterized; +import org.junit.runners.Parameterized.Parameter; +import org.junit.runners.Parameterized.Parameters; + +@RunWith(Parameterized.class) +public class DependencyExclusionTest extends AbstractMavenTargetTest { + @Parameter(0) + public Boolean includeSource; + + @Parameters(name = "includeSource={0}") + public static List dependencyConfigurations() { + return List.of(false, true); + } + + @Test + public void testExclusionOfDirectRequirement() throws Exception { + ITargetLocation target = resolveMavenTarget(String.format( + """ + + + + org.junit.platform + junit-platform-commons + 1.9.3 + jar + + + org.apiguardian:apiguardian-api:1.1.2 + + """, + includeSource)); + assertStatusOk(target.getStatus()); + assertArrayEquals(EMPTY, target.getFeatures()); + List expectedBundles = List.of(junitPlatformCommons("1.9.3")); + assertTargetBundles(target, includeSource ? withSourceBundles(expectedBundles) : expectedBundles); + } + + @Test + public void testExclusionOfDirectAndTransitivRequirement() throws Exception { + ITargetLocation target = resolveMavenTarget(String + .format( + """ + + + + org.junit.jupiter + junit-jupiter-api + 5.9.3 + jar + + + org.apiguardian:apiguardian-api:1.1.2 + + """, + includeSource)); + assertStatusOk(target.getStatus()); + assertArrayEquals(EMPTY, target.getFeatures()); + List expectedBundles = List.of(// + junitJupiterAPI(), // + junitPlatformCommons("1.9.3"), // + opentest4j()); + assertTargetBundles(target, includeSource ? withSourceBundles(expectedBundles) : expectedBundles); + + } + + @Test + public void testExclusionOfMultipleVersions() throws Exception { + ITargetLocation target = resolveMavenTarget(String + .format( + """ + + + + org.junit.jupiter + junit-jupiter-api + 5.9.3 + jar + + + org.junit.platform + junit-platform-commons + 1.7.2 + jar + + + org.apiguardian:apiguardian-api:1.1.2 + org.apiguardian:apiguardian-api:1.1.0 + + """, + includeSource)); + assertStatusOk(target.getStatus()); + assertArrayEquals(EMPTY, target.getFeatures()); + List expectedBundles = List.of(// + junitJupiterAPI(), // + junitPlatformCommons("1.9.3"), // + junitPlatformCommons("1.7.2"), // + opentest4j()); + assertTargetBundles(target, includeSource ? withSourceBundles(expectedBundles) : expectedBundles); + } + + @Test + public void testExclusionOfDifferentVersions() throws Exception { + ITargetLocation target = resolveMavenTarget(String + .format( + """ + + + + org.junit.jupiter + junit-jupiter-api + 5.9.3 + jar + + + org.junit.platform + junit-platform-commons + 1.7.2 + jar + + + org.apiguardian:apiguardian-api:1.1.0 + + """, + includeSource)); + assertStatusOk(target.getStatus()); + assertArrayEquals(EMPTY, target.getFeatures()); + List expectedBundles = List.of(// + junitJupiterAPI(), // + junitPlatformCommons("1.9.3"), // + junitPlatformCommons("1.7.2"), // + apiGuardian("1.1.2"), opentest4j()); + assertTargetBundles(target, includeSource ? withSourceBundles(expectedBundles) : expectedBundles); + } + + private static ExpectedBundle junitPlatformCommons(String version) { + return originalOSGiBundle("junit-platform-commons", version, "org.junit.platform:junit-platform-commons"); + } + + private static ExpectedBundle junitJupiterAPI() { + return originalOSGiBundle("junit-jupiter-api", "5.9.3", "org.junit.jupiter:junit-jupiter-api"); + } + + private static ExpectedBundle apiGuardian(String version) { + return originalOSGiBundle("org.apiguardian.api", version, "org.apiguardian:apiguardian-api"); + } + + private static ExpectedBundle opentest4j() { + return originalOSGiBundle("org.opentest4j", "1.2.0", "org.opentest4j:opentest4j"); + } +} diff --git a/tycho-core/src/test/java/org/eclipse/m2e/pde/target/tests/ExpectedBundle.java b/tycho-core/src/test/java/org/eclipse/m2e/pde/target/tests/ExpectedBundle.java new file mode 100644 index 0000000000..eea73c5a39 --- /dev/null +++ b/tycho-core/src/test/java/org/eclipse/m2e/pde/target/tests/ExpectedBundle.java @@ -0,0 +1,27 @@ +/******************************************************************************* + * Copyright (c) 2023, 2023 Hannes Wellmann and others + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * https://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Hannes Wellmann - initial API and implementation + *******************************************************************************/ +package org.eclipse.m2e.pde.target.tests; + +public record ExpectedBundle(String bsn, String version, boolean isSourceBundle, boolean isOriginal, + ArtifactKey key) implements ExpectedUnit { + + @Override + public String id() { + return bsn(); + } + + @Override + public String toString() { + return bsn + ":" + version; + } +} \ No newline at end of file diff --git a/tycho-core/src/test/java/org/eclipse/m2e/pde/target/tests/ExpectedFeature.java b/tycho-core/src/test/java/org/eclipse/m2e/pde/target/tests/ExpectedFeature.java new file mode 100644 index 0000000000..d5bc4a18ac --- /dev/null +++ b/tycho-core/src/test/java/org/eclipse/m2e/pde/target/tests/ExpectedFeature.java @@ -0,0 +1,26 @@ +/******************************************************************************* + * Copyright (c) 2023, 2023 Hannes Wellmann and others + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * https://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Hannes Wellmann - initial API and implementation + *******************************************************************************/ +package org.eclipse.m2e.pde.target.tests; + +import java.util.List; + +import org.eclipse.pde.core.target.NameVersionDescriptor; + +public record ExpectedFeature(String id, String version, boolean isSourceBundle, boolean isOriginal, + ArtifactKey key, List containedPlugins) implements ExpectedUnit { + + @Override + public String toString() { + return id + ":" + version; + } +} \ No newline at end of file diff --git a/tycho-core/src/test/java/org/eclipse/m2e/pde/target/tests/ExpectedUnit.java b/tycho-core/src/test/java/org/eclipse/m2e/pde/target/tests/ExpectedUnit.java new file mode 100644 index 0000000000..0f06e28c4e --- /dev/null +++ b/tycho-core/src/test/java/org/eclipse/m2e/pde/target/tests/ExpectedUnit.java @@ -0,0 +1,23 @@ +/******************************************************************************* + * Copyright (c) 2023, 2023 Hannes Wellmann and others + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * https://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Hannes Wellmann - initial API and implementation + *******************************************************************************/ +package org.eclipse.m2e.pde.target.tests; +interface ExpectedUnit { + + String id(); + + boolean isSourceBundle(); + + boolean isOriginal(); + + ArtifactKey key(); +} \ No newline at end of file diff --git a/tycho-core/src/test/java/org/eclipse/m2e/pde/target/tests/MavenFeatureTest.java b/tycho-core/src/test/java/org/eclipse/m2e/pde/target/tests/MavenFeatureTest.java new file mode 100644 index 0000000000..d87746c585 --- /dev/null +++ b/tycho-core/src/test/java/org/eclipse/m2e/pde/target/tests/MavenFeatureTest.java @@ -0,0 +1,187 @@ +/******************************************************************************* + * Copyright (c) 2023, 2023 Hannes Wellmann and others + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * https://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Hannes Wellmann - initial API and implementation + *******************************************************************************/ +package org.eclipse.m2e.pde.target.tests; + +import java.util.List; + +import org.eclipse.pde.core.target.ITargetLocation; +import org.junit.Assume; +import org.junit.Ignore; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.Parameterized; +import org.junit.runners.Parameterized.Parameter; +import org.junit.runners.Parameterized.Parameters; + +@RunWith(Parameterized.class) +public class MavenFeatureTest extends AbstractMavenTargetTest { + @Parameter(0) + public Boolean includeSource; + + @Parameters(name = "includeSource={0}") + public static List dependencyConfigurations() { + return List.of(false, true); + } + + @Test + @Ignore("FIXME") + public void testLocationContentFeatureGeneration() throws Exception { + ITargetLocation target = resolveMavenTarget(String.format( + """ + + + + This is a great feature + + + My copyright description. + + + No license granted. + + + + + + org.junit.jupiter + junit-jupiter-api + 5.9.3 + jar + + + + """, + includeSource)); + assertStatusOk(target.getStatus()); + List expectedBundles = List.of( // + junitJupiterAPI(), // + junitPlatformCommons(), // + apiGuardian(), opentest4j()); + assertTargetBundles(target, includeSource ? withSourceBundles(expectedBundles) : expectedBundles); + List expectedFeature = List.of(generatedFeature("my.junit.feature", "1.2.3.qualifier", List.of(// + featurePlugin("junit-jupiter-api", "5.9.3"), // + featurePlugin("junit-platform-commons", "1.9.3"), // + featurePlugin("org.apiguardian.api", "1.1.2"), // + featurePlugin("org.opentest4j", "1.2.0"), // + featurePlugin("slf4j.api", null)))); + List expectedFeatures = includeSource ? withSourceFeatures(expectedFeature) : expectedFeature; + expectedFeatures = expectedFeatures.stream().map(f -> { + if (f.containedPlugins().stream().noneMatch(d -> d.getId().equals("slf4j.api.source"))) { + return f; + } + // Explicitly listed Plug-ins are just removed for a Source-Feature, if they are + // (probably) not a source Plug-in and are not mapped to a source Plug-in. + return new ExpectedFeature(f.id(), f.version(), f.isSourceBundle(), f.isOriginal(), f.key(), + f.containedPlugins().stream().filter(d -> !d.getId().equals("slf4j.api.source")).toList()); + }).toList(); + assertTargetFeatures(target, expectedFeatures); + } + + @Test + @Ignore("FIXME") + public void testPomArtifactFeatureGeneration() throws Exception { + ITargetLocation target = resolveMavenTarget(String.format( + """ + + + + com.sun.xml.bind + jaxb-ri + 4.0.2 + pom + + + + """, + includeSource)); + assertStatusOk(target.getStatus()); + List expectedBundles = List.of( // + originalOSGiBundle("com.sun.xml.bind.jaxb-core", "4.0.2", "com.sun.xml.bind:jaxb-core"), + originalOSGiBundle("com.sun.xml.bind.jaxb-impl", "4.0.2", "com.sun.xml.bind:jaxb-impl"), + originalOSGiBundle("com.sun.xml.bind.jaxb-jxc", "4.0.2", "com.sun.xml.bind:jaxb-jxc"), + originalOSGiBundle("com.sun.xml.bind.jaxb-xjc", "4.0.2", "com.sun.xml.bind:jaxb-xjc"), + originalOSGiBundle("com.sun.xml.fastinfoset.FastInfoset", "2.1.0", + "com.sun.xml.fastinfoset:FastInfoset"), + originalOSGiBundle("jakarta.activation-api", "2.1.1", "jakarta.activation:jakarta.activation-api"), + originalOSGiBundle("jakarta.xml.bind-api", "4.0.0", "jakarta.xml.bind:jakarta.xml.bind-api"), + originalOSGiBundle("org.jvnet.staxex.stax-ex", "2.1.0", "org.jvnet.staxex:stax-ex")); + assertTargetBundles(target, includeSource ? withSourceBundles(expectedBundles) : expectedBundles); + List expectedFeature = List.of(generatedFeature("com.sun.xml.bind.jaxb-ri.pom", "0.0.1", + List.of(// + featurePlugin("com.sun.xml.bind.jaxb-core", "4.0.2"), + featurePlugin("com.sun.xml.bind.jaxb-impl", "4.0.2"), + featurePlugin("com.sun.xml.bind.jaxb-jxc", "4.0.2"), + featurePlugin("com.sun.xml.bind.jaxb-xjc", "4.0.2"), + featurePlugin("com.sun.xml.fastinfoset.FastInfoset", "2.1.0"), + featurePlugin("jakarta.activation-api", "2.1.1"), + featurePlugin("jakarta.xml.bind-api", "4.0.0"), + featurePlugin("org.jvnet.staxex.stax-ex", "2.1.0")))); + assertTargetFeatures(target, includeSource ? withSourceFeatures(expectedFeature) : expectedFeature); + + } + + @Test + public void testFeatureArtifact() throws Exception { + // TODO: For real feature artifacts, which don't have a source-artifact, a + // source feature is not generated (yet). + Assume.assumeFalse(includeSource); + ITargetLocation target = resolveMavenTarget(String.format( + """ + + + + org.eclipse.vorto + org.eclipse.vorto.feature + 1.0.0 + jar + + + + """, + includeSource)); + assertStatusOk(target.getStatus()); + assertTargetBundles(target, List.of()); + List expectedFeature = List.of(generatedFeature("org.eclipse.vorto.feature", "1.0.0", List.of(// + featurePlugin("org.eclipse.vorto.core", "1.0.0"), // + featurePlugin("org.eclipse.vorto.editor", "1.0.0"), // + featurePlugin("org.eclipse.vorto.editor.datatype", "1.0.0"), + featurePlugin("org.eclipse.vorto.editor.datatype.ide", "1.0.0"), + featurePlugin("org.eclipse.vorto.editor.datatype.ui", "1.0.0"), + featurePlugin("org.eclipse.vorto.editor.functionblock", "1.0.0"), + featurePlugin("org.eclipse.vorto.editor.functionblock.ide", "1.0.0"), + featurePlugin("org.eclipse.vorto.editor.functionblock.ui", "1.0.0"), + featurePlugin("org.eclipse.vorto.editor.infomodel", "1.0.0"), + featurePlugin("org.eclipse.vorto.editor.infomodel.ide", "1.0.0"), + featurePlugin("org.eclipse.vorto.editor.infomodel.ui", "1.0.0"), + featurePlugin("org.eclipse.vorto.editor.mapping", "1.0.0"), + featurePlugin("org.eclipse.vorto.editor.mapping.ide", "1.0.0"), + featurePlugin("org.eclipse.vorto.editor.mapping.ui", "1.0.0")))); + assertTargetFeatures(target, includeSource ? withSourceFeatures(expectedFeature) : expectedFeature); + } + + private static ExpectedBundle junitPlatformCommons() { + return originalOSGiBundle("junit-platform-commons", "1.9.3", "org.junit.platform:junit-platform-commons"); + } + + private static ExpectedBundle junitJupiterAPI() { + return originalOSGiBundle("junit-jupiter-api", "5.9.3", "org.junit.jupiter:junit-jupiter-api"); + } + + private static ExpectedBundle apiGuardian() { + return originalOSGiBundle("org.apiguardian.api", "1.1.2", "org.apiguardian:apiguardian-api"); + } + + private static ExpectedBundle opentest4j() { + return originalOSGiBundle("org.opentest4j", "1.2.0", "org.opentest4j:opentest4j"); + } +} diff --git a/tycho-core/src/test/java/org/eclipse/m2e/pde/target/tests/MavenTargetsTransitiveDependenciesTest.java b/tycho-core/src/test/java/org/eclipse/m2e/pde/target/tests/MavenTargetsTransitiveDependenciesTest.java new file mode 100644 index 0000000000..1efd5b8435 --- /dev/null +++ b/tycho-core/src/test/java/org/eclipse/m2e/pde/target/tests/MavenTargetsTransitiveDependenciesTest.java @@ -0,0 +1,140 @@ +/******************************************************************************* + * Copyright (c) 2023, 2023 Hannes Wellmann and others + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * https://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Hannes Wellmann - initial API and implementation + *******************************************************************************/ +package org.eclipse.m2e.pde.target.tests; + +import static org.junit.Assert.assertArrayEquals; + +import java.util.Collection; +import java.util.List; + +import org.eclipse.pde.core.target.ITargetLocation; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.Parameterized; +import org.junit.runners.Parameterized.Parameter; +import org.junit.runners.Parameterized.Parameters; + +@RunWith(Parameterized.class) +public class MavenTargetsTransitiveDependenciesTest extends AbstractMavenTargetTest { + + @Parameter(0) + public String dependencyDepth; + @Parameter(1) + public String dependencyScopes; + @Parameter(2) + public String sources; + @Parameter(3) + public List expectedBundles; + + @Parameters(name = "includeDependencyDepth={0} - includeDependencyScopes={1} - includeSource={2}") + public static Collection dependencyConfigurations() { + return List.of(// + new Object[] { "none", "", "false", List.of( // + junitJupiter("junit-jupiter")) }, + + new Object[] { "none", "", "true", withSourceBundles(List.of( // + junitJupiter("junit-jupiter"))) }, + + new Object[] { "direct", "compile", "false", List.of( // + junitJupiter("junit-jupiter"), // + junitJupiter("junit-jupiter-api"), // + junitJupiter("junit-jupiter-params")) }, + + new Object[] { "direct", "compile", "true", withSourceBundles(List.of( // + junitJupiter("junit-jupiter"), // + junitJupiter("junit-jupiter-api"), // + junitJupiter("junit-jupiter-params"))) }, + + new Object[] { "direct", "compile,runtime", "false", List.of( // + junitJupiter("junit-jupiter"), // + junitJupiter("junit-jupiter-api"), // + junitJupiter("junit-jupiter-params"), // + junitJupiter("junit-jupiter-engine")) }, + + new Object[] { "direct", "compile,runtime", "true", withSourceBundles(List.of( // + junitJupiter("junit-jupiter"), // + junitJupiter("junit-jupiter-api"), // + junitJupiter("junit-jupiter-params"), // + junitJupiter("junit-jupiter-engine"))) }, + + new Object[] { "infinite", "compile", "false", List.of( // + junitJupiter("junit-jupiter"), // + junitJupiter("junit-jupiter-api"), // + junitJupiter("junit-jupiter-params"), // + junitPlatform("junit-platform-commons"), // + apiGuardian(), opentest4j()) }, + + new Object[] { "infinite", "compile", "true", withSourceBundles(List.of(// + junitJupiter("junit-jupiter"), // + junitJupiter("junit-jupiter-api"), // + junitJupiter("junit-jupiter-params"), // + junitPlatform("junit-platform-commons"), // + apiGuardian(), opentest4j())) }, + + new Object[] { "infinite", "compile,runtime", "false", List.of( // + junitJupiter("junit-jupiter"), // + junitJupiter("junit-jupiter-api"), // + junitJupiter("junit-jupiter-params"), // + junitJupiter("junit-jupiter-engine"), // + junitPlatform("junit-platform-commons"), // + junitPlatform("junit-platform-engine"), // + apiGuardian(), opentest4j()) }, + + new Object[] { "infinite", "compile,runtime", "true", withSourceBundles(List.of( // + junitJupiter("junit-jupiter"), // + junitJupiter("junit-jupiter-api"), // + junitJupiter("junit-jupiter-params"), // + junitJupiter("junit-jupiter-engine"), // + junitPlatform("junit-platform-commons"), // + junitPlatform("junit-platform-engine"), // + apiGuardian(), opentest4j())) } + + ); + } + + private static ExpectedBundle junitJupiter(String artifactID) { + return originalOSGiBundle(artifactID, "5.9.3", "org.junit.jupiter:" + artifactID); + } + + private static ExpectedBundle junitPlatform(String artifactID) { + return originalOSGiBundle(artifactID, "1.9.3", "org.junit.platform:" + artifactID); + } + + private static ExpectedBundle apiGuardian() { + return originalOSGiBundle("org.apiguardian.api", "1.1.2", "org.apiguardian:apiguardian-api"); + } + + private static ExpectedBundle opentest4j() { + return originalOSGiBundle("org.opentest4j", "1.2.0", "org.opentest4j:opentest4j"); + } + + @Test + public void testSingleRootArtifact() throws Exception { + String targetDefinition = """ + + + + org.junit.jupiter + junit-jupiter + 5.9.3 + jar + + + + """ + .formatted(dependencyDepth, dependencyScopes, sources); + ITargetLocation target = resolveMavenTarget(targetDefinition); + assertTargetBundles(target, expectedBundles); + assertArrayEquals(EMPTY, target.getFeatures()); + } +} \ No newline at end of file diff --git a/tycho-core/src/test/java/org/eclipse/m2e/pde/target/tests/MixedCasesTest.java b/tycho-core/src/test/java/org/eclipse/m2e/pde/target/tests/MixedCasesTest.java new file mode 100644 index 0000000000..ec01d0f3bf --- /dev/null +++ b/tycho-core/src/test/java/org/eclipse/m2e/pde/target/tests/MixedCasesTest.java @@ -0,0 +1,104 @@ +/******************************************************************************* + * Copyright (c) 2023, 2023 Hannes Wellmann and others + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * https://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Hannes Wellmann - initial API and implementation + *******************************************************************************/ +package org.eclipse.m2e.pde.target.tests; + +import static org.junit.Assert.assertArrayEquals; + +import java.util.List; + +import org.eclipse.pde.core.target.ITargetLocation; +import org.junit.Ignore; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.Parameterized; +import org.junit.runners.Parameterized.Parameter; +import org.junit.runners.Parameterized.Parameters; + +@RunWith(Parameterized.class) +public class MixedCasesTest extends AbstractMavenTargetTest { + @Parameter(0) + public Boolean includeSource; + + @Parameters(name = "includeSource={0}") + public static List dependencyConfigurations() { + return List.of(false, true); + } + + @Test + @Ignore("FIXME") + public void testMultipleArtifactsWithWrappingAndExclusion() throws Exception { + ITargetLocation target = resolveMavenTarget(String.format( + """ + + + + com.google.guava + failureaccess + 1.0.1 + jar + + + com.google.guava + guava + 30.1.1-jre + jar + + + com.google.inject + guice + 5.1.0 + jar + + + + com.google.code.findbugs:jsr305:3.0.1 + com.google.code.findbugs:jsr305:3.0.2 + com.google.j2objc:j2objc-annotations:1.3 + org.checkerframework:checker-qual:3.5.0 + + """, + includeSource)); + assertStatusOk(target.getStatus()); + assertArrayEquals(EMPTY, target.getFeatures()); + List expectedBundles = List.of(// + originalOSGiBundle("com.google.inject", "5.1.0", "com.google.inject:guice"), + originalOSGiBundle("com.google.guava", "30.1.0.jre", "com.google.guava:guava", "30.1-jre"), + originalOSGiBundle("com.google.guava", "30.1.1.jre", "com.google.guava:guava", "30.1.1-jre"), + originalOSGiBundle("com.google.guava.failureaccess", "1.0.1", "com.google.guava:failureaccess"), + originalOSGiBundle("org.objectweb.asm", "9.2.0", "org.ow2.asm:asm", "9.2"), + originalOSGiBundle("checker-qual", "3.8.0", "org.checkerframework:checker-qual"), + generatedBundle("m2e.wrapped.com.google.errorprone.error_prone_annotations", "2.3.4", + "com.google.errorprone:error_prone_annotations"), + generatedBundle("m2e.wrapped.com.google.errorprone.error_prone_annotations", "2.5.1", + "com.google.errorprone:error_prone_annotations"), + generatedBundle("m2e.wrapped.javax.inject.javax.inject", "1", "javax.inject:javax.inject"), + generatedBundle("m2e.wrapped.aopalliance.aopalliance", "1.0", "aopalliance:aopalliance"), + generatedBundle("m2e.wrapped.com.google.guava.listenablefuture", + "9999.0.0.empty-to-avoid-conflict-with-guava", "com.google.guava:listenablefuture")); + if (includeSource) { + expectedBundles = withSourceBundles(expectedBundles).stream() + .filter(e -> !"m2e.wrapped.com.google.guava.listenablefuture.source".equals(e.id())).toList(); + // com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava + // doesn't have sources + } + assertTargetBundles(target, expectedBundles); + } +} diff --git a/tycho-core/src/test/java/org/eclipse/m2e/pde/target/tests/OSGiMetadataGenerationTest.java b/tycho-core/src/test/java/org/eclipse/m2e/pde/target/tests/OSGiMetadataGenerationTest.java new file mode 100644 index 0000000000..5377f074c9 --- /dev/null +++ b/tycho-core/src/test/java/org/eclipse/m2e/pde/target/tests/OSGiMetadataGenerationTest.java @@ -0,0 +1,286 @@ +/******************************************************************************* + * Copyright (c) 2023, 2023 Hannes Wellmann and others + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * https://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Hannes Wellmann - initial API and implementation + *******************************************************************************/ +package org.eclipse.m2e.pde.target.tests; + +import static org.eclipse.osgi.util.ManifestElement.parseHeader; +import static org.junit.Assert.assertArrayEquals; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; + +import java.util.Arrays; +import java.util.List; +import java.util.Optional; +import java.util.Set; +import java.util.function.Function; +import java.util.jar.Attributes; + +import org.eclipse.core.runtime.IStatus; +import org.eclipse.osgi.util.ManifestElement; +import org.eclipse.pde.core.target.ITargetLocation; +import org.eclipse.pde.core.target.TargetBundle; +import org.junit.Ignore; +import org.junit.Test; +import org.osgi.framework.BundleException; +import org.osgi.framework.Constants; +import org.osgi.framework.Version; +import org.osgi.framework.VersionRange; + +public class OSGiMetadataGenerationTest extends AbstractMavenTargetTest { + + @Test + @Ignore("FIXME") + public void testNonOSGiArtifact_missingArtifactError() throws Exception { + ITargetLocation target = resolveMavenTarget(""" + + + + com.google.errorprone + error_prone_annotations + 2.18.0 + jar + + + + """); + IStatus targetStatus = target.getStatus(); + assertEquals(String.valueOf(targetStatus), IStatus.ERROR, targetStatus.getSeverity()); + + assertEquals(1, targetStatus.getChildren().length); + String notABundleErrorMessage = "com.google.errorprone:error_prone_annotations:jar:2.18.0 is not a bundle"; + assertEquals(notABundleErrorMessage, targetStatus.getChildren()[0].getMessage()); + + assertArrayEquals(EMPTY, target.getFeatures()); + TargetBundle[] allBundles = target.getBundles(); + assertEquals(1, allBundles.length); + IStatus status = allBundles[0].getStatus(); + assertEquals(IStatus.ERROR, status.getSeverity()); + assertEquals(notABundleErrorMessage, status.getMessage()); + } + + @Test + public void testNonOSGiArtifact_missingArtifactIgnore() throws Exception { + ITargetLocation target = resolveMavenTarget(""" + + + + com.google.errorprone + error_prone_annotations + 2.18.0 + jar + + + + """); + assertStatusOk(target.getStatus()); + assertArrayEquals(EMPTY, target.getFeatures()); + assertArrayEquals(EMPTY, target.getBundles()); + } + + @Test + public void testNonOSGiArtifact_missingArtifactGenerate_defaultInstructions() throws Exception { + ITargetLocation target = resolveMavenTarget(""" + + + + com.google.errorprone + error_prone_annotations + 2.18.0 + jar + + + + """); + assertStatusOk(target.getStatus()); + assertArrayEquals(EMPTY, target.getFeatures()); + ExpectedBundle expectedBundle = generatedBundle("wrapped.com.google.errorprone.error_prone_annotations", + "2.18.0", "com.google.errorprone:error_prone_annotations"); + assertTargetBundles(target, withSourceBundles(List.of(expectedBundle))); + + // Validate generated metadata + Attributes attributes = getManifestMainAttributes(getGeneratedBundle(target)); + assertEquals("wrapped.com.google.errorprone.error_prone_annotations", + attributes.getValue(Constants.BUNDLE_SYMBOLICNAME)); + assertEquals("Bundle derived from maven artifact com.google.errorprone:error_prone_annotations:2.18.0", + attributes.getValue(Constants.BUNDLE_NAME)); + assertEqualManifestHeaders(Constants.IMPORT_PACKAGE, attributes, + "javax.lang.model.element;resolution:=optional"); + assertEqualManifestHeaders(Constants.EXPORT_PACKAGE, attributes, + "com.google.errorprone.annotations;version=\"2.18.0\";uses:=\"javax.lang.model.element\"", + "com.google.errorprone.annotations.concurrent;version=\"2.18.0\""); + assertNull(attributes.getValue(Constants.REQUIRE_BUNDLE)); + assertEquals("*", attributes.getValue(Constants.DYNAMICIMPORT_PACKAGE)); + + Attributes sourceAttributes = getManifestMainAttributes(getGeneratedSourceBundle(target)); + assertEquals("wrapped.com.google.errorprone.error_prone_annotations.source", + sourceAttributes.getValue(Constants.BUNDLE_SYMBOLICNAME)); + assertEquals("Source Bundle for wrapped.com.google.errorprone.error_prone_annotations:2.18.0", + sourceAttributes.getValue(Constants.BUNDLE_NAME)); + assertEqualManifestHeaders("Eclipse-SourceBundle", sourceAttributes, + "wrapped.com.google.errorprone.error_prone_annotations;version=\"2.18.0\";roots:=\".\""); + assertNull(sourceAttributes.getValue(Constants.IMPORT_PACKAGE)); + assertNull(sourceAttributes.getValue(Constants.EXPORT_PACKAGE)); + assertNull(sourceAttributes.getValue(Constants.REQUIRE_BUNDLE)); + assertNull(sourceAttributes.getValue(Constants.DYNAMICIMPORT_PACKAGE)); + } + + @Test + public void testNonOSGiArtifact_missingArtifactGenerate_customInstructions() throws Exception { + ITargetLocation target = resolveMavenTarget( + """ + + + + com.google.errorprone + error_prone_annotations + 2.18.0 + jar + + + + + """); + assertStatusOk(target.getStatus()); + assertArrayEquals(EMPTY, target.getFeatures()); + ExpectedBundle expectedBundle = generatedBundle("m2e.custom.test.wrapped.error_prone_annotations", "2.18.0", + "com.google.errorprone:error_prone_annotations"); + assertTargetBundles(target, withSourceBundles(List.of(expectedBundle))); + + // Validate generated metadata + Attributes attributes = getManifestMainAttributes(getGeneratedBundle(target)); + assertEquals("m2e.custom.test.wrapped.error_prone_annotations", + attributes.getValue(Constants.BUNDLE_SYMBOLICNAME)); + assertEquals("Bundle in Test from artifact com.google.errorprone:error_prone_annotations:2.18.0:", + attributes.getValue(Constants.BUNDLE_NAME)); + assertEqualManifestHeaders(Constants.IMPORT_PACKAGE, attributes, "javax.lang.model.element"); + assertEqualManifestHeaders(Constants.EXPORT_PACKAGE, attributes, + "com.google.errorprone.annotations;version=\"2.18.0\";uses:=\"javax.lang.model.element\"", + "com.google.errorprone.annotations.concurrent;version=\"2.18.0\""); + assertNull(attributes.getValue(Constants.REQUIRE_BUNDLE)); + assertNull(attributes.getValue(Constants.DYNAMICIMPORT_PACKAGE)); + + Attributes sourceAttributes = getManifestMainAttributes(getGeneratedSourceBundle(target)); + assertEquals("m2e.custom.test.wrapped.error_prone_annotations.source", + sourceAttributes.getValue(Constants.BUNDLE_SYMBOLICNAME)); + assertEquals("Source Bundle for m2e.custom.test.wrapped.error_prone_annotations:2.18.0", + sourceAttributes.getValue(Constants.BUNDLE_NAME)); + assertEqualManifestHeaders("Eclipse-SourceBundle", sourceAttributes, + "m2e.custom.test.wrapped.error_prone_annotations;version=\"2.18.0\";roots:=\".\""); + assertNull(sourceAttributes.getValue(Constants.IMPORT_PACKAGE)); + assertNull(sourceAttributes.getValue(Constants.EXPORT_PACKAGE)); + assertNull(sourceAttributes.getValue(Constants.REQUIRE_BUNDLE)); + assertNull(sourceAttributes.getValue(Constants.DYNAMICIMPORT_PACKAGE)); + } + + @Test + public void testNonOSGiArtifact_missingArtifactGenerate_changedCustomInstructions() throws Exception { + String targetXML = """ + + + + com.google.errorprone + error_prone_annotations + 2.18.0 + jar + + + + + """; + ITargetLocation target = resolveMavenTarget(targetXML.formatted("m2e.wrapped.${mvnArtifactId}")); + assertStatusOk(target.getStatus()); + assertArrayEquals(EMPTY, target.getFeatures()); + assertEquals(2, target.getBundles().length); + assertEquals("m2e.wrapped.error_prone_annotations", + getGeneratedBundle(target).getBundleInfo().getSymbolicName()); + assertEquals("m2e.wrapped.error_prone_annotations.source", + getGeneratedSourceBundle(target).getBundleInfo().getSymbolicName()); + + target = resolveMavenTarget(targetXML.formatted("others.wrapped.${mvnArtifactId}")); + assertStatusOk(target.getStatus()); + assertArrayEquals(EMPTY, target.getFeatures()); + assertEquals(2, target.getBundles().length); + assertEquals("others.wrapped.error_prone_annotations", + getGeneratedBundle(target).getBundleInfo().getSymbolicName()); + assertEquals("others.wrapped.error_prone_annotations.source", + getGeneratedSourceBundle(target).getBundleInfo().getSymbolicName()); + } + + @Test + public void testNonOSGiArtifact_missingArtifactGenerate_hasVersions() throws Exception { + ITargetLocation target = resolveMavenTarget( + """ + + + + org.apache.lucene + lucene-analysis-common + 9.5.0 + jar + + + + """); + assertStatusOk(target.getStatus()); + Optional luceneAnalysisCommon = Arrays.stream(target.getBundles()).filter( + tb -> tb.getBundleInfo().getSymbolicName().equals("wrapped.org.apache.lucene.lucene-analysis-common")) + .findFirst(); + assertTrue("lucene-analysis-common bundle not found in target state", luceneAnalysisCommon.isPresent()); + Attributes manifest = getManifestMainAttributes(luceneAnalysisCommon.get()); + ManifestElement[] importHeader = parseHeader(Constants.IMPORT_PACKAGE, + manifest.getValue(Constants.IMPORT_PACKAGE)); + for (ManifestElement element : importHeader) { + String value = element.getValue(); + if (value.startsWith("org.apache.lucene.")) { + String attribute = element.getAttribute(Constants.VERSION_ATTRIBUTE); + assertNotNull("Package " + value + " has no version attribute: " + element, attribute); + VersionRange versionRange = VersionRange.valueOf(attribute); + assertEquals("Unexpected version range " + versionRange + " on package " + value + ": " + element, 0, + versionRange.getLeft().compareTo(Version.valueOf("9.5.0"))); + } + } + } + + private static TargetBundle getGeneratedBundle(ITargetLocation target) { + return Arrays.stream(target.getBundles()).filter(b -> !b.isSourceBundle()).findFirst().orElseThrow(); + } + + private static TargetBundle getGeneratedSourceBundle(ITargetLocation target) { + return Arrays.stream(target.getBundles()).filter(TargetBundle::isSourceBundle).findFirst().orElseThrow(); + } + + private static void assertEqualManifestHeaders(String header, Attributes mainManifestAttributes, + String... expectedHeaderValues) throws BundleException { + ManifestElement[] expected = parseHeader(header, String.join(",", expectedHeaderValues)); + ManifestElement[] actual = parseHeader(header, mainManifestAttributes.getValue(header)); + Function toString = a -> Arrays.stream(a).map(ManifestElement::toString) + .toArray(String[]::new); + assertEquals(Set.of(toString.apply(expected)), Set.of(toString.apply(actual))); // order is irrelevant + } + +} diff --git a/tycho-core/src/test/java/org/eclipse/m2e/pde/target/tests/spi/TargetLocationLoader.java b/tycho-core/src/test/java/org/eclipse/m2e/pde/target/tests/spi/TargetLocationLoader.java new file mode 100644 index 0000000000..63bc27be82 --- /dev/null +++ b/tycho-core/src/test/java/org/eclipse/m2e/pde/target/tests/spi/TargetLocationLoader.java @@ -0,0 +1,54 @@ +/******************************************************************************* + * Copyright (c) 2023 Christoph Läubrich and others + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * https://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Christoph Läubrich - initial API and implementation + *******************************************************************************/ +package org.eclipse.m2e.pde.target.tests.spi; + +import java.io.File; + +import org.eclipse.pde.core.target.ITargetLocation; + +/** + * In cases where we want to reuse the test-cases (specifically Tycho), one can plug in an own + * loader that transform the xml into a suitable location for the tests. + * + */ +public interface TargetLocationLoader extends Comparable { + + static final String MAVEN_LOCATION_TYPE = "Maven"; + + /** + * @return the priority of this loader in case there are multiple ones, the one with the highest + * priority will be chosen for the test + */ + int getPriority(); + + /** + * Resolve the given target xml fragment into a resolved location, the expectation is that: + *
    + *
  • The location is resolved
  • + *
  • The status can be queried and return a result reflecting the outcome of< the + * operation
  • + *
  • getBundles() / getFeatures() return the appropriate items
  • + *
+ * + * @param targetXML + * @return the resolved location + * @throws Exception + */ + ITargetLocation resolveMavenTarget(String targetXML, File tempDir) throws Exception; + + @Override + default int compareTo(TargetLocationLoader o) { + return Integer.compare(o.getPriority(), getPriority()); + } + +} diff --git a/tycho-core/src/test/java/org/eclipse/m2e/pde/target/tests/spi/TychoTargetLocationLoader.java b/tycho-core/src/test/java/org/eclipse/m2e/pde/target/tests/spi/TychoTargetLocationLoader.java new file mode 100644 index 0000000000..378047f603 --- /dev/null +++ b/tycho-core/src/test/java/org/eclipse/m2e/pde/target/tests/spi/TychoTargetLocationLoader.java @@ -0,0 +1,294 @@ +/******************************************************************************* + * Copyright (c) 2023 Christoph Läubrich and others + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * https://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Christoph Läubrich - initial API and implementation + *******************************************************************************/ +package org.eclipse.m2e.pde.target.tests.spi; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.InputStream; +import java.io.OutputStreamWriter; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Date; +import java.util.Iterator; +import java.util.List; +import java.util.Set; +import java.util.jar.JarFile; +import java.util.zip.ZipEntry; + +import org.apache.maven.artifact.Artifact; +import org.apache.maven.artifact.repository.ArtifactRepository; +import org.apache.maven.artifact.repository.LegacyLocalRepositoryManager; +import org.apache.maven.artifact.repository.layout.DefaultRepositoryLayout; +import org.apache.maven.execution.DefaultMavenExecutionRequest; +import org.apache.maven.execution.DefaultMavenExecutionResult; +import org.apache.maven.execution.MavenSession; +import org.apache.maven.plugin.LegacySupport; +import org.apache.maven.plugin.testing.stubs.StubArtifactRepository; +import org.apache.maven.repository.internal.MavenRepositorySystemUtils; +import org.apache.maven.session.scope.internal.SessionScope; +import org.codehaus.plexus.PlexusContainer; +import org.codehaus.plexus.component.repository.exception.ComponentLookupException; +import org.eclipse.aether.RepositorySystemSession; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; +import org.eclipse.equinox.p2.metadata.expression.IExpression; +import org.eclipse.equinox.p2.query.Collector; +import org.eclipse.equinox.p2.query.IQuery; +import org.eclipse.equinox.p2.query.IQueryResult; +import org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor; +import org.eclipse.pde.core.target.ITargetDefinition; +import org.eclipse.pde.core.target.ITargetLocation; +import org.eclipse.pde.core.target.TargetBundle; +import org.eclipse.pde.core.target.TargetFeature; +import org.eclipse.tycho.core.resolver.MavenTargetLocationFactory; +import org.eclipse.tycho.core.resolver.shared.IncludeSourceMode; +import org.eclipse.tycho.core.resolver.target.FileArtifactRepository; +import org.eclipse.tycho.targetplatform.TargetDefinition.Location; +import org.eclipse.tycho.targetplatform.TargetDefinition.MavenGAVLocation; +import org.eclipse.tycho.targetplatform.TargetDefinitionContent; +import org.eclipse.tycho.targetplatform.TargetDefinitionFile; +import org.eclipse.tycho.testing.TychoPlexusTestCase; + +public class TychoTargetLocationLoader implements TargetLocationLoader { + + @Override + public int getPriority() { + // use a higher priority to override m2e provided loader... + return 100; + } + + @Override + public ITargetLocation resolveMavenTarget(String targetXML, File tempDir) throws Exception { + File targetFile = new File(tempDir, "test.target"); + try (OutputStreamWriter writer = new OutputStreamWriter(new FileOutputStream(targetFile), + StandardCharsets.UTF_8)) { + writer.write(""); + writer.write(targetXML); + writer.write(""); + } + PlexusContainer container = new ContainerFactory().createContainer(tempDir); + MavenTargetLocationFactory locationFactory = container.lookup(MavenTargetLocationFactory.class); + TargetDefinitionFile targetDefinition = TargetDefinitionFile.read(targetFile); + for (Location loc : targetDefinition.getLocations()) { + if (loc instanceof MavenGAVLocation gav) { + File locationTempDir = new File(tempDir, "tmp"); + locationTempDir.mkdirs(); + return getLocationOf(gav, locationFactory, locationTempDir.toPath()); + } + } + throw new IllegalArgumentException("Can't extract MavenGAVLocation from " + targetXML); + } + + private ITargetLocation getLocationOf(MavenGAVLocation gav, MavenTargetLocationFactory locationFactory, + Path tmpFir) { + try { + return getLocationOf(locationFactory.resolveTargetDefinitionContent(gav, IncludeSourceMode.honor), tmpFir); + } catch (Exception e) { + return new ITargetLocation() { + + @Override + public T getAdapter(Class adapter) { + return null; + } + + @Override + public String serialize() { + throw new UnsupportedOperationException(); + } + + @Override + public IStatus resolve(ITargetDefinition definition, IProgressMonitor monitor) { + throw new UnsupportedOperationException(); + } + + @Override + public boolean isResolved() { + return true; + } + + @Override + public String[] getVMArguments() { + throw new UnsupportedOperationException(); + } + + @Override + public String getType() { + return MAVEN_LOCATION_TYPE; + } + + @Override + public IStatus getStatus() { + return Status.error("Resolve target location failed: " + e, e); + } + + @Override + public String getLocation(boolean resolve) throws CoreException { + throw new UnsupportedOperationException(); + } + + @Override + public TargetFeature[] getFeatures() { + return new TargetFeature[0]; + } + + @Override + public TargetBundle[] getBundles() { + return new TargetBundle[0]; + } + }; + } + } + + private ITargetLocation getLocationOf(TargetDefinitionContent content, Path tmpFir) throws Exception { + List bundles = new ArrayList<>(); + List features = new ArrayList<>(); + FileArtifactRepository resolvedItems = (FileArtifactRepository) content.getArtifactRepository(); + IQuery query = new IQuery<>() { + + @Override + public IQueryResult perform(Iterator iterator) { + Collector result = new Collector<>(); + while (iterator.hasNext()) { + IArtifactDescriptor candidate = iterator.next(); + if (candidate != null) + if (!result.accept(candidate)) + break; + } + return result; + } + + @Override + public IExpression getExpression() { + return null; + } + }; + Set descriptors = resolvedItems.descriptorQueryable().query(query, null).toSet(); + for (IArtifactDescriptor descriptor : descriptors) { + File artifactFile = resolvedItems.getArtifactFile(descriptor); + if ("osgi.bundle".equals(descriptor.getArtifactKey().getClassifier())) { + bundles.add(new TargetBundle(artifactFile)); + } else if ("org.eclipse.update.feature".equals(descriptor.getArtifactKey().getClassifier())) { + Path feature; + try (JarFile file = new JarFile(artifactFile)) { + Path tempDirectory = Files.createTempDirectory(tmpFir, "extract"); + ZipEntry entry = file.getEntry("feature.xml"); + InputStream stream = file.getInputStream(entry); + feature = tempDirectory.resolve("feature.xml"); + Files.copy(stream, feature); + } + features.add(new TargetFeature(feature.toFile())); + } + } + return new ITargetLocation() { + + @Override + public T getAdapter(Class adapter) { + return null; + } + + @Override + public String serialize() { + throw new UnsupportedOperationException(); + } + + @Override + public IStatus resolve(ITargetDefinition definition, IProgressMonitor monitor) { + throw new UnsupportedOperationException(); + } + + @Override + public boolean isResolved() { + return true; + } + + @Override + public String[] getVMArguments() { + throw new UnsupportedOperationException(); + } + + @Override + public String getType() { + return MAVEN_LOCATION_TYPE; + } + + @Override + public IStatus getStatus() { + return Status.OK_STATUS; + } + + @Override + public String getLocation(boolean resolve) throws CoreException { + throw new UnsupportedOperationException(); + } + + @Override + public TargetFeature[] getFeatures() { + return features.toArray(TargetFeature[]::new); + } + + @Override + public TargetBundle[] getBundles() { + return bundles.toArray(TargetBundle[]::new); + } + }; + } + + private static final class ContainerFactory extends TychoPlexusTestCase { + + private boolean init; + + public PlexusContainer createContainer(File tempDir) throws ComponentLookupException { + PlexusContainer container = super.getContainer(); + if (!init) { + init = true; + LegacySupport legacySupport = lookup(LegacySupport.class); +// Settings settings = new Settings(); + ArtifactRepository localRepository = new StubArtifactRepository( + new File(tempDir, ".m2/repository").getAbsolutePath()) { + DefaultRepositoryLayout layout = new DefaultRepositoryLayout(); + + @Override + public String pathOf(Artifact artifact) { + return layout.pathOf(artifact); + } + }; + DefaultMavenExecutionRequest request = new DefaultMavenExecutionRequest(); + request.setUserProperties(System.getProperties()); + request.setLocalRepository(localRepository); + request.setGoals(List.of()); + request.setBaseDirectory(new File(tempDir, "build")); + request.setStartTime(new Date()); + + RepositorySystemSession repositorySystemSession = LegacyLocalRepositoryManager.overlay(localRepository, + MavenRepositorySystemUtils.newSession(), null); + MavenSession mavenSession = new MavenSession(container, repositorySystemSession, request, + new DefaultMavenExecutionResult()); +// MavenSession mavenSession = new MavenSession(container, settings, localRepository, null, null, +// List.of(), new File(tempDir, "build").getAbsolutePath(), System.getProperties(), +// System.getProperties(), new Date()); + SessionScope sessionScope = container.lookup(SessionScope.class); + mavenSession.setProjects(Collections.emptyList()); + sessionScope.enter(); + sessionScope.seed(MavenSession.class, mavenSession); + legacySupport.setSession(mavenSession); + } + return container; + } + } + +} diff --git a/tycho-core/src/test/java/org/eclipse/tycho/artifacts/configuration/TargetPlatformFilterConfigurationReaderTest.java b/tycho-core/src/test/java/org/eclipse/tycho/artifacts/configuration/TargetPlatformFilterConfigurationReaderTest.java index c986a180ed..16a03a6cde 100644 --- a/tycho-core/src/test/java/org/eclipse/tycho/artifacts/configuration/TargetPlatformFilterConfigurationReaderTest.java +++ b/tycho-core/src/test/java/org/eclipse/tycho/artifacts/configuration/TargetPlatformFilterConfigurationReaderTest.java @@ -12,9 +12,9 @@ *******************************************************************************/ package org.eclipse.tycho.artifacts.configuration; -import static org.eclipse.tycho.artifacts.TargetPlatformFilter.CapabilityPattern.patternWithVersion; -import static org.eclipse.tycho.artifacts.TargetPlatformFilter.CapabilityPattern.patternWithVersionRange; -import static org.eclipse.tycho.artifacts.TargetPlatformFilter.CapabilityPattern.patternWithoutVersion; +import static org.eclipse.tycho.targetplatform.TargetPlatformFilter.CapabilityPattern.patternWithVersion; +import static org.eclipse.tycho.targetplatform.TargetPlatformFilter.CapabilityPattern.patternWithVersionRange; +import static org.eclipse.tycho.targetplatform.TargetPlatformFilter.CapabilityPattern.patternWithoutVersion; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; @@ -33,11 +33,11 @@ import org.apache.maven.project.ProjectBuildingResult; import org.codehaus.plexus.util.xml.Xpp3Dom; import org.eclipse.aether.DefaultRepositorySystemSession; -import org.eclipse.tycho.artifacts.TargetPlatformFilter; -import org.eclipse.tycho.artifacts.TargetPlatformFilter.CapabilityType; -import org.eclipse.tycho.artifacts.TargetPlatformFilter.FilterAction; -import org.eclipse.tycho.artifacts.TargetPlatformFilterSyntaxException; import org.eclipse.tycho.core.test.utils.ResourceUtil; +import org.eclipse.tycho.targetplatform.TargetPlatformFilter; +import org.eclipse.tycho.targetplatform.TargetPlatformFilterSyntaxException; +import org.eclipse.tycho.targetplatform.TargetPlatformFilter.CapabilityType; +import org.eclipse.tycho.targetplatform.TargetPlatformFilter.FilterAction; import org.eclipse.tycho.version.TychoVersion; public class TargetPlatformFilterConfigurationReaderTest extends AbstractMojoTestCase { diff --git a/tycho-core/src/test/java/org/eclipse/tycho/core/ee/CustomExecutionEnvironmentTest.java b/tycho-core/src/test/java/org/eclipse/tycho/core/ee/CustomExecutionEnvironmentTest.java index 1902b2da6b..5aeba3a4fd 100644 --- a/tycho-core/src/test/java/org/eclipse/tycho/core/ee/CustomExecutionEnvironmentTest.java +++ b/tycho-core/src/test/java/org/eclipse/tycho/core/ee/CustomExecutionEnvironmentTest.java @@ -25,8 +25,8 @@ import java.util.List; import org.eclipse.osgi.internal.framework.EquinoxConfiguration; -import org.eclipse.tycho.core.ee.shared.SystemCapability; -import org.eclipse.tycho.core.ee.shared.SystemCapability.Type; +import org.eclipse.tycho.SystemCapability; +import org.eclipse.tycho.SystemCapability.Type; import org.hamcrest.CoreMatchers; import org.junit.Test; import org.osgi.framework.Constants; diff --git a/tycho-core/src/test/java/org/eclipse/tycho/core/ee/ExecutionEnvironmentConfigurationTest.java b/tycho-core/src/test/java/org/eclipse/tycho/core/ee/ExecutionEnvironmentConfigurationTest.java index 955fe17b78..f163099231 100644 --- a/tycho-core/src/test/java/org/eclipse/tycho/core/ee/ExecutionEnvironmentConfigurationTest.java +++ b/tycho-core/src/test/java/org/eclipse/tycho/core/ee/ExecutionEnvironmentConfigurationTest.java @@ -22,8 +22,8 @@ import org.codehaus.plexus.logging.Logger; import org.codehaus.plexus.logging.console.ConsoleLogger; import org.eclipse.tycho.BuildFailureException; -import org.eclipse.tycho.core.ee.shared.ExecutionEnvironmentConfiguration; -import org.eclipse.tycho.core.ee.shared.SystemCapability; +import org.eclipse.tycho.ExecutionEnvironmentConfiguration; +import org.eclipse.tycho.SystemCapability; import org.junit.Before; import org.junit.Test; diff --git a/tycho-core/src/test/java/org/eclipse/tycho/core/ee/ExecutionEnvironmentTest.java b/tycho-core/src/test/java/org/eclipse/tycho/core/ee/ExecutionEnvironmentTest.java index 537fa04f92..ee323331ec 100644 --- a/tycho-core/src/test/java/org/eclipse/tycho/core/ee/ExecutionEnvironmentTest.java +++ b/tycho-core/src/test/java/org/eclipse/tycho/core/ee/ExecutionEnvironmentTest.java @@ -13,9 +13,9 @@ import java.util.Optional; import org.apache.maven.project.MavenProject; +import org.eclipse.tycho.ExecutionEnvironmentConfiguration; import org.eclipse.tycho.ReactorProject; import org.eclipse.tycho.TychoConstants; -import org.eclipse.tycho.core.ee.shared.ExecutionEnvironmentConfiguration; import org.eclipse.tycho.core.osgitools.DefaultReactorProject; import org.eclipse.tycho.testing.AbstractTychoMojoTestCase; diff --git a/tycho-core/src/test/java/org/eclipse/tycho/core/locking/FileLockServiceTest.java b/tycho-core/src/test/java/org/eclipse/tycho/core/locking/FileLockServiceTest.java index 07de078d72..67d8672c32 100644 --- a/tycho-core/src/test/java/org/eclipse/tycho/core/locking/FileLockServiceTest.java +++ b/tycho-core/src/test/java/org/eclipse/tycho/core/locking/FileLockServiceTest.java @@ -22,8 +22,8 @@ import java.io.IOException; import java.util.Random; -import org.eclipse.tycho.locking.facade.FileLocker; -import org.eclipse.tycho.locking.facade.LockTimeoutException; +import org.eclipse.tycho.FileLocker; +import org.eclipse.tycho.LockTimeoutException; import org.junit.Before; import org.junit.Rule; import org.junit.Test; diff --git a/tycho-core/src/test/java/org/eclipse/tycho/core/maven/MavenDependenciesResolverTest.java b/tycho-core/src/test/java/org/eclipse/tycho/core/maven/MavenDependenciesResolverTest.java index aa902f0b3d..a5d11f0d0c 100644 --- a/tycho-core/src/test/java/org/eclipse/tycho/core/maven/MavenDependenciesResolverTest.java +++ b/tycho-core/src/test/java/org/eclipse/tycho/core/maven/MavenDependenciesResolverTest.java @@ -25,8 +25,8 @@ import org.codehaus.plexus.PlexusContainerException; import org.codehaus.plexus.component.repository.exception.ComponentLookupException; import org.eclipse.tycho.MavenArtifactRepositoryReference; -import org.eclipse.tycho.core.shared.DependencyResolutionException; -import org.eclipse.tycho.core.shared.MavenDependenciesResolver; +import org.eclipse.tycho.core.DependencyResolutionException; +import org.eclipse.tycho.core.MavenDependenciesResolver; import org.eclipse.tycho.osgi.configuration.MavenDependenciesResolverConfigurer; import org.junit.Test; diff --git a/tycho-core/src/test/java/org/eclipse/tycho/core/osgitools/EquinoxResolverTest.java b/tycho-core/src/test/java/org/eclipse/tycho/core/osgitools/EquinoxResolverTest.java index eef0ebb2a7..f8f43b9edf 100644 --- a/tycho-core/src/test/java/org/eclipse/tycho/core/osgitools/EquinoxResolverTest.java +++ b/tycho-core/src/test/java/org/eclipse/tycho/core/osgitools/EquinoxResolverTest.java @@ -22,11 +22,11 @@ import org.apache.maven.project.MavenProject; import org.eclipse.osgi.container.Module; import org.eclipse.osgi.container.ModuleContainer; +import org.eclipse.tycho.ExecutionEnvironment; +import org.eclipse.tycho.ExecutionEnvironmentConfiguration; import org.eclipse.tycho.ReactorProject; import org.eclipse.tycho.TychoConstants; import org.eclipse.tycho.core.ee.ExecutionEnvironmentUtils; -import org.eclipse.tycho.core.ee.shared.ExecutionEnvironment; -import org.eclipse.tycho.core.ee.shared.ExecutionEnvironmentConfiguration; import org.eclipse.tycho.core.osgitools.targetplatform.DefaultDependencyArtifacts; import org.eclipse.tycho.testing.AbstractTychoMojoTestCase; import org.eclipse.tycho.version.TychoVersion; diff --git a/tycho-core/src/test/java/org/eclipse/tycho/core/shared/BuildPropertiesImplTest.java b/tycho-core/src/test/java/org/eclipse/tycho/core/shared/BuildPropertiesImplTest.java index 7da9756df2..c80f72dfed 100644 --- a/tycho-core/src/test/java/org/eclipse/tycho/core/shared/BuildPropertiesImplTest.java +++ b/tycho-core/src/test/java/org/eclipse/tycho/core/shared/BuildPropertiesImplTest.java @@ -30,6 +30,7 @@ import java.util.Properties; import java.util.Set; +import org.eclipse.tycho.core.BuildPropertiesImpl; import org.junit.Test; public class BuildPropertiesImplTest { diff --git a/tycho-core/src/test/java/org/eclipse/tycho/core/shared/LRUCacheTest.java b/tycho-core/src/test/java/org/eclipse/tycho/core/shared/LRUCacheTest.java index 7280dd5e84..28e9b249f0 100644 --- a/tycho-core/src/test/java/org/eclipse/tycho/core/shared/LRUCacheTest.java +++ b/tycho-core/src/test/java/org/eclipse/tycho/core/shared/LRUCacheTest.java @@ -17,6 +17,7 @@ import java.util.Map; +import org.eclipse.tycho.core.LRUCache; import org.junit.Test; public class LRUCacheTest { diff --git a/tycho-core/src/test/java/org/eclipse/tycho/core/shared/RepositoryBlackboardKeyTest.java b/tycho-core/src/test/java/org/eclipse/tycho/core/shared/RepositoryBlackboardKeyTest.java index 8ff0044d89..c5954b05e2 100644 --- a/tycho-core/src/test/java/org/eclipse/tycho/core/shared/RepositoryBlackboardKeyTest.java +++ b/tycho-core/src/test/java/org/eclipse/tycho/core/shared/RepositoryBlackboardKeyTest.java @@ -19,7 +19,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; -import org.eclipse.tycho.repository.registry.facade.RepositoryBlackboardKey; +import org.eclipse.tycho.p2.repository.RepositoryBlackboardKey; import org.junit.Test; public class RepositoryBlackboardKeyTest { diff --git a/tycho-core/src/test/java/org/eclipse/tycho/core/test/DependencyComputerTest.java b/tycho-core/src/test/java/org/eclipse/tycho/core/test/DependencyComputerTest.java index c9fd295fa3..6ac357bab1 100644 --- a/tycho-core/src/test/java/org/eclipse/tycho/core/test/DependencyComputerTest.java +++ b/tycho-core/src/test/java/org/eclipse/tycho/core/test/DependencyComputerTest.java @@ -34,15 +34,15 @@ import org.eclipse.osgi.container.ModuleContainer; import org.eclipse.osgi.container.ModuleRevision; import org.eclipse.tycho.ClasspathEntry.AccessRule; +import org.eclipse.tycho.SystemCapability.Type; import org.eclipse.tycho.DependencyArtifacts; +import org.eclipse.tycho.ExecutionEnvironment; +import org.eclipse.tycho.ExecutionEnvironmentConfiguration; import org.eclipse.tycho.ReactorProject; +import org.eclipse.tycho.SystemCapability; import org.eclipse.tycho.TychoConstants; import org.eclipse.tycho.core.ee.CustomExecutionEnvironment; import org.eclipse.tycho.core.ee.ExecutionEnvironmentUtils; -import org.eclipse.tycho.core.ee.shared.ExecutionEnvironment; -import org.eclipse.tycho.core.ee.shared.ExecutionEnvironmentConfiguration; -import org.eclipse.tycho.core.ee.shared.SystemCapability; -import org.eclipse.tycho.core.ee.shared.SystemCapability.Type; import org.eclipse.tycho.core.osgitools.DefaultReactorProject; import org.eclipse.tycho.core.osgitools.DependenciesResolver; import org.eclipse.tycho.core.osgitools.DependencyComputer; diff --git a/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/CompositeArtifactProviderTest.java b/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/CompositeArtifactProviderTest.java index 62a2ad7a25..7fa4888eaf 100644 --- a/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/CompositeArtifactProviderTest.java +++ b/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/CompositeArtifactProviderTest.java @@ -22,7 +22,7 @@ import org.eclipse.equinox.p2.core.IProvisioningAgent; import org.eclipse.equinox.p2.core.ProvisionException; import org.eclipse.equinox.p2.metadata.IArtifactKey; -import org.eclipse.tycho.p2.artifact.provider.IRawArtifactFileProvider; +import org.eclipse.tycho.IRawArtifactFileProvider; import org.eclipse.tycho.p2.repository.ArtifactTransferPolicies; import org.eclipse.tycho.p2.repository.ArtifactTransferPolicy; import org.eclipse.tycho.p2.repository.CompositeArtifactProvider; diff --git a/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/CompositeArtifactProviderTestBase.java b/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/CompositeArtifactProviderTestBase.java index 3c9f8cd29d..a5ea5bec56 100644 --- a/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/CompositeArtifactProviderTestBase.java +++ b/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/CompositeArtifactProviderTestBase.java @@ -50,10 +50,10 @@ import org.eclipse.equinox.p2.metadata.Version; import org.eclipse.equinox.p2.query.IQueryResult; import org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor; -import org.eclipse.tycho.p2.artifact.provider.IRawArtifactProvider; -import org.eclipse.tycho.p2.artifact.provider.streaming.ArtifactSinkFactory; -import org.eclipse.tycho.p2.artifact.provider.streaming.IArtifactSink; -import org.eclipse.tycho.p2.artifact.provider.streaming.IRawArtifactSink; +import org.eclipse.tycho.IArtifactSink; +import org.eclipse.tycho.IRawArtifactProvider; +import org.eclipse.tycho.IRawArtifactSink; +import org.eclipse.tycho.p2.repository.streaming.ArtifactSinkFactory; import org.eclipse.tycho.test.util.NonStartableArtifactSink; import org.eclipse.tycho.test.util.ProbeArtifactSink; import org.eclipse.tycho.test.util.ProbeOutputStream; diff --git a/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/CustomEEResolutionHandlerTest.java b/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/CustomEEResolutionHandlerTest.java index 8fb3c71961..9eb6ab96f8 100644 --- a/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/CustomEEResolutionHandlerTest.java +++ b/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/CustomEEResolutionHandlerTest.java @@ -25,10 +25,10 @@ import java.util.List; import org.eclipse.equinox.p2.core.IProvisioningAgent; -import org.eclipse.tycho.core.ee.shared.ExecutionEnvironment; -import org.eclipse.tycho.core.ee.shared.ExecutionEnvironmentConfiguration; -import org.eclipse.tycho.core.ee.shared.SystemCapability; -import org.eclipse.tycho.core.ee.shared.SystemCapability.Type; +import org.eclipse.tycho.ExecutionEnvironment; +import org.eclipse.tycho.ExecutionEnvironmentConfiguration; +import org.eclipse.tycho.SystemCapability; +import org.eclipse.tycho.SystemCapability.Type; import org.eclipse.tycho.core.resolver.MavenTargetLocationFactory; import org.eclipse.tycho.core.test.utils.ResourceUtil; import org.eclipse.tycho.p2.target.facade.TargetPlatformConfigurationStub; diff --git a/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/DuplicateFilteringLoggingProgressMonitorTest.java b/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/DuplicateFilteringLoggingProgressMonitorTest.java index 9d932a63ed..d7cc403eba 100644 --- a/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/DuplicateFilteringLoggingProgressMonitorTest.java +++ b/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/DuplicateFilteringLoggingProgressMonitorTest.java @@ -3,7 +3,7 @@ import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; -import org.eclipse.tycho.repository.util.DuplicateFilteringLoggingProgressMonitor; +import org.eclipse.tycho.core.shared.DuplicateFilteringLoggingProgressMonitor; import org.junit.Before; import org.junit.Test; diff --git a/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/ExecutionEnvironmentTestUtils.java b/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/ExecutionEnvironmentTestUtils.java index 44caaef67f..8887af1343 100644 --- a/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/ExecutionEnvironmentTestUtils.java +++ b/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/ExecutionEnvironmentTestUtils.java @@ -17,11 +17,11 @@ import org.eclipse.equinox.p2.metadata.IInstallableUnit; import org.eclipse.equinox.p2.metadata.IRequirement; +import org.eclipse.tycho.ExecutionEnvironment; import org.eclipse.tycho.ExecutionEnvironmentResolutionHints; import org.eclipse.tycho.core.ee.impl.CustomEEResolutionHints; import org.eclipse.tycho.core.ee.impl.ExecutionEnvironmentResolutionHandler; import org.eclipse.tycho.core.ee.impl.StandardEEResolutionHints; -import org.eclipse.tycho.core.ee.shared.ExecutionEnvironment; public class ExecutionEnvironmentTestUtils { diff --git a/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/FeatureRootAdviceTest.java b/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/FeatureRootAdviceTest.java index 4df4849674..2631f1fa86 100644 --- a/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/FeatureRootAdviceTest.java +++ b/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/FeatureRootAdviceTest.java @@ -23,7 +23,7 @@ import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.Path; import org.eclipse.equinox.p2.publisher.actions.IFeatureRootAdvice; -import org.eclipse.tycho.core.shared.BuildPropertiesImpl; +import org.eclipse.tycho.core.BuildPropertiesImpl; import org.eclipse.tycho.p2.publisher.rootfiles.FeatureRootAdvice; import org.eclipse.tycho.test.util.ArtifactMock; import org.eclipse.tycho.test.util.BuildPropertiesParserForTesting; diff --git a/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/FeatureRootfileArtifactRepositoryTest.java b/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/FeatureRootfileArtifactRepositoryTest.java index 48131893b0..06a8608ae1 100644 --- a/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/FeatureRootfileArtifactRepositoryTest.java +++ b/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/FeatureRootfileArtifactRepositoryTest.java @@ -24,8 +24,8 @@ import org.eclipse.equinox.p2.repository.artifact.spi.ArtifactDescriptor; import org.eclipse.equinox.spi.p2.publisher.PublisherHelper; import org.eclipse.tycho.BuildProperties; +import org.eclipse.tycho.core.BuildPropertiesImpl; import org.eclipse.tycho.core.publisher.FeatureRootfileArtifactRepository; -import org.eclipse.tycho.core.shared.BuildPropertiesImpl; import org.eclipse.tycho.p2.metadata.IP2Artifact; import org.eclipse.tycho.p2.publisher.rootfiles.FeatureRootAdvice; import org.eclipse.tycho.p2maven.advices.MavenPropertiesAdvice; diff --git a/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/FileRepositoryArtifactProviderTest.java b/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/FileRepositoryArtifactProviderTest.java index 9dc71332ca..978ecea3f4 100644 --- a/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/FileRepositoryArtifactProviderTest.java +++ b/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/FileRepositoryArtifactProviderTest.java @@ -26,7 +26,7 @@ import org.eclipse.equinox.p2.core.IProvisioningAgent; import org.eclipse.equinox.p2.metadata.IArtifactKey; import org.eclipse.equinox.p2.repository.artifact.IArtifactRepository; -import org.eclipse.tycho.p2.artifact.provider.IRawArtifactFileProvider; +import org.eclipse.tycho.IRawArtifactFileProvider; import org.eclipse.tycho.p2.repository.ArtifactRepositorySupplier; import org.eclipse.tycho.p2.repository.ArtifactTransferPolicies; import org.eclipse.tycho.p2.repository.ArtifactTransferPolicy; diff --git a/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/LocalArtifactRepositoryP2APITest.java b/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/LocalArtifactRepositoryP2APITest.java index bc7b6ead46..12233b4d31 100644 --- a/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/LocalArtifactRepositoryP2APITest.java +++ b/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/LocalArtifactRepositoryP2APITest.java @@ -44,11 +44,11 @@ import org.eclipse.equinox.p2.repository.artifact.IProcessingStepDescriptor; import org.eclipse.equinox.p2.repository.artifact.spi.ArtifactDescriptor; import org.eclipse.equinox.p2.repository.artifact.spi.ProcessingStepDescriptor; +import org.eclipse.tycho.ArtifactSinkException; +import org.eclipse.tycho.IArtifactSink; +import org.eclipse.tycho.IRawArtifactFileProvider; +import org.eclipse.tycho.IRawArtifactSink; import org.eclipse.tycho.core.test.utils.ResourceUtil; -import org.eclipse.tycho.p2.artifact.provider.IRawArtifactFileProvider; -import org.eclipse.tycho.p2.artifact.provider.streaming.ArtifactSinkException; -import org.eclipse.tycho.p2.artifact.provider.streaming.IArtifactSink; -import org.eclipse.tycho.p2.artifact.provider.streaming.IRawArtifactSink; import org.eclipse.tycho.p2.repository.ArtifactRepositoryBaseImpl; import org.eclipse.tycho.p2.repository.GAVArtifactDescriptor; import org.eclipse.tycho.p2.repository.LocalArtifactRepository; diff --git a/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/MavenServiceStubbingTestBase.java b/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/MavenServiceStubbingTestBase.java index a091aad2e5..c351fc910a 100644 --- a/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/MavenServiceStubbingTestBase.java +++ b/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/MavenServiceStubbingTestBase.java @@ -18,8 +18,8 @@ import org.eclipse.equinox.p2.core.IProvisioningAgent; import org.eclipse.sisu.equinox.EquinoxServiceFactory; +import org.eclipse.tycho.FileLockService; import org.eclipse.tycho.core.shared.MavenContext; -import org.eclipse.tycho.locking.facade.FileLockService; import org.eclipse.tycho.test.util.LogVerifier; import org.eclipse.tycho.test.util.MockMavenContext; import org.eclipse.tycho.test.util.NoopFileLockService; diff --git a/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/ModuleArtifactRepositoryTest.java b/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/ModuleArtifactRepositoryTest.java index 96abec21d7..db6d10bff5 100644 --- a/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/ModuleArtifactRepositoryTest.java +++ b/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/ModuleArtifactRepositoryTest.java @@ -37,10 +37,10 @@ import org.eclipse.equinox.p2.repository.artifact.IArtifactRepository; import org.eclipse.equinox.p2.repository.artifact.IArtifactRepositoryManager; import org.eclipse.equinox.p2.repository.artifact.spi.ArtifactDescriptor; +import org.eclipse.tycho.IArtifactSink; +import org.eclipse.tycho.WriteSessionContext; import org.eclipse.tycho.core.test.utils.ResourceUtil; -import org.eclipse.tycho.p2.artifact.provider.streaming.IArtifactSink; import org.eclipse.tycho.p2.repository.module.ModuleArtifactRepository; -import org.eclipse.tycho.repository.publishing.WriteSessionContext; import org.eclipse.tycho.testing.TychoPlexusTestCase; import org.junit.BeforeClass; import org.junit.Rule; diff --git a/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/P2ResolverTest.java b/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/P2ResolverTest.java index f2af9c9a1c..e129210cc7 100644 --- a/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/P2ResolverTest.java +++ b/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/P2ResolverTest.java @@ -51,9 +51,9 @@ import org.eclipse.tycho.core.resolver.P2ResolutionResult.Entry; import org.eclipse.tycho.core.resolver.P2Resolver; import org.eclipse.tycho.core.resolver.target.DuplicateReactorIUsException; -import org.eclipse.tycho.core.resolver.target.P2TargetPlatform; import org.eclipse.tycho.p2.metadata.PublisherOptions; import org.eclipse.tycho.p2.publisher.DependencyMetadata; +import org.eclipse.tycho.targetplatform.P2TargetPlatform; import org.eclipse.tycho.test.util.ArtifactMock; import org.eclipse.tycho.test.util.LogVerifier; import org.eclipse.tycho.test.util.MockMavenContext; diff --git a/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/ProviderOnlyArtifactRepositoryTest.java b/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/ProviderOnlyArtifactRepositoryTest.java index 733cbe3b27..4cde741b8a 100644 --- a/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/ProviderOnlyArtifactRepositoryTest.java +++ b/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/ProviderOnlyArtifactRepositoryTest.java @@ -27,7 +27,7 @@ import org.eclipse.core.runtime.IStatus; import org.eclipse.equinox.p2.core.IProvisioningAgent; -import org.eclipse.tycho.p2.artifact.provider.IRawArtifactFileProvider; +import org.eclipse.tycho.IRawArtifactFileProvider; import org.eclipse.tycho.p2.repository.ArtifactTransferPolicies; import org.eclipse.tycho.p2.repository.FileRepositoryArtifactProvider; import org.eclipse.tycho.p2.repository.ProviderOnlyArtifactRepository; diff --git a/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/PublishProductToolTest.java b/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/PublishProductToolTest.java index 35ceecd955..db3e746927 100644 --- a/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/PublishProductToolTest.java +++ b/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/PublishProductToolTest.java @@ -53,12 +53,12 @@ import org.eclipse.tycho.Interpolator; import org.eclipse.tycho.TargetEnvironment; import org.eclipse.tycho.core.resolver.shared.DependencySeed; -import org.eclipse.tycho.core.resolver.target.P2TargetPlatform; +import org.eclipse.tycho.p2.repository.PublishingRepository; import org.eclipse.tycho.p2.repository.module.PublishingRepositoryImpl; import org.eclipse.tycho.p2.tools.publisher.PublishProductToolImpl; import org.eclipse.tycho.p2.tools.publisher.PublisherActionRunner; import org.eclipse.tycho.p2.tools.publisher.facade.PublishProductTool; -import org.eclipse.tycho.repository.publishing.PublishingRepository; +import org.eclipse.tycho.targetplatform.P2TargetPlatform; import org.eclipse.tycho.test.util.LogVerifier; import org.eclipse.tycho.test.util.ReactorProjectIdentitiesStub; import org.eclipse.tycho.testing.TychoPlexusTestCase; diff --git a/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/PublisherServiceTest.java b/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/PublisherServiceTest.java index 5dfe0e8428..1a127c02f7 100644 --- a/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/PublisherServiceTest.java +++ b/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/PublisherServiceTest.java @@ -34,12 +34,12 @@ import org.eclipse.tycho.TargetEnvironment; import org.eclipse.tycho.core.resolver.shared.DependencySeed; import org.eclipse.tycho.p2.repository.ImmutableInMemoryMetadataRepository; +import org.eclipse.tycho.p2.repository.PublishingRepository; import org.eclipse.tycho.p2.repository.module.PublishingRepositoryImpl; import org.eclipse.tycho.p2.tools.FacadeException; import org.eclipse.tycho.p2.tools.publisher.PublisherActionRunner; import org.eclipse.tycho.p2.tools.publisher.PublisherServiceImpl; import org.eclipse.tycho.p2.tools.publisher.facade.PublisherService; -import org.eclipse.tycho.repository.publishing.PublishingRepository; import org.eclipse.tycho.test.util.InstallableUnitUtil; import org.eclipse.tycho.test.util.LogVerifier; import org.eclipse.tycho.test.util.ReactorProjectIdentitiesStub; diff --git a/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/PublishingRepositoryTest.java b/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/PublishingRepositoryTest.java index 8c3e0228bb..4f596ee293 100644 --- a/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/PublishingRepositoryTest.java +++ b/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/PublishingRepositoryTest.java @@ -34,10 +34,10 @@ import org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor; import org.eclipse.equinox.p2.repository.artifact.IArtifactRepository; import org.eclipse.tycho.TychoConstants; +import org.eclipse.tycho.WriteSessionContext; +import org.eclipse.tycho.WriteSessionContext.ClassifierAndExtension; +import org.eclipse.tycho.p2.repository.PublishingRepository; import org.eclipse.tycho.p2.repository.module.PublishingRepositoryImpl; -import org.eclipse.tycho.repository.publishing.PublishingRepository; -import org.eclipse.tycho.repository.publishing.WriteSessionContext; -import org.eclipse.tycho.repository.publishing.WriteSessionContext.ClassifierAndExtension; import org.eclipse.tycho.test.util.ReactorProjectIdentitiesStub; import org.eclipse.tycho.testing.TychoPlexusTestCase; import org.junit.Before; diff --git a/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/ReactorRepositoryManagerTest.java b/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/ReactorRepositoryManagerTest.java index 1d37a479d9..0965998cfa 100644 --- a/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/ReactorRepositoryManagerTest.java +++ b/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/ReactorRepositoryManagerTest.java @@ -26,11 +26,11 @@ import org.eclipse.tycho.ReactorProject; import org.eclipse.tycho.ReactorProjectIdentities; import org.eclipse.tycho.core.ee.shared.ExecutionEnvironmentConfigurationStub; -import org.eclipse.tycho.core.resolver.target.P2TargetPlatform; import org.eclipse.tycho.core.test.utils.ResourceUtil; import org.eclipse.tycho.p2.target.facade.PomDependencyCollector; import org.eclipse.tycho.p2.target.facade.TargetPlatformConfigurationStub; import org.eclipse.tycho.repository.registry.facade.ReactorRepositoryManager; +import org.eclipse.tycho.targetplatform.P2TargetPlatform; import org.eclipse.tycho.test.util.ReactorProjectIdentitiesStub; import org.eclipse.tycho.test.util.ReactorProjectStub; import org.junit.Before; diff --git a/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/RepositoryArtifactProviderTest.java b/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/RepositoryArtifactProviderTest.java index 06eb5b20f5..742d8f4a0a 100644 --- a/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/RepositoryArtifactProviderTest.java +++ b/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/RepositoryArtifactProviderTest.java @@ -47,7 +47,7 @@ import org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor; import org.eclipse.equinox.p2.repository.artifact.IArtifactRepository; import org.eclipse.equinox.p2.repository.artifact.IArtifactRequest; -import org.eclipse.tycho.p2.artifact.provider.IRawArtifactProvider; +import org.eclipse.tycho.IRawArtifactProvider; import org.eclipse.tycho.p2.repository.AbstractArtifactRepository2; import org.eclipse.tycho.p2.repository.ArtifactTransferPolicies; import org.eclipse.tycho.p2.repository.ArtifactTransferPolicy; diff --git a/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/RepositoryReferencesTest.java b/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/RepositoryReferencesTest.java index 54f7936a11..052ca6025e 100644 --- a/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/RepositoryReferencesTest.java +++ b/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/RepositoryReferencesTest.java @@ -18,8 +18,8 @@ import java.net.URI; import java.util.List; +import org.eclipse.tycho.p2.repository.RepositoryBlackboardKey; import org.eclipse.tycho.p2.tools.RepositoryReferences; -import org.eclipse.tycho.repository.registry.facade.RepositoryBlackboardKey; import org.junit.Before; import org.junit.Test; diff --git a/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/StatusToolTest.java b/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/StatusToolTest.java index 34f928b3fc..2d27f54b6f 100644 --- a/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/StatusToolTest.java +++ b/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/StatusToolTest.java @@ -21,7 +21,7 @@ import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.MultiStatus; import org.eclipse.core.runtime.Status; -import org.eclipse.tycho.repository.util.StatusTool; +import org.eclipse.tycho.core.shared.StatusTool; import org.junit.Test; public class StatusToolTest { diff --git a/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/TargetDefinitionFileTest.java b/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/TargetDefinitionFileTest.java index c92e35c658..cf8d55f4ce 100644 --- a/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/TargetDefinitionFileTest.java +++ b/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/TargetDefinitionFileTest.java @@ -21,7 +21,6 @@ import java.io.File; import java.io.IOException; -import java.net.URI; import java.util.List; import org.eclipse.tycho.core.resolver.shared.IncludeSourceMode; @@ -44,7 +43,7 @@ public void testTarget() throws Exception { InstallableUnitLocation location = (InstallableUnitLocation) locations.get(0); assertEquals(1, location.getRepositories().size()); - assertEquals(URI.create("https://download.eclipse.org/eclipse/updates/3.5/"), + assertEquals("https://download.eclipse.org/eclipse/updates/3.5/", location.getRepositories().get(0).getLocation()); assertEquals(1, location.getUnits().size()); assertEquals("org.eclipse.platform.sdk", location.getUnits().get(0).getId()); @@ -53,9 +52,8 @@ public void testTarget() throws Exception { InstallableUnitLocation l02 = (InstallableUnitLocation) locations.get(1); assertEquals(5, l02.getUnits().size()); assertEquals(2, l02.getRepositories().size()); - assertEquals(URI.create("http://subclipse.tigris.org/update_1.6.x/"), - l02.getRepositories().get(0).getLocation()); - assertEquals(URI.create("https://download.eclipse.org/tools/mylyn/update/e3.4/"), + assertEquals("http://subclipse.tigris.org/update_1.6.x/", l02.getRepositories().get(0).getLocation()); + assertEquals("https://download.eclipse.org/tools/mylyn/update/e3.4/", l02.getRepositories().get(1).getLocation()); } diff --git a/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/TargetDefinitionResolverExecutionEnvironmentTest.java b/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/TargetDefinitionResolverExecutionEnvironmentTest.java index f0e30a07aa..583660b1a8 100644 --- a/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/TargetDefinitionResolverExecutionEnvironmentTest.java +++ b/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/TargetDefinitionResolverExecutionEnvironmentTest.java @@ -34,6 +34,7 @@ import org.eclipse.tycho.core.ee.impl.StandardEEResolutionHints; import org.eclipse.tycho.core.ee.shared.ExecutionEnvironmentStub; import org.eclipse.tycho.core.resolver.shared.IncludeSourceMode; +import org.eclipse.tycho.core.shared.MavenContext; import org.eclipse.tycho.p2resolver.TargetDefinitionResolverIncludeModeTest.PlannerLocationStub; import org.eclipse.tycho.p2resolver.TargetDefinitionResolverTest.RepositoryStub; import org.eclipse.tycho.targetplatform.TargetDefinition; @@ -56,10 +57,11 @@ public class TargetDefinitionResolverExecutionEnvironmentTest extends TychoPlexu private TargetDefinitionResolver targetResolverForEE(String executionEnvironmentName, String... systemPackages) throws ProvisionException, IOException { + MavenContext mavenCtx = new MockMavenContext(tempManager.newFolder("localRepo"), logVerifier.getLogger()); return new TargetDefinitionResolver(defaultEnvironments(), new StandardEEResolutionHints(new ExecutionEnvironmentStub(executionEnvironmentName, systemPackages)), - IncludeSourceMode.honor, - new MockMavenContext(tempManager.newFolder("localRepo"), logVerifier.getLogger()), null); + IncludeSourceMode.honor, mavenCtx, null, + new DefaultTargetDefinitionVariableResolver(mavenCtx, logVerifier.getLogger())); } @Test diff --git a/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/TargetDefinitionResolverIncludeModeTest.java b/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/TargetDefinitionResolverIncludeModeTest.java index 8805f335fd..bc29521b99 100644 --- a/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/TargetDefinitionResolverIncludeModeTest.java +++ b/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/TargetDefinitionResolverIncludeModeTest.java @@ -30,13 +30,14 @@ import org.eclipse.equinox.p2.core.IProvisioningAgent; import org.eclipse.equinox.p2.metadata.IVersionedId; import org.eclipse.tycho.core.resolver.shared.IncludeSourceMode; -import org.eclipse.tycho.core.resolver.target.TargetDefinitionContent; +import org.eclipse.tycho.core.shared.MavenContext; import org.eclipse.tycho.p2.resolver.ResolverException; import org.eclipse.tycho.p2resolver.TargetDefinitionResolverTest.LocationStub; import org.eclipse.tycho.p2resolver.TargetDefinitionResolverTest.TestRepositories; import org.eclipse.tycho.targetplatform.TargetDefinition; -import org.eclipse.tycho.targetplatform.TargetDefinitionResolutionException; +import org.eclipse.tycho.targetplatform.TargetDefinitionContent; import org.eclipse.tycho.targetplatform.TargetDefinition.IncludeMode; +import org.eclipse.tycho.targetplatform.TargetDefinitionResolutionException; import org.eclipse.tycho.test.util.LogVerifier; import org.eclipse.tycho.test.util.MockMavenContext; import org.eclipse.tycho.testing.TychoPlexusTestCase; @@ -56,9 +57,10 @@ public class TargetDefinitionResolverIncludeModeTest extends TychoPlexusTestCase @Before public void initSubject() throws Exception { + MavenContext mavenCtx = new MockMavenContext(tempManager.newFolder("localRepo"), logVerifier.getLogger()); subject = new TargetDefinitionResolver(defaultEnvironments(), - ExecutionEnvironmentTestUtils.NOOP_EE_RESOLUTION_HINTS, IncludeSourceMode.honor, - new MockMavenContext(tempManager.newFolder("localRepo"), logVerifier.getLogger()), null); + ExecutionEnvironmentTestUtils.NOOP_EE_RESOLUTION_HINTS, IncludeSourceMode.honor, mavenCtx, null, + new DefaultTargetDefinitionVariableResolver(mavenCtx, logVerifier.getLogger())); } @Test diff --git a/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/TargetDefinitionResolverIncludeSourceTest.java b/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/TargetDefinitionResolverIncludeSourceTest.java index b4e563db31..3f5bb91513 100644 --- a/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/TargetDefinitionResolverIncludeSourceTest.java +++ b/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/TargetDefinitionResolverIncludeSourceTest.java @@ -26,12 +26,13 @@ import org.eclipse.equinox.p2.metadata.VersionedId; import org.eclipse.equinox.p2.query.QueryUtil; import org.eclipse.tycho.core.resolver.shared.IncludeSourceMode; -import org.eclipse.tycho.core.resolver.target.TargetDefinitionContent; +import org.eclipse.tycho.core.shared.MavenContext; import org.eclipse.tycho.p2resolver.TargetDefinitionResolverTest.LocationStub; import org.eclipse.tycho.p2resolver.TargetDefinitionResolverTest.TestRepositories; import org.eclipse.tycho.targetplatform.TargetDefinition; -import org.eclipse.tycho.targetplatform.TargetDefinitionResolutionException; +import org.eclipse.tycho.targetplatform.TargetDefinitionContent; import org.eclipse.tycho.targetplatform.TargetDefinition.IncludeMode; +import org.eclipse.tycho.targetplatform.TargetDefinitionResolutionException; import org.eclipse.tycho.test.util.LogVerifier; import org.eclipse.tycho.test.util.MockMavenContext; import org.eclipse.tycho.testing.TychoPlexusTestCase; @@ -56,9 +57,10 @@ public class TargetDefinitionResolverIncludeSourceTest extends TychoPlexusTestCa @Before public void initSubject() throws Exception { + MavenContext mavenCtx = new MockMavenContext(tempManager.newFolder("localRepo"), logVerifier.getLogger()); subject = new TargetDefinitionResolver(defaultEnvironments(), - ExecutionEnvironmentTestUtils.NOOP_EE_RESOLUTION_HINTS, IncludeSourceMode.honor, - new MockMavenContext(tempManager.newFolder("localRepo"), logVerifier.getLogger()), null); + ExecutionEnvironmentTestUtils.NOOP_EE_RESOLUTION_HINTS, IncludeSourceMode.honor, mavenCtx, null, + new DefaultTargetDefinitionVariableResolver(mavenCtx, logVerifier.getLogger())); } @Test(expected = TargetDefinitionResolutionException.class) 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 10bc92ed3f..16a5ff20c0 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 @@ -37,16 +37,17 @@ import org.eclipse.equinox.p2.query.QueryUtil; import org.eclipse.tycho.TargetEnvironment; import org.eclipse.tycho.core.resolver.shared.IncludeSourceMode; -import org.eclipse.tycho.core.resolver.target.TargetDefinitionContent; +import org.eclipse.tycho.core.shared.MavenContext; import org.eclipse.tycho.core.test.utils.ResourceUtil; import org.eclipse.tycho.targetplatform.TargetDefinition; -import org.eclipse.tycho.targetplatform.TargetDefinitionResolutionException; -import org.eclipse.tycho.targetplatform.TargetDefinitionSyntaxException; +import org.eclipse.tycho.targetplatform.TargetDefinitionContent; import org.eclipse.tycho.targetplatform.TargetDefinition.IncludeMode; import org.eclipse.tycho.targetplatform.TargetDefinition.InstallableUnitLocation; import org.eclipse.tycho.targetplatform.TargetDefinition.Location; import org.eclipse.tycho.targetplatform.TargetDefinition.Repository; import org.eclipse.tycho.targetplatform.TargetDefinition.Unit; +import org.eclipse.tycho.targetplatform.TargetDefinitionResolutionException; +import org.eclipse.tycho.targetplatform.TargetDefinitionSyntaxException; import org.eclipse.tycho.test.util.LogVerifier; import org.eclipse.tycho.test.util.MockMavenContext; import org.eclipse.tycho.testing.TychoPlexusTestCase; @@ -88,9 +89,10 @@ public class TargetDefinitionResolverTest extends TychoPlexusTestCase { @Before public void initContext() throws Exception { + MavenContext mavenCtx = new MockMavenContext(tempManager.newFolder("localRepo"), logVerifier.getLogger()); subject = new TargetDefinitionResolver(defaultEnvironments(), - ExecutionEnvironmentTestUtils.NOOP_EE_RESOLUTION_HINTS, IncludeSourceMode.honor, - new MockMavenContext(tempManager.newFolder("localRepo"), logVerifier.getLogger()), null); + ExecutionEnvironmentTestUtils.NOOP_EE_RESOLUTION_HINTS, IncludeSourceMode.honor, mavenCtx, null, + new DefaultTargetDefinitionVariableResolver(mavenCtx, logVerifier.getLogger())); } static List defaultEnvironments() { @@ -383,12 +385,12 @@ public RepositoryStub(String repository) { } @Override - public URI getLocation() { + public String getLocation() { if (repository != null) { File repo = ResourceUtil.resourceFile(basedir + repository + "/content.xml").getParentFile(); - return repo.toURI(); + return repo.toURI().toString(); } - return URI.create("invalid:hello"); + return URI.create("invalid:hello").toString(); } @Override 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 686bfb2e20..4bad3ba156 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 @@ -30,14 +30,15 @@ import org.eclipse.equinox.p2.metadata.VersionedId; import org.eclipse.tycho.TargetEnvironment; import org.eclipse.tycho.core.resolver.shared.IncludeSourceMode; -import org.eclipse.tycho.core.resolver.target.TargetDefinitionContent; +import org.eclipse.tycho.core.shared.MavenContext; import org.eclipse.tycho.p2resolver.TargetDefinitionResolverTest.RepositoryStub; import org.eclipse.tycho.p2resolver.TargetDefinitionResolverTest.UnitStub; import org.eclipse.tycho.targetplatform.TargetDefinition; -import org.eclipse.tycho.targetplatform.TargetDefinitionResolutionException; +import org.eclipse.tycho.targetplatform.TargetDefinitionContent; import org.eclipse.tycho.targetplatform.TargetDefinition.IncludeMode; import org.eclipse.tycho.targetplatform.TargetDefinition.Repository; import org.eclipse.tycho.targetplatform.TargetDefinition.Unit; +import org.eclipse.tycho.targetplatform.TargetDefinitionResolutionException; import org.eclipse.tycho.test.util.LogVerifier; import org.eclipse.tycho.test.util.MockMavenContext; import org.eclipse.tycho.testing.TychoPlexusTestCase; @@ -152,9 +153,10 @@ public void testConflictingIncludeAllEnvironments() throws Exception { private TargetDefinitionResolver createResolver(List environments) throws ProvisionException, IOException { + MavenContext mavenCtx = new MockMavenContext(tempManager.newFolder("localRepo"), logVerifier.getLogger()); return new TargetDefinitionResolver(environments, ExecutionEnvironmentTestUtils.NOOP_EE_RESOLUTION_HINTS, - IncludeSourceMode.honor, - new MockMavenContext(tempManager.newFolder("localRepo"), logVerifier.getLogger()), null); + IncludeSourceMode.honor, mavenCtx, null, + new DefaultTargetDefinitionVariableResolver(mavenCtx, logVerifier.getLogger())); } private static class FilterRepoLocationStubWithLauncherUnit implements TargetDefinition.InstallableUnitLocation { diff --git a/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/TargetPlatformFactoryTest.java b/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/TargetPlatformFactoryTest.java index 0e2b9d3cf3..41867661a3 100644 --- a/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/TargetPlatformFactoryTest.java +++ b/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/TargetPlatformFactoryTest.java @@ -44,27 +44,27 @@ import org.eclipse.equinox.p2.metadata.IVersionedId; import org.eclipse.tycho.ArtifactType; import org.eclipse.tycho.DefaultArtifactKey; +import org.eclipse.tycho.IRawArtifactFileProvider; import org.eclipse.tycho.IDependencyMetadata.DependencyMetadataType; import org.eclipse.tycho.ReactorProject; import org.eclipse.tycho.ReactorProjectIdentities; import org.eclipse.tycho.TargetEnvironment; -import org.eclipse.tycho.artifacts.TargetPlatformFilter; -import org.eclipse.tycho.artifacts.TargetPlatformFilter.CapabilityPattern; -import org.eclipse.tycho.artifacts.TargetPlatformFilter.CapabilityType; import org.eclipse.tycho.core.ee.shared.ExecutionEnvironmentStub; import org.eclipse.tycho.core.resolver.MavenTargetLocationFactory; import org.eclipse.tycho.core.resolver.target.DuplicateReactorIUsException; -import org.eclipse.tycho.core.resolver.target.P2TargetPlatform; import org.eclipse.tycho.core.test.utils.ResourceUtil; -import org.eclipse.tycho.p2.artifact.provider.IRawArtifactFileProvider; import org.eclipse.tycho.p2.publisher.DependencyMetadata; import org.eclipse.tycho.p2.repository.GAV; import org.eclipse.tycho.p2.repository.LocalMetadataRepository; import org.eclipse.tycho.p2.target.facade.TargetPlatformConfigurationStub; import org.eclipse.tycho.p2resolver.TargetDefinitionResolverTest.TargetDefinitionStub; import org.eclipse.tycho.p2resolver.TargetDefinitionResolverTest.TestRepositories; +import org.eclipse.tycho.targetplatform.P2TargetPlatform; import org.eclipse.tycho.targetplatform.TargetDefinition; import org.eclipse.tycho.targetplatform.TargetDefinitionFile; +import org.eclipse.tycho.targetplatform.TargetPlatformFilter; +import org.eclipse.tycho.targetplatform.TargetPlatformFilter.CapabilityPattern; +import org.eclipse.tycho.targetplatform.TargetPlatformFilter.CapabilityType; import org.eclipse.tycho.test.util.InstallableUnitUtil; import org.eclipse.tycho.test.util.LogVerifier; import org.eclipse.tycho.test.util.ReactorProjectIdentitiesStub; diff --git a/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/TargetPlatformFilterEvaluatorTest.java b/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/TargetPlatformFilterEvaluatorTest.java index d8fdfa6372..8cbe8e7e40 100644 --- a/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/TargetPlatformFilterEvaluatorTest.java +++ b/tycho-core/src/test/java/org/eclipse/tycho/p2resolver/TargetPlatformFilterEvaluatorTest.java @@ -12,11 +12,11 @@ *******************************************************************************/ package org.eclipse.tycho.p2resolver; -import static org.eclipse.tycho.artifacts.TargetPlatformFilter.removeAllFilter; -import static org.eclipse.tycho.artifacts.TargetPlatformFilter.restrictionFilter; -import static org.eclipse.tycho.artifacts.TargetPlatformFilter.CapabilityPattern.patternWithVersion; -import static org.eclipse.tycho.artifacts.TargetPlatformFilter.CapabilityPattern.patternWithVersionRange; -import static org.eclipse.tycho.artifacts.TargetPlatformFilter.CapabilityPattern.patternWithoutVersion; +import static org.eclipse.tycho.targetplatform.TargetPlatformFilter.removeAllFilter; +import static org.eclipse.tycho.targetplatform.TargetPlatformFilter.restrictionFilter; +import static org.eclipse.tycho.targetplatform.TargetPlatformFilter.CapabilityPattern.patternWithVersion; +import static org.eclipse.tycho.targetplatform.TargetPlatformFilter.CapabilityPattern.patternWithVersionRange; +import static org.eclipse.tycho.targetplatform.TargetPlatformFilter.CapabilityPattern.patternWithoutVersion; import static org.hamcrest.CoreMatchers.allOf; import static org.hamcrest.CoreMatchers.containsString; import static org.hamcrest.CoreMatchers.hasItem; @@ -35,12 +35,12 @@ import org.eclipse.equinox.p2.query.QueryUtil; import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository; import org.eclipse.equinox.p2.repository.metadata.IMetadataRepositoryManager; -import org.eclipse.tycho.artifacts.TargetPlatformFilter; -import org.eclipse.tycho.artifacts.TargetPlatformFilter.CapabilityPattern; -import org.eclipse.tycho.artifacts.TargetPlatformFilter.CapabilityType; -import org.eclipse.tycho.artifacts.TargetPlatformFilterSyntaxException; import org.eclipse.tycho.core.resolver.target.TargetPlatformFilterEvaluator; import org.eclipse.tycho.core.test.utils.ResourceUtil; +import org.eclipse.tycho.targetplatform.TargetPlatformFilter; +import org.eclipse.tycho.targetplatform.TargetPlatformFilterSyntaxException; +import org.eclipse.tycho.targetplatform.TargetPlatformFilter.CapabilityPattern; +import org.eclipse.tycho.targetplatform.TargetPlatformFilter.CapabilityType; import org.eclipse.tycho.test.util.LogVerifier; import org.eclipse.tycho.testing.TychoPlexusTestCase; import org.hamcrest.Description; diff --git a/tycho-core/src/test/java/org/eclipse/tycho/test/util/ArtifactRepositoryMatchers.java b/tycho-core/src/test/java/org/eclipse/tycho/test/util/ArtifactRepositoryMatchers.java index 8337e145d9..e12b2f9e4c 100644 --- a/tycho-core/src/test/java/org/eclipse/tycho/test/util/ArtifactRepositoryMatchers.java +++ b/tycho-core/src/test/java/org/eclipse/tycho/test/util/ArtifactRepositoryMatchers.java @@ -13,7 +13,7 @@ package org.eclipse.tycho.test.util; import org.eclipse.equinox.p2.metadata.IArtifactKey; -import org.eclipse.tycho.p2.artifact.provider.IArtifactProvider; +import org.eclipse.tycho.IArtifactProvider; import org.hamcrest.Description; import org.hamcrest.Matcher; import org.hamcrest.TypeSafeMatcher; diff --git a/tycho-core/src/test/java/org/eclipse/tycho/test/util/BuildPropertiesParserForTesting.java b/tycho-core/src/test/java/org/eclipse/tycho/test/util/BuildPropertiesParserForTesting.java index 0b2c11e14e..e78d154270 100644 --- a/tycho-core/src/test/java/org/eclipse/tycho/test/util/BuildPropertiesParserForTesting.java +++ b/tycho-core/src/test/java/org/eclipse/tycho/test/util/BuildPropertiesParserForTesting.java @@ -23,7 +23,7 @@ import org.eclipse.tycho.BuildPropertiesParser; import org.eclipse.tycho.Interpolator; import org.eclipse.tycho.ReactorProject; -import org.eclipse.tycho.core.shared.BuildPropertiesImpl; +import org.eclipse.tycho.core.BuildPropertiesImpl; public class BuildPropertiesParserForTesting implements BuildPropertiesParser { diff --git a/tycho-core/src/test/java/org/eclipse/tycho/test/util/ExecutionEnvironmentTestUtils.java b/tycho-core/src/test/java/org/eclipse/tycho/test/util/ExecutionEnvironmentTestUtils.java index 9ff4f0c243..e26262789a 100644 --- a/tycho-core/src/test/java/org/eclipse/tycho/test/util/ExecutionEnvironmentTestUtils.java +++ b/tycho-core/src/test/java/org/eclipse/tycho/test/util/ExecutionEnvironmentTestUtils.java @@ -17,11 +17,11 @@ import org.eclipse.equinox.p2.metadata.IInstallableUnit; import org.eclipse.equinox.p2.metadata.IRequirement; +import org.eclipse.tycho.ExecutionEnvironment; import org.eclipse.tycho.ExecutionEnvironmentResolutionHints; import org.eclipse.tycho.core.ee.impl.CustomEEResolutionHints; import org.eclipse.tycho.core.ee.impl.ExecutionEnvironmentResolutionHandler; import org.eclipse.tycho.core.ee.impl.StandardEEResolutionHints; -import org.eclipse.tycho.core.ee.shared.ExecutionEnvironment; public class ExecutionEnvironmentTestUtils { diff --git a/tycho-core/src/test/java/org/eclipse/tycho/test/util/MockMavenContext.java b/tycho-core/src/test/java/org/eclipse/tycho/test/util/MockMavenContext.java index a0c314db23..15846197a2 100644 --- a/tycho-core/src/test/java/org/eclipse/tycho/test/util/MockMavenContext.java +++ b/tycho-core/src/test/java/org/eclipse/tycho/test/util/MockMavenContext.java @@ -20,7 +20,7 @@ import org.eclipse.tycho.ArtifactType; import org.eclipse.tycho.MavenRepositoryLocation; import org.eclipse.tycho.PackagingType; -import org.eclipse.tycho.core.shared.MavenContextImpl; +import org.eclipse.tycho.core.MavenContextImpl; import org.eclipse.tycho.core.shared.MavenLogger; import org.eclipse.tycho.osgi.adapters.MavenLoggerAdapter; diff --git a/tycho-core/src/test/java/org/eclipse/tycho/test/util/NonStartableArtifactSink.java b/tycho-core/src/test/java/org/eclipse/tycho/test/util/NonStartableArtifactSink.java index 22518c48d9..cf6cd1732a 100644 --- a/tycho-core/src/test/java/org/eclipse/tycho/test/util/NonStartableArtifactSink.java +++ b/tycho-core/src/test/java/org/eclipse/tycho/test/util/NonStartableArtifactSink.java @@ -21,8 +21,8 @@ import org.eclipse.equinox.p2.metadata.Version; import org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor; import org.eclipse.equinox.p2.repository.artifact.spi.ArtifactDescriptor; -import org.eclipse.tycho.p2.artifact.provider.streaming.ArtifactSinkException; -import org.eclipse.tycho.p2.artifact.provider.streaming.IRawArtifactSink; +import org.eclipse.tycho.ArtifactSinkException; +import org.eclipse.tycho.IRawArtifactSink; public class NonStartableArtifactSink implements IRawArtifactSink { diff --git a/tycho-core/src/test/java/org/eclipse/tycho/test/util/ProbeArtifactSink.java b/tycho-core/src/test/java/org/eclipse/tycho/test/util/ProbeArtifactSink.java index adc31e7397..ccd090077f 100644 --- a/tycho-core/src/test/java/org/eclipse/tycho/test/util/ProbeArtifactSink.java +++ b/tycho-core/src/test/java/org/eclipse/tycho/test/util/ProbeArtifactSink.java @@ -29,7 +29,7 @@ import org.eclipse.core.runtime.IStatus; import org.eclipse.equinox.p2.metadata.IArtifactKey; -import org.eclipse.tycho.p2.artifact.provider.streaming.IArtifactSink; +import org.eclipse.tycho.IArtifactSink; public class ProbeArtifactSink implements IArtifactSink { diff --git a/tycho-core/src/test/java/org/eclipse/tycho/test/util/ProbeRawArtifactSink.java b/tycho-core/src/test/java/org/eclipse/tycho/test/util/ProbeRawArtifactSink.java index 02c5a4c3c6..deed2afb5f 100644 --- a/tycho-core/src/test/java/org/eclipse/tycho/test/util/ProbeRawArtifactSink.java +++ b/tycho-core/src/test/java/org/eclipse/tycho/test/util/ProbeRawArtifactSink.java @@ -15,7 +15,7 @@ import java.io.IOException; import org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor; -import org.eclipse.tycho.p2.artifact.provider.streaming.IRawArtifactSink; +import org.eclipse.tycho.IRawArtifactSink; public class ProbeRawArtifactSink extends ProbeArtifactSink implements IRawArtifactSink { diff --git a/tycho-core/src/test/java/org/eclipse/tycho/test/util/TestResolverFactory.java b/tycho-core/src/test/java/org/eclipse/tycho/test/util/TestResolverFactory.java index 1eee84df7d..79fab67a06 100644 --- a/tycho-core/src/test/java/org/eclipse/tycho/test/util/TestResolverFactory.java +++ b/tycho-core/src/test/java/org/eclipse/tycho/test/util/TestResolverFactory.java @@ -34,6 +34,7 @@ import org.eclipse.tycho.p2.repository.LocalRepositoryP2Indices; import org.eclipse.tycho.p2.repository.LocalRepositoryReader; import org.eclipse.tycho.p2.target.facade.TargetPlatformFactory; +import org.eclipse.tycho.p2resolver.DefaultTargetDefinitionVariableResolver; import org.eclipse.tycho.p2resolver.LocalRepositoryP2IndicesImpl; import org.eclipse.tycho.p2resolver.P2ResolverImpl; import org.eclipse.tycho.p2resolver.PomDependencyCollectorImpl; @@ -61,6 +62,8 @@ public TestResolverFactory(MavenLogger logger, Logger logger2, IProvisioningAgen targetDefinitionResolverService = new TargetDefinitionResolverService(); targetDefinitionResolverService.setMavenContext(mavenContext); targetDefinitionResolverService.setMavenDependenciesResolver(resolve); + targetDefinitionResolverService.setTargetDefinitionVariableResolver( + new DefaultTargetDefinitionVariableResolver(mavenContext, logger2)); File localMavenRepoRoot = mavenContext.getLocalRepositoryRoot(); LocalRepositoryP2Indices localRepoIndices = createLocalRepoIndices(mavenContext); diff --git a/tycho-core/src/test/resources/META-INF/services/org.eclipse.m2e.pde.target.tests.spi.TargetLocationLoader b/tycho-core/src/test/resources/META-INF/services/org.eclipse.m2e.pde.target.tests.spi.TargetLocationLoader new file mode 100644 index 0000000000..d9b7d33d4a --- /dev/null +++ b/tycho-core/src/test/resources/META-INF/services/org.eclipse.m2e.pde.target.tests.spi.TargetLocationLoader @@ -0,0 +1 @@ +org.eclipse.m2e.pde.target.tests.spi.TychoTargetLocationLoader \ No newline at end of file diff --git a/tycho-ds-plugin/pom.xml b/tycho-ds-plugin/pom.xml index 4444bc5330..0c2700664b 100644 --- a/tycho-ds-plugin/pom.xml +++ b/tycho-ds-plugin/pom.xml @@ -7,6 +7,9 @@ tycho-ds-plugin maven-plugin + + ${minimal-maven-version} + Tycho OSGi Declarative Services Plugin A plugin for handling OSGi Declarative Services diff --git a/tycho-extras/pom.xml b/tycho-extras/pom.xml index 9c22e8227c..a985ad14e8 100644 --- a/tycho-extras/pom.xml +++ b/tycho-extras/pom.xml @@ -79,11 +79,6 @@ tycho-p2-facade ${tycho-version}
- - org.eclipse.tycho - org.eclipse.tycho.core.shared - ${tycho-version} - org.eclipse.tycho tycho-testing-harness diff --git a/tycho-extras/target-platform-validation-plugin/pom.xml b/tycho-extras/target-platform-validation-plugin/pom.xml index a0edc04211..6a467db00b 100644 --- a/tycho-extras/target-platform-validation-plugin/pom.xml +++ b/tycho-extras/target-platform-validation-plugin/pom.xml @@ -22,7 +22,9 @@ target-platform-validation-plugin Tycho Target Platform Validation Plugin maven-plugin - + + ${minimal-maven-version} + org.apache.maven.plugin-tools diff --git a/tycho-extras/target-platform-validation-plugin/src/main/java/org/eclipse/tycho/extras/tpvalidator/TPValidationMojo.java b/tycho-extras/target-platform-validation-plugin/src/main/java/org/eclipse/tycho/extras/tpvalidator/TPValidationMojo.java index 4850a142d6..009f10e3e5 100644 --- a/tycho-extras/target-platform-validation-plugin/src/main/java/org/eclipse/tycho/extras/tpvalidator/TPValidationMojo.java +++ b/tycho-extras/target-platform-validation-plugin/src/main/java/org/eclipse/tycho/extras/tpvalidator/TPValidationMojo.java @@ -14,6 +14,7 @@ package org.eclipse.tycho.extras.tpvalidator; import java.io.File; +import java.net.URI; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; @@ -33,18 +34,19 @@ import org.apache.maven.toolchain.ToolchainManager; import org.codehaus.plexus.logging.Logger; import org.eclipse.tycho.ArtifactType; +import org.eclipse.tycho.ExecutionEnvironment; +import org.eclipse.tycho.ExecutionEnvironmentConfiguration; import org.eclipse.tycho.PackagingType; +import org.eclipse.tycho.SystemCapability; import org.eclipse.tycho.TargetEnvironment; import org.eclipse.tycho.core.ee.ExecutionEnvironmentUtils; -import org.eclipse.tycho.core.ee.shared.ExecutionEnvironment; -import org.eclipse.tycho.core.ee.shared.ExecutionEnvironmentConfiguration; -import org.eclipse.tycho.core.ee.shared.SystemCapability; import org.eclipse.tycho.core.resolver.DefaultTargetPlatformConfigurationReader; import org.eclipse.tycho.core.resolver.P2Resolver; import org.eclipse.tycho.core.resolver.P2ResolverFactory; import org.eclipse.tycho.p2.target.facade.TargetPlatformConfigurationStub; import org.eclipse.tycho.p2.tools.RepositoryReferences; import org.eclipse.tycho.p2.tools.director.shared.DirectorRuntime; +import org.eclipse.tycho.p2resolver.TargetDefinitionVariableResolver; import org.eclipse.tycho.targetplatform.TargetDefinition.InstallableUnitLocation; import org.eclipse.tycho.targetplatform.TargetDefinition.Location; import org.eclipse.tycho.targetplatform.TargetDefinition.Repository; @@ -117,6 +119,9 @@ public class TPValidationMojo extends AbstractMojo { @Component private P2ResolverFactory factory; + @Component + private TargetDefinitionVariableResolver varResolver; + public void execute() throws MojoExecutionException { List errors = new ArrayList<>(); @@ -194,8 +199,9 @@ private void validateTarget(File targetFile) throws TPError { for (Location location : targetDefinition.getLocations()) { if (location instanceof InstallableUnitLocation p2Loc) { for (Repository repo : p2Loc.getRepositories()) { - ref.addArtifactRepository(repo.getLocation()); - ref.addMetadataRepository(repo.getLocation()); + URI repoUri = URI.create(varResolver.resolve(repo.getLocation())); + ref.addArtifactRepository(repoUri); + ref.addMetadataRepository(repoUri); } for (Unit unit : p2Loc.getUnits()) { if (checkDependencies) { diff --git a/tycho-extras/tycho-custom-bundle-plugin/pom.xml b/tycho-extras/tycho-custom-bundle-plugin/pom.xml index e35add12fa..4bdbeacf98 100644 --- a/tycho-extras/tycho-custom-bundle-plugin/pom.xml +++ b/tycho-extras/tycho-custom-bundle-plugin/pom.xml @@ -24,7 +24,9 @@ maven-plugin Tycho Custom Bundle Plugin - + + ${minimal-maven-version} + org.apache.maven.plugin-tools @@ -49,10 +51,6 @@ org.eclipse.tycho tycho-core - - org.eclipse.tycho - org.eclipse.tycho.core.shared - diff --git a/tycho-extras/tycho-dependency-tools-plugin/pom.xml b/tycho-extras/tycho-dependency-tools-plugin/pom.xml index 82fb11ae86..6e5f631d78 100644 --- a/tycho-extras/tycho-dependency-tools-plugin/pom.xml +++ b/tycho-extras/tycho-dependency-tools-plugin/pom.xml @@ -39,10 +39,6 @@ org.eclipse.tycho tycho-core - - org.eclipse.tycho - org.eclipse.tycho.core.shared - diff --git a/tycho-extras/tycho-document-bundle-plugin/pom.xml b/tycho-extras/tycho-document-bundle-plugin/pom.xml index 6a7c62bfc4..e53f974c94 100644 --- a/tycho-extras/tycho-document-bundle-plugin/pom.xml +++ b/tycho-extras/tycho-document-bundle-plugin/pom.xml @@ -20,6 +20,9 @@ tycho-document-bundle-plugin maven-plugin Tycho Document Bundle Plugin + + ${minimal-maven-version} + org.apache.maven.plugin-tools @@ -29,10 +32,6 @@ org.apache.maven maven-core - - org.eclipse.tycho - org.eclipse.tycho.core.shared - org.apache.commons commons-exec diff --git a/tycho-extras/tycho-eclipserun-plugin/pom.xml b/tycho-extras/tycho-eclipserun-plugin/pom.xml index 77ecc74958..75d3d5008d 100644 --- a/tycho-extras/tycho-eclipserun-plugin/pom.xml +++ b/tycho-extras/tycho-eclipserun-plugin/pom.xml @@ -20,6 +20,9 @@ tycho-eclipserun-plugin maven-plugin + + ${minimal-maven-version} + Tycho Eclipserun Plugin diff --git a/tycho-extras/tycho-eclipserun-plugin/src/main/java/org/eclipse/tycho/extras/eclipserun/EclipseRunMojo.java b/tycho-extras/tycho-eclipserun-plugin/src/main/java/org/eclipse/tycho/extras/eclipserun/EclipseRunMojo.java index de67b44fe6..ac3d619b63 100644 --- a/tycho-extras/tycho-eclipserun-plugin/src/main/java/org/eclipse/tycho/extras/eclipserun/EclipseRunMojo.java +++ b/tycho-extras/tycho-eclipserun-plugin/src/main/java/org/eclipse/tycho/extras/eclipserun/EclipseRunMojo.java @@ -45,12 +45,12 @@ import org.eclipse.sisu.equinox.launching.LaunchConfiguration; import org.eclipse.sisu.equinox.launching.internal.EquinoxLaunchConfiguration; import org.eclipse.tycho.ArtifactType; +import org.eclipse.tycho.ExecutionEnvironmentConfiguration; import org.eclipse.tycho.IllegalArtifactReferenceException; import org.eclipse.tycho.MavenRepositoryLocation; import org.eclipse.tycho.TargetEnvironment; import org.eclipse.tycho.TargetPlatform; import org.eclipse.tycho.core.ee.ExecutionEnvironmentConfigurationImpl; -import org.eclipse.tycho.core.ee.shared.ExecutionEnvironmentConfiguration; import org.eclipse.tycho.core.maven.ToolchainProvider; import org.eclipse.tycho.core.resolver.P2ResolutionResult; import org.eclipse.tycho.core.resolver.P2ResolutionResult.Entry; diff --git a/tycho-extras/tycho-eclipserun-plugin/src/test/java/org/eclipse/tycho/extras/eclipserun/EclipseRunMojoTest.java b/tycho-extras/tycho-eclipserun-plugin/src/test/java/org/eclipse/tycho/extras/eclipserun/EclipseRunMojoTest.java index f0e91a5084..5880c7433d 100644 --- a/tycho-extras/tycho-eclipserun-plugin/src/test/java/org/eclipse/tycho/extras/eclipserun/EclipseRunMojoTest.java +++ b/tycho-extras/tycho-eclipserun-plugin/src/test/java/org/eclipse/tycho/extras/eclipserun/EclipseRunMojoTest.java @@ -30,8 +30,8 @@ import org.eclipse.sisu.equinox.launching.EquinoxInstallation; import org.eclipse.sisu.equinox.launching.EquinoxLauncher; import org.eclipse.sisu.equinox.launching.LaunchConfiguration; +import org.eclipse.tycho.ExecutionEnvironmentConfiguration; import org.eclipse.tycho.TargetPlatform; -import org.eclipse.tycho.core.ee.shared.ExecutionEnvironmentConfiguration; import org.eclipse.tycho.core.maven.ToolchainProvider; import org.eclipse.tycho.core.resolver.P2Resolver; import org.eclipse.tycho.core.resolver.P2ResolverFactory; diff --git a/tycho-extras/tycho-p2-extras-plugin/pom.xml b/tycho-extras/tycho-p2-extras-plugin/pom.xml index 8d4aabaa20..01c4ad4ccf 100644 --- a/tycho-extras/tycho-p2-extras-plugin/pom.xml +++ b/tycho-extras/tycho-p2-extras-plugin/pom.xml @@ -23,7 +23,9 @@ maven-plugin Tycho p2 Extras Plugin - + + ${minimal-maven-version} + ${project.version} diff --git a/tycho-extras/tycho-p2-extras-plugin/src/main/java/org/eclipse/tycho/plugins/p2/extras/CompareWithBaselineMojo.java b/tycho-extras/tycho-p2-extras-plugin/src/main/java/org/eclipse/tycho/plugins/p2/extras/CompareWithBaselineMojo.java index e23a0cfc86..605fc5b651 100644 --- a/tycho-extras/tycho-p2-extras-plugin/src/main/java/org/eclipse/tycho/plugins/p2/extras/CompareWithBaselineMojo.java +++ b/tycho-extras/tycho-p2-extras-plugin/src/main/java/org/eclipse/tycho/plugins/p2/extras/CompareWithBaselineMojo.java @@ -31,6 +31,7 @@ import org.codehaus.plexus.logging.Logger; import org.eclipse.equinox.p2.metadata.IInstallableUnit; import org.eclipse.tycho.IDependencyMetadata.DependencyMetadataType; +import org.eclipse.tycho.ExecutionEnvironmentConfiguration; import org.eclipse.tycho.ReactorProject; import org.eclipse.tycho.TargetEnvironment; import org.eclipse.tycho.TargetPlatform; @@ -38,7 +39,6 @@ import org.eclipse.tycho.artifactcomparator.ArtifactComparator.ComparisonData; import org.eclipse.tycho.artifactcomparator.ArtifactDelta; import org.eclipse.tycho.core.TychoProjectManager; -import org.eclipse.tycho.core.ee.shared.ExecutionEnvironmentConfiguration; import org.eclipse.tycho.core.exceptions.VersionBumpRequiredException; import org.eclipse.tycho.core.osgitools.DefaultReactorProject; import org.eclipse.tycho.core.resolver.P2ResolutionResult; diff --git a/tycho-extras/tycho-version-bump-plugin/pom.xml b/tycho-extras/tycho-version-bump-plugin/pom.xml index ef79561e87..60a8d37114 100644 --- a/tycho-extras/tycho-version-bump-plugin/pom.xml +++ b/tycho-extras/tycho-version-bump-plugin/pom.xml @@ -22,7 +22,9 @@ tycho-version-bump-plugin maven-plugin - + + ${minimal-maven-version} + Tycho Version Bump Plugin @@ -34,10 +36,6 @@ org.apache.maven maven-core - - org.eclipse.tycho - org.eclipse.tycho.core.shared - org.eclipse.tycho tycho-core 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 afd9e99021..3d1a1f1557 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 @@ -13,10 +13,13 @@ *******************************************************************************/ package org.eclipse.tycho.versionbump; +import static java.util.stream.Collectors.toList; + import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; +import java.net.URI; import java.net.URISyntaxException; import java.util.Collections; import java.util.HashMap; @@ -25,14 +28,15 @@ import javax.xml.parsers.ParserConfigurationException; +import org.apache.maven.plugins.annotations.Component; import org.apache.maven.plugins.annotations.Mojo; import org.apache.maven.plugins.annotations.Parameter; import org.eclipse.tycho.TargetEnvironment; 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.IncludeMode; import org.eclipse.tycho.targetplatform.TargetDefinition.InstallableUnitLocation; -import org.eclipse.tycho.targetplatform.TargetDefinition.Repository; import org.eclipse.tycho.targetplatform.TargetDefinition.Unit; import org.eclipse.tycho.targetplatform.TargetDefinitionFile; import org.w3c.dom.Document; @@ -49,6 +53,9 @@ public class UpdateTargetMojo extends AbstractUpdateMojo { @Parameter(property = "target") private File targetFile; + @Component + private TargetDefinitionVariableResolver varResolver; + @Override protected void doUpdate() throws IOException, URISyntaxException, ParserConfigurationException, SAXException { @@ -57,7 +64,7 @@ protected void doUpdate() throws IOException, URISyntaxException, ParserConfigur target = TargetDefinitionFile.parseDocument(input); TargetDefinitionFile parsedTarget = TargetDefinitionFile.parse(target, targetFile.getAbsolutePath()); resolutionContext.setEnvironments(Collections.singletonList(TargetEnvironment.getRunningEnvironment())); - resolutionContext.addTargetDefinition(new LatestVersionTarget(parsedTarget)); + resolutionContext.addTargetDefinition(new LatestVersionTarget(parsedTarget, varResolver)); P2ResolutionResult result = p2.getTargetPlatformAsResolutionResult(resolutionContext, executionEnvironment); Map ius = new HashMap<>(); @@ -90,16 +97,18 @@ protected File getFileToBeUpdated() { private static final class LatestVersionTarget implements TargetDefinition { private TargetDefinitionFile delegate; + private TargetDefinitionVariableResolver varResolver; - public LatestVersionTarget(TargetDefinitionFile delegate) { + public LatestVersionTarget(TargetDefinitionFile delegate, TargetDefinitionVariableResolver varResolver) { this.delegate = delegate; + this.varResolver = varResolver; } @Override public List getLocations() { return delegate.getLocations().stream().map(location -> { if (location instanceof InstallableUnitLocation iuLocation) { - return new LatestVersionLocation(iuLocation); + return new LatestVersionLocation(iuLocation, varResolver); } else { return location; } @@ -126,14 +135,19 @@ public String getTargetEE() { private static final class LatestVersionLocation implements InstallableUnitLocation { private InstallableUnitLocation delegate; + private TargetDefinitionVariableResolver varResolver; - public LatestVersionLocation(InstallableUnitLocation delegate) { + public LatestVersionLocation(InstallableUnitLocation delegate, TargetDefinitionVariableResolver varResolver) { this.delegate = delegate; + this.varResolver = varResolver; } @Override - public List getRepositories() { - return delegate.getRepositories(); + public List getRepositories() { + return delegate.getRepositories().stream().map(repo -> { + URI resolvedLocation = URI.create(varResolver.resolve(repo.getLocation())); + return new ResolvedRepository(repo.getId(), resolvedLocation.toString()); + }).collect(toList()); } @Override @@ -178,4 +192,26 @@ public String getVersion() { } + private static final class ResolvedRepository implements TargetDefinition.Repository { + + private final String id; + private final String uri; + + ResolvedRepository(String id, String uri) { + this.id = id; + this.uri = uri; + } + + @Override + public String getId() { + return id; + } + + @Override + public String getLocation() { + return uri; + } + + } + } diff --git a/tycho-gpg-plugin/pom.xml b/tycho-gpg-plugin/pom.xml index 6925277443..c070f8c867 100644 --- a/tycho-gpg-plugin/pom.xml +++ b/tycho-gpg-plugin/pom.xml @@ -21,7 +21,9 @@ Tycho GPG plugin A plugin to produce GPG signatures for p2 artifacts - + + ${minimal-maven-version} + org.apache.maven diff --git a/tycho-its/projects/target.variables/env/pom.xml b/tycho-its/projects/target.variables/env/pom.xml new file mode 100644 index 0000000000..e1c0165ccb --- /dev/null +++ b/tycho-its/projects/target.variables/env/pom.xml @@ -0,0 +1,59 @@ + + 4.0.0 + tycho-its-project.variables.env + aggregator + 1.0.0 + pom + + + UTF-8 + + + + + + org.eclipse.tycho + tycho-maven-plugin + ${tycho-version} + true + + + org.eclipse.tycho + target-platform-configuration + ${tycho-version} + + p2 + consider + JavaSE-11 + + + tycho-its-project.variables.env + targetplatform + 1.0.0 + + + + + win32 + win32 + x86_64 + + + linux + gtk + x86_64 + + + + + + + + + targetplatform + project + + + diff --git a/tycho-its/projects/target.variables/env/project/META-INF/MANIFEST.MF b/tycho-its/projects/target.variables/env/project/META-INF/MANIFEST.MF new file mode 100644 index 0000000000..14ac1927fc --- /dev/null +++ b/tycho-its/projects/target.variables/env/project/META-INF/MANIFEST.MF @@ -0,0 +1,7 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-SymbolicName: project +Bundle-Version: 1.0.0 +Automatic-Module-Name: project +Bundle-RequiredExecutionEnvironment: JavaSE-11 +Require-Bundle: javax.xml diff --git a/tycho-its/projects/target.variables/env/project/build.properties b/tycho-its/projects/target.variables/env/project/build.properties new file mode 100644 index 0000000000..e676b583e2 --- /dev/null +++ b/tycho-its/projects/target.variables/env/project/build.properties @@ -0,0 +1,2 @@ +source.. = src/ +bin.includes = META-INF/,. diff --git a/tycho-its/projects/target.variables/env/project/pom.xml b/tycho-its/projects/target.variables/env/project/pom.xml new file mode 100644 index 0000000000..53e619e00b --- /dev/null +++ b/tycho-its/projects/target.variables/env/project/pom.xml @@ -0,0 +1,15 @@ + + 4.0.0 + project + 1.0.0 + eclipse-plugin + + tycho-its-project.variables.env + aggregator + 1.0.0 + + + \ No newline at end of file diff --git a/tycho-its/projects/target.variables/env/targetplatform/pom.xml b/tycho-its/projects/target.variables/env/targetplatform/pom.xml new file mode 100644 index 0000000000..ce84ea8f98 --- /dev/null +++ b/tycho-its/projects/target.variables/env/targetplatform/pom.xml @@ -0,0 +1,34 @@ + + 4.0.0 + targetplatform + eclipse-target-definition + + tycho-its-project.variables.env + aggregator + 1.0.0 + + + + + + org.eclipse.tycho.extras + target-platform-validation-plugin + ${tycho-version} + + + + validate-target-platform + + + true + true + + + + + + + \ No newline at end of file diff --git a/tycho-its/projects/target.variables/env/targetplatform/targetplatform.target b/tycho-its/projects/target.variables/env/targetplatform/targetplatform.target new file mode 100644 index 0000000000..67ec2f856f --- /dev/null +++ b/tycho-its/projects/target.variables/env/targetplatform/targetplatform.target @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/tycho-its/projects/target.variables/sysprop/pom.xml b/tycho-its/projects/target.variables/sysprop/pom.xml new file mode 100644 index 0000000000..d06f2b79d5 --- /dev/null +++ b/tycho-its/projects/target.variables/sysprop/pom.xml @@ -0,0 +1,59 @@ + + 4.0.0 + tycho-its-project.variables.sysprop + aggregator + 1.0.0 + pom + + + UTF-8 + + + + + + org.eclipse.tycho + tycho-maven-plugin + ${tycho-version} + true + + + org.eclipse.tycho + target-platform-configuration + ${tycho-version} + + p2 + consider + JavaSE-11 + + + tycho-its-project.variables.sysprop + targetplatform + 1.0.0 + + + + + win32 + win32 + x86_64 + + + linux + gtk + x86_64 + + + + + + + + + targetplatform + project + + + diff --git a/tycho-its/projects/target.variables/sysprop/project/META-INF/MANIFEST.MF b/tycho-its/projects/target.variables/sysprop/project/META-INF/MANIFEST.MF new file mode 100644 index 0000000000..14ac1927fc --- /dev/null +++ b/tycho-its/projects/target.variables/sysprop/project/META-INF/MANIFEST.MF @@ -0,0 +1,7 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-SymbolicName: project +Bundle-Version: 1.0.0 +Automatic-Module-Name: project +Bundle-RequiredExecutionEnvironment: JavaSE-11 +Require-Bundle: javax.xml diff --git a/tycho-its/projects/target.variables/sysprop/project/build.properties b/tycho-its/projects/target.variables/sysprop/project/build.properties new file mode 100644 index 0000000000..e676b583e2 --- /dev/null +++ b/tycho-its/projects/target.variables/sysprop/project/build.properties @@ -0,0 +1,2 @@ +source.. = src/ +bin.includes = META-INF/,. diff --git a/tycho-its/projects/target.variables/sysprop/project/pom.xml b/tycho-its/projects/target.variables/sysprop/project/pom.xml new file mode 100644 index 0000000000..c07fa9f753 --- /dev/null +++ b/tycho-its/projects/target.variables/sysprop/project/pom.xml @@ -0,0 +1,15 @@ + + 4.0.0 + project + 1.0.0 + eclipse-plugin + + tycho-its-project.variables.sysprop + aggregator + 1.0.0 + + + \ No newline at end of file diff --git a/tycho-its/projects/target.variables/sysprop/targetplatform/pom.xml b/tycho-its/projects/target.variables/sysprop/targetplatform/pom.xml new file mode 100644 index 0000000000..538d31f3e9 --- /dev/null +++ b/tycho-its/projects/target.variables/sysprop/targetplatform/pom.xml @@ -0,0 +1,34 @@ + + 4.0.0 + targetplatform + eclipse-target-definition + + tycho-its-project.variables.sysprop + aggregator + 1.0.0 + + + + + + org.eclipse.tycho.extras + target-platform-validation-plugin + ${tycho-version} + + + + validate-target-platform + + + true + true + + + + + + + \ No newline at end of file diff --git a/tycho-its/projects/target.variables/sysprop/targetplatform/targetplatform.target b/tycho-its/projects/target.variables/sysprop/targetplatform/targetplatform.target new file mode 100644 index 0000000000..c802356861 --- /dev/null +++ b/tycho-its/projects/target.variables/sysprop/targetplatform/targetplatform.target @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/tycho-its/projects/TychoVersionsPluginTest/compat/META-INF/MANIFEST.MF b/tycho-its/projects/tycho-version-plugin/set-version/compat/META-INF/MANIFEST.MF similarity index 100% rename from tycho-its/projects/TychoVersionsPluginTest/compat/META-INF/MANIFEST.MF rename to tycho-its/projects/tycho-version-plugin/set-version/compat/META-INF/MANIFEST.MF diff --git a/tycho-its/projects/TychoVersionsPluginTest/compat/pom.xml b/tycho-its/projects/tycho-version-plugin/set-version/compat/pom.xml similarity index 100% rename from tycho-its/projects/TychoVersionsPluginTest/compat/pom.xml rename to tycho-its/projects/tycho-version-plugin/set-version/compat/pom.xml diff --git a/tycho-its/projects/TychoVersionsPluginTest/update-target/including/including.target b/tycho-its/projects/tycho-version-plugin/set-version/update-target/including/including.target similarity index 100% rename from tycho-its/projects/TychoVersionsPluginTest/update-target/including/including.target rename to tycho-its/projects/tycho-version-plugin/set-version/update-target/including/including.target diff --git a/tycho-its/projects/TychoVersionsPluginTest/update-target/including/pom.xml b/tycho-its/projects/tycho-version-plugin/set-version/update-target/including/pom.xml similarity index 100% rename from tycho-its/projects/TychoVersionsPluginTest/update-target/including/pom.xml rename to tycho-its/projects/tycho-version-plugin/set-version/update-target/including/pom.xml diff --git a/tycho-its/projects/TychoVersionsPluginTest/update-target/other/other.target b/tycho-its/projects/tycho-version-plugin/set-version/update-target/other/other.target similarity index 100% rename from tycho-its/projects/TychoVersionsPluginTest/update-target/other/other.target rename to tycho-its/projects/tycho-version-plugin/set-version/update-target/other/other.target diff --git a/tycho-its/projects/TychoVersionsPluginTest/update-target/other/pom.xml b/tycho-its/projects/tycho-version-plugin/set-version/update-target/other/pom.xml similarity index 100% rename from tycho-its/projects/TychoVersionsPluginTest/update-target/other/pom.xml rename to tycho-its/projects/tycho-version-plugin/set-version/update-target/other/pom.xml diff --git a/tycho-its/projects/TychoVersionsPluginTest/update-target/pom.xml b/tycho-its/projects/tycho-version-plugin/set-version/update-target/pom.xml similarity index 100% rename from tycho-its/projects/TychoVersionsPluginTest/update-target/pom.xml rename to tycho-its/projects/tycho-version-plugin/set-version/update-target/pom.xml diff --git a/tycho-its/projects/tycho-version-plugin/update-pom/modularPom/aggregate/pom.xml b/tycho-its/projects/tycho-version-plugin/update-pom/modularPom/aggregate/pom.xml new file mode 100644 index 0000000000..8dcdfd1e64 --- /dev/null +++ b/tycho-its/projects/tycho-version-plugin/update-pom/modularPom/aggregate/pom.xml @@ -0,0 +1,17 @@ + + + 4.0.0 + + tycho-it + tycho-version.update-pom.mudule + 1.0.0 + pom + + + ../defaultPomNameA + ../defaultPomNameB/pom.xml + ../customPomName/customPomName.xml + ../deepNest/a/b/deepNest.xml + + diff --git a/tycho-its/projects/tycho-version-plugin/update-pom/modularPom/customPomName/META-INF/MANIFEST.MF b/tycho-its/projects/tycho-version-plugin/update-pom/modularPom/customPomName/META-INF/MANIFEST.MF new file mode 100644 index 0000000000..b037917b15 --- /dev/null +++ b/tycho-its/projects/tycho-version-plugin/update-pom/modularPom/customPomName/META-INF/MANIFEST.MF @@ -0,0 +1,5 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Test Bundle +Bundle-SymbolicName: customPomName +Bundle-Version: 2.0.0 diff --git a/tycho-its/projects/tycho-version-plugin/update-pom/modularPom/customPomName/customPomName.xml b/tycho-its/projects/tycho-version-plugin/update-pom/modularPom/customPomName/customPomName.xml new file mode 100644 index 0000000000..22fc3df6c0 --- /dev/null +++ b/tycho-its/projects/tycho-version-plugin/update-pom/modularPom/customPomName/customPomName.xml @@ -0,0 +1,22 @@ + + + 4.0.0 + + tycho-it + tycho-version.update-pom.customPomName + 1.0.0 + eclipse-plugin + + + + + + org.eclipse.tycho + tycho-maven-plugin + ${tycho-version} + true + + + + diff --git a/tycho-its/projects/tycho-version-plugin/update-pom/modularPom/deepNest/a/b/META-INF/MANIFEST.MF b/tycho-its/projects/tycho-version-plugin/update-pom/modularPom/deepNest/a/b/META-INF/MANIFEST.MF new file mode 100644 index 0000000000..fc936785bd --- /dev/null +++ b/tycho-its/projects/tycho-version-plugin/update-pom/modularPom/deepNest/a/b/META-INF/MANIFEST.MF @@ -0,0 +1,5 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Test Bundle +Bundle-SymbolicName: deepNest +Bundle-Version: 2.0.0 diff --git a/tycho-its/projects/tycho-version-plugin/update-pom/modularPom/deepNest/a/b/deepNest.xml b/tycho-its/projects/tycho-version-plugin/update-pom/modularPom/deepNest/a/b/deepNest.xml new file mode 100644 index 0000000000..9e65945ddd --- /dev/null +++ b/tycho-its/projects/tycho-version-plugin/update-pom/modularPom/deepNest/a/b/deepNest.xml @@ -0,0 +1,22 @@ + + + 4.0.0 + + tycho-it + tycho-version.update-pom.deepNest + 1.0.0 + eclipse-plugin + + + + + + org.eclipse.tycho + tycho-maven-plugin + ${tycho-version} + true + + + + diff --git a/tycho-its/projects/tycho-version-plugin/update-pom/modularPom/defaultPomNameA/META-INF/MANIFEST.MF b/tycho-its/projects/tycho-version-plugin/update-pom/modularPom/defaultPomNameA/META-INF/MANIFEST.MF new file mode 100644 index 0000000000..f6fa3ac7aa --- /dev/null +++ b/tycho-its/projects/tycho-version-plugin/update-pom/modularPom/defaultPomNameA/META-INF/MANIFEST.MF @@ -0,0 +1,5 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Test Bundle +Bundle-SymbolicName: defaultPomNameA +Bundle-Version: 2.0.0 diff --git a/tycho-its/projects/tycho-version-plugin/update-pom/modularPom/defaultPomNameA/pom.xml b/tycho-its/projects/tycho-version-plugin/update-pom/modularPom/defaultPomNameA/pom.xml new file mode 100644 index 0000000000..3fb9507f4b --- /dev/null +++ b/tycho-its/projects/tycho-version-plugin/update-pom/modularPom/defaultPomNameA/pom.xml @@ -0,0 +1,22 @@ + + + 4.0.0 + + tycho-it + tycho-version.update-pom.defaultPomNameA + 1.0.0 + eclipse-plugin + + + + + + org.eclipse.tycho + tycho-maven-plugin + ${tycho-version} + true + + + + diff --git a/tycho-its/projects/tycho-version-plugin/update-pom/modularPom/defaultPomNameB/META-INF/MANIFEST.MF b/tycho-its/projects/tycho-version-plugin/update-pom/modularPom/defaultPomNameB/META-INF/MANIFEST.MF new file mode 100644 index 0000000000..9551117f50 --- /dev/null +++ b/tycho-its/projects/tycho-version-plugin/update-pom/modularPom/defaultPomNameB/META-INF/MANIFEST.MF @@ -0,0 +1,5 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Test Bundle +Bundle-SymbolicName: defaultPomNameB +Bundle-Version: 2.0.0 diff --git a/tycho-its/projects/tycho-version-plugin/update-pom/modularPom/defaultPomNameB/pom.xml b/tycho-its/projects/tycho-version-plugin/update-pom/modularPom/defaultPomNameB/pom.xml new file mode 100644 index 0000000000..f8f20d96f5 --- /dev/null +++ b/tycho-its/projects/tycho-version-plugin/update-pom/modularPom/defaultPomNameB/pom.xml @@ -0,0 +1,22 @@ + + + 4.0.0 + + tycho-it + tycho-version.update-pom.defaultPomNameB + 1.0.0 + eclipse-plugin + + + + + + org.eclipse.tycho + tycho-maven-plugin + ${tycho-version} + true + + + + diff --git a/tycho-its/projects/tycho-version-plugin/update-pom/pomNamedPomXml/META-INF/MANIFEST.MF b/tycho-its/projects/tycho-version-plugin/update-pom/pomNamedPomXml/META-INF/MANIFEST.MF new file mode 100644 index 0000000000..71b9f75d70 --- /dev/null +++ b/tycho-its/projects/tycho-version-plugin/update-pom/pomNamedPomXml/META-INF/MANIFEST.MF @@ -0,0 +1,5 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Test Bundle +Bundle-SymbolicName: test.artifact +Bundle-Version: 2.0.0 diff --git a/tycho-its/projects/tycho-version-plugin/update-pom/pomNamedPomXml/pom.xml b/tycho-its/projects/tycho-version-plugin/update-pom/pomNamedPomXml/pom.xml new file mode 100644 index 0000000000..8be50f0ebb --- /dev/null +++ b/tycho-its/projects/tycho-version-plugin/update-pom/pomNamedPomXml/pom.xml @@ -0,0 +1,23 @@ + + + 4.0.0 + + tycho-it + tycho-version.update-pom.pomNamedPomXml + 1.0.0 + eclipse-plugin + + + + + + + org.eclipse.tycho + tycho-maven-plugin + ${tycho-version} + true + + + + diff --git a/tycho-its/projects/tycho-version-plugin/update-pom/pomNotNamedPomXml/META-INF/MANIFEST.MF b/tycho-its/projects/tycho-version-plugin/update-pom/pomNotNamedPomXml/META-INF/MANIFEST.MF new file mode 100644 index 0000000000..71b9f75d70 --- /dev/null +++ b/tycho-its/projects/tycho-version-plugin/update-pom/pomNotNamedPomXml/META-INF/MANIFEST.MF @@ -0,0 +1,5 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Test Bundle +Bundle-SymbolicName: test.artifact +Bundle-Version: 2.0.0 diff --git a/tycho-its/projects/tycho-version-plugin/update-pom/pomNotNamedPomXml/foo.bar.pom.xml b/tycho-its/projects/tycho-version-plugin/update-pom/pomNotNamedPomXml/foo.bar.pom.xml new file mode 100644 index 0000000000..a684b353ea --- /dev/null +++ b/tycho-its/projects/tycho-version-plugin/update-pom/pomNotNamedPomXml/foo.bar.pom.xml @@ -0,0 +1,22 @@ + + + 4.0.0 + + tycho-it + tycho-version.update-pom.pomNotNamedPomXml + 1.0.0 + eclipse-plugin + + + + + + org.eclipse.tycho + tycho-maven-plugin + ${tycho-version} + true + + + + diff --git a/tycho-its/src/test/java/org/eclipse/tycho/test/pomDependencyConsider/LocalMavenRepositoryTool.java b/tycho-its/src/test/java/org/eclipse/tycho/test/pomDependencyConsider/LocalMavenRepositoryTool.java index abddb7dcae..5e1be22158 100644 --- a/tycho-its/src/test/java/org/eclipse/tycho/test/pomDependencyConsider/LocalMavenRepositoryTool.java +++ b/tycho-its/src/test/java/org/eclipse/tycho/test/pomDependencyConsider/LocalMavenRepositoryTool.java @@ -26,8 +26,8 @@ import java.util.LinkedHashSet; import java.util.Set; -import org.eclipse.tycho.locking.facade.FileLockService; -import org.eclipse.tycho.locking.facade.FileLocker; +import org.eclipse.tycho.FileLockService; +import org.eclipse.tycho.FileLocker; import org.eclipse.tycho.test.util.EnvironmentUtil; public class LocalMavenRepositoryTool { diff --git a/tycho-its/src/test/java/org/eclipse/tycho/test/target/TargetVariableResolutionTest.java b/tycho-its/src/test/java/org/eclipse/tycho/test/target/TargetVariableResolutionTest.java new file mode 100644 index 0000000000..2fa42955c1 --- /dev/null +++ b/tycho-its/src/test/java/org/eclipse/tycho/test/target/TargetVariableResolutionTest.java @@ -0,0 +1,61 @@ +/******************************************************************************* + * Copyright (c) 2023 Vaclav Hala and others. + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * Contributors: + * Vaclav Hala - initial API and implementation + * + *******************************************************************************/ +package org.eclipse.tycho.test.target; + +import java.util.Arrays; + +import org.apache.maven.it.Verifier; +import org.eclipse.tycho.test.AbstractTychoIntegrationTest; +import org.eclipse.tycho.test.util.HttpServer; +import org.eclipse.tycho.test.util.ResourceUtil; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +public class TargetVariableResolutionTest extends AbstractTychoIntegrationTest { + private HttpServer server; + private String baseurl; + + @Before + public void startServer() throws Exception { + server = HttpServer.startServer(); + server.addServer("repo", ResourceUtil.resolveTestResource("repositories/javax.xml")); + var urlWithContextPath = server.getUrl(""); + baseurl = urlWithContextPath.endsWith("/") // double slash causes trouble in RepositoryTransport.download + ? urlWithContextPath.substring(0, urlWithContextPath.length() - 1) + : urlWithContextPath; + } + + @After + public void stopServer() throws Exception { + server.stop(); + } + + @Test + public void repositoryUrlCanContainEnvVarVariable() throws Exception { + Verifier verifier = getVerifier("target.variables/env", false); + verifier.setEnvironmentVariable("MY_MIRROR", baseurl); + verifier.executeGoals(Arrays.asList("package")); + verifier.verifyErrorFreeLog(); + verifier.verifyTextInLog("validate-target-platform"); + } + + @Test + public void repositoryUrlCanContainSystemPropertyVariable() throws Exception { + Verifier verifier = getVerifier("target.variables/sysprop", false); + verifier.setSystemProperty("myMirror", baseurl); + verifier.executeGoals(Arrays.asList("package")); + verifier.verifyErrorFreeLog(); + verifier.verifyTextInLog("validate-target-platform"); + } +} diff --git a/tycho-its/src/test/java/org/eclipse/tycho/test/versionsplugin/TychoVersionsPluginTest.java b/tycho-its/src/test/java/org/eclipse/tycho/test/versionsplugin/TychoVersionsPluginTest.java index ed1fe6753e..dee0dc6097 100644 --- a/tycho-its/src/test/java/org/eclipse/tycho/test/versionsplugin/TychoVersionsPluginTest.java +++ b/tycho-its/src/test/java/org/eclipse/tycho/test/versionsplugin/TychoVersionsPluginTest.java @@ -18,6 +18,7 @@ import java.io.File; import java.io.FileReader; import java.nio.file.Files; +import java.nio.file.Path; import org.apache.maven.it.Verifier; import org.apache.maven.model.Model; @@ -28,6 +29,8 @@ public class TychoVersionsPluginTest extends AbstractTychoIntegrationTest { + private final String VERSION = TychoVersion.getTychoVersion(); + /** *

* This test verifies that current and future versions of the @@ -49,11 +52,10 @@ public class TychoVersionsPluginTest extends AbstractTychoIntegrationTest { public void invokeVersionsPluginOnTycho0120Project() throws Exception { String expectedNewVersion = "1.2.3"; - Verifier verifier = getVerifier("TychoVersionsPluginTest/compat", true); + Verifier verifier = getVerifier("tycho-version-plugin/set-version/compat", true); verifier.addCliOption("-DnewVersion=" + expectedNewVersion); - verifier.executeGoal( - "org.eclipse.tycho:tycho-versions-plugin:" + TychoVersion.getTychoVersion() + ":set-version"); + verifier.executeGoal("org.eclipse.tycho:tycho-versions-plugin:" + VERSION + ":set-version"); verifier.verifyErrorFreeLog(); @@ -66,11 +68,10 @@ public void invokeVersionsPluginOnTycho0120Project() throws Exception { public void updateTargetVersionTest() throws Exception { String expectedNewVersion = "1.2.3"; - Verifier verifier = getVerifier("TychoVersionsPluginTest/update-target", true); + Verifier verifier = getVerifier("tycho-version-plugin/set-version/update-target", true); verifier.addCliOption("-DnewVersion=" + expectedNewVersion); - verifier.executeGoal( - "org.eclipse.tycho:tycho-versions-plugin:" + TychoVersion.getTychoVersion() + ":set-version"); + verifier.executeGoal("org.eclipse.tycho:tycho-versions-plugin:" + VERSION + ":set-version"); verifier.verifyErrorFreeLog(); String targetContent = Files.readString(new File(verifier.getBasedir(), "including/including.target").toPath()); @@ -79,4 +80,115 @@ public void updateTargetVersionTest() throws Exception { && targetContent.contains("sequenceNumber=\"12\"")); } + /** + * Verifies that the update-pom goal of the tycho-version plug-in updates the + * version of a pom when the pom file is implicit. The command line for this + * would be + *

+ * mvn org.eclipse.tycho:tycho-versions-plugin:update-pom + *

+ * This was created in response to + * issue 309. + */ + @Test + public void testUpdatePomWithImplicitPomName() throws Exception { + String POM_NAME = "pom.xml"; + String MANIFEST_VERSION = "2.0.0"; + + Verifier verifier = getVerifier("tycho-version-plugin/update-pom/pomNamedPomXml", false); + verifier.executeGoal("org.eclipse.tycho:tycho-versions-plugin:%s:update-pom".formatted(VERSION)); + verifier.verifyErrorFreeLog(); + MavenXpp3Reader pomReader = new MavenXpp3Reader(); + Model pomModel = pomReader.read(new FileReader(new File(verifier.getBasedir(), POM_NAME))); + assertEquals(" in pom.xml has not been changed!", MANIFEST_VERSION, pomModel.getVersion()); + } + + /** + * Verifies that the update-pom goal of the tycho-version plug-in updates the + * version of a pom that is named 'pom.xml'. The command line for this would be + *

+ * mvn -f pom.xml org.eclipse.tycho:tycho-versions-plugin:update-pom + *

+ * This was created in response to + * issue 309. + */ + @Test + public void testUpdatePomOfPomThatIsNamedPomXml() throws Exception { + String POM_NAME = "pom.xml"; + String MANIFEST_VERSION = "2.0.0"; + + Verifier verifier = getVerifier("tycho-version-plugin/update-pom/pomNamedPomXml", false); + verifier.addCliOption("--file " + POM_NAME); + verifier.executeGoal("org.eclipse.tycho:tycho-versions-plugin:%s:update-pom".formatted(VERSION)); + verifier.verifyErrorFreeLog(); + MavenXpp3Reader pomReader = new MavenXpp3Reader(); + Model pomModel = pomReader.read(new FileReader(new File(verifier.getBasedir(), POM_NAME))); + assertEquals(" in pom.xml has not been changed!", MANIFEST_VERSION, pomModel.getVersion()); + } + + /** + * Verifies that the update-pom goal of the tycho-version plug-in updates the + * version of a pom that is NOT named 'pom.xml'. The command line for this would + * be + *

+ * mvn -f foo.bar.pom.xml org.eclipse.tycho:tycho-versions-plugin:update-pom + *

+ * This was created in response to + * issue 309. + */ + @Test + public void testUpdatePomOfPomThatIsNotNamedPomXml() throws Exception { + String POM_NAME = "foo.bar.pom.xml"; + String MANIFEST_VERSION = "2.0.0"; + + Verifier verifier = getVerifier("tycho-version-plugin/update-pom/pomNotNamedPomXml", false); + verifier.addCliOption("--file " + POM_NAME); + verifier.executeGoal("org.eclipse.tycho:tycho-versions-plugin:%s:update-pom".formatted(VERSION)); + verifier.verifyErrorFreeLog(); + MavenXpp3Reader pomReader = new MavenXpp3Reader(); + Model pomModel = pomReader.read(new FileReader(new File(verifier.getBasedir(), POM_NAME))); + assertEquals(" in foo.bar.pom.xml has not been changed!", MANIFEST_VERSION, pomModel.getVersion()); + } + + /** + * Verifies that the update-pom goal of the tycho-version plug-in updates the + * version of poms references in a modular pom. It tests modules with the + * implicit name, an explicit default name and a custom name. The command line + * for this would be + *

+ * mvn -f aggregate org.eclipse.tycho:tycho-versions-plugin:update-pom + *

+ * This was created in response to + * issue 309. + */ + @Test + public void testUpdatePomsOfModularPom() throws Exception { + String POM_NAME = "aggregate"; + String MANIFEST_VERSION = "2.0.0"; + + Verifier verifier = getVerifier("tycho-version-plugin/update-pom/modularPom", false); + verifier.addCliOption("--file " + POM_NAME); + verifier.executeGoal("org.eclipse.tycho:tycho-versions-plugin:%s:update-pom".formatted(VERSION)); + verifier.verifyErrorFreeLog(); + MavenXpp3Reader pomReader = new MavenXpp3Reader(); + Model pomImplicit = pomReader.read(new FileReader(file(verifier, "defaultPomNameA", "pom.xml"))); + Model pomDefault = pomReader.read(new FileReader(file(verifier, "defaultPomNameB", "pom.xml"))); + Model pomCustom = pomReader.read(new FileReader(file(verifier, "customPomName", "customPomName.xml"))); + Model pomDeepNest = pomReader.read(new FileReader(file(verifier, "deepNest", "a", "b", "deepNest.xml"))); + + assertEquals(" in defaultPomNameA/pom.xml has not been changed!", MANIFEST_VERSION, + pomImplicit.getVersion()); + assertEquals(" in defaultPomNameB/pom.xml has not been changed!", MANIFEST_VERSION, + pomDefault.getVersion()); + assertEquals(" in customPomName/customPomName.xml has not been changed!", MANIFEST_VERSION, + pomCustom.getVersion()); + assertEquals(" in deepNest/a/b/deepNest.xml has not been changed!", MANIFEST_VERSION, + pomDeepNest.getVersion()); + + } + + public static File file(Verifier verifier, String... path) { + return Path.of(verifier.getBasedir(), path).toFile(); + } + } diff --git a/tycho-maven-plugin/pom.xml b/tycho-maven-plugin/pom.xml index 32654288c6..9d175828a8 100644 --- a/tycho-maven-plugin/pom.xml +++ b/tycho-maven-plugin/pom.xml @@ -22,7 +22,9 @@ tycho-maven-plugin maven-plugin - + + ${minimal-maven-version} + Tycho Maven Build Extension The Tycho Maven Plugin provides extensions to build Eclipse projects. diff --git a/tycho-p2/tycho-p2-director-plugin/.gitignore b/tycho-p2-director-plugin/.gitignore similarity index 100% rename from tycho-p2/tycho-p2-director-plugin/.gitignore rename to tycho-p2-director-plugin/.gitignore diff --git a/tycho-p2/tycho-p2-director-plugin/.settings/org.eclipse.jdt.core.prefs b/tycho-p2-director-plugin/.settings/org.eclipse.jdt.core.prefs similarity index 100% rename from tycho-p2/tycho-p2-director-plugin/.settings/org.eclipse.jdt.core.prefs rename to tycho-p2-director-plugin/.settings/org.eclipse.jdt.core.prefs diff --git a/tycho-p2/tycho-p2-director-plugin/.settings/org.eclipse.jdt.ui.prefs b/tycho-p2-director-plugin/.settings/org.eclipse.jdt.ui.prefs similarity index 100% rename from tycho-p2/tycho-p2-director-plugin/.settings/org.eclipse.jdt.ui.prefs rename to tycho-p2-director-plugin/.settings/org.eclipse.jdt.ui.prefs diff --git a/tycho-p2/tycho-p2-director-plugin/pom.xml b/tycho-p2-director-plugin/pom.xml similarity index 96% rename from tycho-p2/tycho-p2-director-plugin/pom.xml rename to tycho-p2-director-plugin/pom.xml index 2223f8b362..a78e80a360 100644 --- a/tycho-p2/tycho-p2-director-plugin/pom.xml +++ b/tycho-p2-director-plugin/pom.xml @@ -16,13 +16,15 @@ org.eclipse.tycho - tycho-p2 + tycho 4.0.0-SNAPSHOT tycho-p2-director-plugin maven-plugin - + + ${minimal-maven-version} + Tycho p2 Director Plugin diff --git a/tycho-p2/tycho-p2-director-plugin/src/main/java/org/eclipse/tycho/plugins/p2/director/AbstractProductMojo.java b/tycho-p2-director-plugin/src/main/java/org/eclipse/tycho/plugins/p2/director/AbstractProductMojo.java similarity index 100% rename from tycho-p2/tycho-p2-director-plugin/src/main/java/org/eclipse/tycho/plugins/p2/director/AbstractProductMojo.java rename to tycho-p2-director-plugin/src/main/java/org/eclipse/tycho/plugins/p2/director/AbstractProductMojo.java diff --git a/tycho-p2/tycho-p2-director-plugin/src/main/java/org/eclipse/tycho/plugins/p2/director/DirectorMojo.java b/tycho-p2-director-plugin/src/main/java/org/eclipse/tycho/plugins/p2/director/DirectorMojo.java similarity index 100% rename from tycho-p2/tycho-p2-director-plugin/src/main/java/org/eclipse/tycho/plugins/p2/director/DirectorMojo.java rename to tycho-p2-director-plugin/src/main/java/org/eclipse/tycho/plugins/p2/director/DirectorMojo.java diff --git a/tycho-p2/tycho-p2-director-plugin/src/main/java/org/eclipse/tycho/plugins/p2/director/Product.java b/tycho-p2-director-plugin/src/main/java/org/eclipse/tycho/plugins/p2/director/Product.java similarity index 100% rename from tycho-p2/tycho-p2-director-plugin/src/main/java/org/eclipse/tycho/plugins/p2/director/Product.java rename to tycho-p2-director-plugin/src/main/java/org/eclipse/tycho/plugins/p2/director/Product.java diff --git a/tycho-p2/tycho-p2-director-plugin/src/main/java/org/eclipse/tycho/plugins/p2/director/ProductArchiverMojo.java b/tycho-p2-director-plugin/src/main/java/org/eclipse/tycho/plugins/p2/director/ProductArchiverMojo.java similarity index 100% rename from tycho-p2/tycho-p2-director-plugin/src/main/java/org/eclipse/tycho/plugins/p2/director/ProductArchiverMojo.java rename to tycho-p2-director-plugin/src/main/java/org/eclipse/tycho/plugins/p2/director/ProductArchiverMojo.java diff --git a/tycho-p2/tycho-p2-director-plugin/src/main/java/org/eclipse/tycho/plugins/p2/director/ProductConfig.java b/tycho-p2-director-plugin/src/main/java/org/eclipse/tycho/plugins/p2/director/ProductConfig.java similarity index 100% rename from tycho-p2/tycho-p2-director-plugin/src/main/java/org/eclipse/tycho/plugins/p2/director/ProductConfig.java rename to tycho-p2-director-plugin/src/main/java/org/eclipse/tycho/plugins/p2/director/ProductConfig.java diff --git a/tycho-p2/tycho-p2-director-plugin/src/main/java/org/eclipse/tycho/plugins/p2/director/ProfileName.java b/tycho-p2-director-plugin/src/main/java/org/eclipse/tycho/plugins/p2/director/ProfileName.java similarity index 100% rename from tycho-p2/tycho-p2-director-plugin/src/main/java/org/eclipse/tycho/plugins/p2/director/ProfileName.java rename to tycho-p2-director-plugin/src/main/java/org/eclipse/tycho/plugins/p2/director/ProfileName.java diff --git a/tycho-p2/tycho-p2-director-plugin/src/main/java/org/eclipse/tycho/plugins/p2/director/runtime/StandaloneDirectorRuntime.java b/tycho-p2-director-plugin/src/main/java/org/eclipse/tycho/plugins/p2/director/runtime/StandaloneDirectorRuntime.java similarity index 100% rename from tycho-p2/tycho-p2-director-plugin/src/main/java/org/eclipse/tycho/plugins/p2/director/runtime/StandaloneDirectorRuntime.java rename to tycho-p2-director-plugin/src/main/java/org/eclipse/tycho/plugins/p2/director/runtime/StandaloneDirectorRuntime.java diff --git a/tycho-p2/tycho-p2-director-plugin/src/main/java/org/eclipse/tycho/plugins/p2/director/runtime/StandaloneDirectorRuntimeFactory.java b/tycho-p2-director-plugin/src/main/java/org/eclipse/tycho/plugins/p2/director/runtime/StandaloneDirectorRuntimeFactory.java similarity index 100% rename from tycho-p2/tycho-p2-director-plugin/src/main/java/org/eclipse/tycho/plugins/p2/director/runtime/StandaloneDirectorRuntimeFactory.java rename to tycho-p2-director-plugin/src/main/java/org/eclipse/tycho/plugins/p2/director/runtime/StandaloneDirectorRuntimeFactory.java diff --git a/tycho-p2/tycho-p2-director-plugin/src/main/java/org/eclipse/tycho/plugins/tar/FilePermissionHelper.java b/tycho-p2-director-plugin/src/main/java/org/eclipse/tycho/plugins/tar/FilePermissionHelper.java similarity index 100% rename from tycho-p2/tycho-p2-director-plugin/src/main/java/org/eclipse/tycho/plugins/tar/FilePermissionHelper.java rename to tycho-p2-director-plugin/src/main/java/org/eclipse/tycho/plugins/tar/FilePermissionHelper.java diff --git a/tycho-p2/tycho-p2-director-plugin/src/main/java/org/eclipse/tycho/plugins/tar/TarGzArchiver.java b/tycho-p2-director-plugin/src/main/java/org/eclipse/tycho/plugins/tar/TarGzArchiver.java similarity index 100% rename from tycho-p2/tycho-p2-director-plugin/src/main/java/org/eclipse/tycho/plugins/tar/TarGzArchiver.java rename to tycho-p2-director-plugin/src/main/java/org/eclipse/tycho/plugins/tar/TarGzArchiver.java diff --git a/tycho-p2/tycho-p2-director-plugin/src/main/resources/META-INF/m2e/lifecycle-mapping-metadata.xml b/tycho-p2-director-plugin/src/main/resources/META-INF/m2e/lifecycle-mapping-metadata.xml similarity index 100% rename from tycho-p2/tycho-p2-director-plugin/src/main/resources/META-INF/m2e/lifecycle-mapping-metadata.xml rename to tycho-p2-director-plugin/src/main/resources/META-INF/m2e/lifecycle-mapping-metadata.xml diff --git a/tycho-p2/tycho-p2-director-plugin/src/main/resources/about.html b/tycho-p2-director-plugin/src/main/resources/about.html similarity index 100% rename from tycho-p2/tycho-p2-director-plugin/src/main/resources/about.html rename to tycho-p2-director-plugin/src/main/resources/about.html diff --git a/tycho-p2/tycho-p2-director-plugin/src/main/resources/asl-v20.txt b/tycho-p2-director-plugin/src/main/resources/asl-v20.txt similarity index 100% rename from tycho-p2/tycho-p2-director-plugin/src/main/resources/asl-v20.txt rename to tycho-p2-director-plugin/src/main/resources/asl-v20.txt diff --git a/tycho-p2/tycho-p2-director-plugin/src/test/java/org/eclipse/tycho/plugins/p2/director/ProductArchiverMojoTest.java b/tycho-p2-director-plugin/src/test/java/org/eclipse/tycho/plugins/p2/director/ProductArchiverMojoTest.java similarity index 100% rename from tycho-p2/tycho-p2-director-plugin/src/test/java/org/eclipse/tycho/plugins/p2/director/ProductArchiverMojoTest.java rename to tycho-p2-director-plugin/src/test/java/org/eclipse/tycho/plugins/p2/director/ProductArchiverMojoTest.java diff --git a/tycho-p2/tycho-p2-director-plugin/src/test/java/org/eclipse/tycho/plugins/p2/director/ProductConfigTest.java b/tycho-p2-director-plugin/src/test/java/org/eclipse/tycho/plugins/p2/director/ProductConfigTest.java similarity index 100% rename from tycho-p2/tycho-p2-director-plugin/src/test/java/org/eclipse/tycho/plugins/p2/director/ProductConfigTest.java rename to tycho-p2-director-plugin/src/test/java/org/eclipse/tycho/plugins/p2/director/ProductConfigTest.java diff --git a/tycho-p2/tycho-p2-director-plugin/src/test/java/org/eclipse/tycho/plugins/p2/director/ProfileNameTest.java b/tycho-p2-director-plugin/src/test/java/org/eclipse/tycho/plugins/p2/director/ProfileNameTest.java similarity index 100% rename from tycho-p2/tycho-p2-director-plugin/src/test/java/org/eclipse/tycho/plugins/p2/director/ProfileNameTest.java rename to tycho-p2-director-plugin/src/test/java/org/eclipse/tycho/plugins/p2/director/ProfileNameTest.java diff --git a/tycho-p2/tycho-p2-director-plugin/src/test/java/org/eclipse/tycho/plugins/tar/FilePermissionHelperTest.java b/tycho-p2-director-plugin/src/test/java/org/eclipse/tycho/plugins/tar/FilePermissionHelperTest.java similarity index 100% rename from tycho-p2/tycho-p2-director-plugin/src/test/java/org/eclipse/tycho/plugins/tar/FilePermissionHelperTest.java rename to tycho-p2-director-plugin/src/test/java/org/eclipse/tycho/plugins/tar/FilePermissionHelperTest.java diff --git a/tycho-p2/tycho-p2-director-plugin/src/test/java/org/eclipse/tycho/plugins/tar/TarGzArchiverTest.java b/tycho-p2-director-plugin/src/test/java/org/eclipse/tycho/plugins/tar/TarGzArchiverTest.java similarity index 100% rename from tycho-p2/tycho-p2-director-plugin/src/test/java/org/eclipse/tycho/plugins/tar/TarGzArchiverTest.java rename to tycho-p2-director-plugin/src/test/java/org/eclipse/tycho/plugins/tar/TarGzArchiverTest.java diff --git a/tycho-p2/tycho-p2-plugin/.gitignore b/tycho-p2-plugin/.gitignore similarity index 100% rename from tycho-p2/tycho-p2-plugin/.gitignore rename to tycho-p2-plugin/.gitignore diff --git a/tycho-p2/tycho-p2-plugin/.settings/org.eclipse.jdt.core.prefs b/tycho-p2-plugin/.settings/org.eclipse.jdt.core.prefs similarity index 100% rename from tycho-p2/tycho-p2-plugin/.settings/org.eclipse.jdt.core.prefs rename to tycho-p2-plugin/.settings/org.eclipse.jdt.core.prefs diff --git a/tycho-p2/tycho-p2-plugin/.settings/org.eclipse.jdt.ui.prefs b/tycho-p2-plugin/.settings/org.eclipse.jdt.ui.prefs similarity index 100% rename from tycho-p2/tycho-p2-plugin/.settings/org.eclipse.jdt.ui.prefs rename to tycho-p2-plugin/.settings/org.eclipse.jdt.ui.prefs diff --git a/tycho-p2/tycho-p2-plugin/pom.xml b/tycho-p2-plugin/pom.xml similarity index 95% rename from tycho-p2/tycho-p2-plugin/pom.xml rename to tycho-p2-plugin/pom.xml index 80a201c037..7aaa112b3e 100644 --- a/tycho-p2/tycho-p2-plugin/pom.xml +++ b/tycho-p2-plugin/pom.xml @@ -16,7 +16,7 @@ org.eclipse.tycho - tycho-p2 + tycho 4.0.0-SNAPSHOT @@ -24,7 +24,9 @@ maven-plugin Tycho p2 Metadata Plugin - + + ${minimal-maven-version} + org.apache.maven diff --git a/tycho-p2/tycho-p2-plugin/src/main/java/org/eclipse/tycho/plugins/p2/AbstractP2MetadataMojo.java b/tycho-p2-plugin/src/main/java/org/eclipse/tycho/plugins/p2/AbstractP2MetadataMojo.java similarity index 100% rename from tycho-p2/tycho-p2-plugin/src/main/java/org/eclipse/tycho/plugins/p2/AbstractP2MetadataMojo.java rename to tycho-p2-plugin/src/main/java/org/eclipse/tycho/plugins/p2/AbstractP2MetadataMojo.java diff --git a/tycho-p2/tycho-p2-plugin/src/main/java/org/eclipse/tycho/plugins/p2/BaselineMode.java b/tycho-p2-plugin/src/main/java/org/eclipse/tycho/plugins/p2/BaselineMode.java similarity index 100% rename from tycho-p2/tycho-p2-plugin/src/main/java/org/eclipse/tycho/plugins/p2/BaselineMode.java rename to tycho-p2-plugin/src/main/java/org/eclipse/tycho/plugins/p2/BaselineMode.java diff --git a/tycho-p2/tycho-p2-plugin/src/main/java/org/eclipse/tycho/plugins/p2/BaselineReplace.java b/tycho-p2-plugin/src/main/java/org/eclipse/tycho/plugins/p2/BaselineReplace.java similarity index 100% rename from tycho-p2/tycho-p2-plugin/src/main/java/org/eclipse/tycho/plugins/p2/BaselineReplace.java rename to tycho-p2-plugin/src/main/java/org/eclipse/tycho/plugins/p2/BaselineReplace.java diff --git a/tycho-p2/tycho-p2-plugin/src/main/java/org/eclipse/tycho/plugins/p2/BaselineValidator.java b/tycho-p2-plugin/src/main/java/org/eclipse/tycho/plugins/p2/BaselineValidator.java similarity index 100% rename from tycho-p2/tycho-p2-plugin/src/main/java/org/eclipse/tycho/plugins/p2/BaselineValidator.java rename to tycho-p2-plugin/src/main/java/org/eclipse/tycho/plugins/p2/BaselineValidator.java diff --git a/tycho-p2/tycho-p2-plugin/src/main/java/org/eclipse/tycho/plugins/p2/CategoryP2MetadataMojo.java b/tycho-p2-plugin/src/main/java/org/eclipse/tycho/plugins/p2/CategoryP2MetadataMojo.java similarity index 100% rename from tycho-p2/tycho-p2-plugin/src/main/java/org/eclipse/tycho/plugins/p2/CategoryP2MetadataMojo.java rename to tycho-p2-plugin/src/main/java/org/eclipse/tycho/plugins/p2/CategoryP2MetadataMojo.java diff --git a/tycho-p2/tycho-p2-plugin/src/main/java/org/eclipse/tycho/plugins/p2/DependenciesTreeMojo.java b/tycho-p2-plugin/src/main/java/org/eclipse/tycho/plugins/p2/DependenciesTreeMojo.java similarity index 100% rename from tycho-p2/tycho-p2-plugin/src/main/java/org/eclipse/tycho/plugins/p2/DependenciesTreeMojo.java rename to tycho-p2-plugin/src/main/java/org/eclipse/tycho/plugins/p2/DependenciesTreeMojo.java diff --git a/tycho-p2/tycho-p2-plugin/src/main/java/org/eclipse/tycho/plugins/p2/FeatureP2MetadataMojo.java b/tycho-p2-plugin/src/main/java/org/eclipse/tycho/plugins/p2/FeatureP2MetadataMojo.java similarity index 100% rename from tycho-p2/tycho-p2-plugin/src/main/java/org/eclipse/tycho/plugins/p2/FeatureP2MetadataMojo.java rename to tycho-p2-plugin/src/main/java/org/eclipse/tycho/plugins/p2/FeatureP2MetadataMojo.java diff --git a/tycho-p2/tycho-p2-plugin/src/main/java/org/eclipse/tycho/plugins/p2/P2MetadataDefaultMojo.java b/tycho-p2-plugin/src/main/java/org/eclipse/tycho/plugins/p2/P2MetadataDefaultMojo.java similarity index 100% rename from tycho-p2/tycho-p2-plugin/src/main/java/org/eclipse/tycho/plugins/p2/P2MetadataDefaultMojo.java rename to tycho-p2-plugin/src/main/java/org/eclipse/tycho/plugins/p2/P2MetadataDefaultMojo.java diff --git a/tycho-p2/tycho-p2-plugin/src/main/java/org/eclipse/tycho/plugins/p2/P2MetadataMojo.java b/tycho-p2-plugin/src/main/java/org/eclipse/tycho/plugins/p2/P2MetadataMojo.java similarity index 100% rename from tycho-p2/tycho-p2-plugin/src/main/java/org/eclipse/tycho/plugins/p2/P2MetadataMojo.java rename to tycho-p2-plugin/src/main/java/org/eclipse/tycho/plugins/p2/P2MetadataMojo.java diff --git a/tycho-p2/tycho-p2-plugin/src/main/java/org/eclipse/tycho/plugins/p2/Repository.java b/tycho-p2-plugin/src/main/java/org/eclipse/tycho/plugins/p2/Repository.java similarity index 100% rename from tycho-p2/tycho-p2-plugin/src/main/java/org/eclipse/tycho/plugins/p2/Repository.java rename to tycho-p2-plugin/src/main/java/org/eclipse/tycho/plugins/p2/Repository.java diff --git a/tycho-p2/tycho-p2-plugin/src/main/java/org/eclipse/tycho/plugins/p2/UpdateLocalIndexMojo.java b/tycho-p2-plugin/src/main/java/org/eclipse/tycho/plugins/p2/UpdateLocalIndexMojo.java similarity index 100% rename from tycho-p2/tycho-p2-plugin/src/main/java/org/eclipse/tycho/plugins/p2/UpdateLocalIndexMojo.java rename to tycho-p2-plugin/src/main/java/org/eclipse/tycho/plugins/p2/UpdateLocalIndexMojo.java diff --git a/tycho-p2/tycho-p2-plugin/src/main/java/org/eclipse/tycho/plugins/p2/UpdateSiteP2MetadataMojo.java b/tycho-p2-plugin/src/main/java/org/eclipse/tycho/plugins/p2/UpdateSiteP2MetadataMojo.java similarity index 100% rename from tycho-p2/tycho-p2-plugin/src/main/java/org/eclipse/tycho/plugins/p2/UpdateSiteP2MetadataMojo.java rename to tycho-p2-plugin/src/main/java/org/eclipse/tycho/plugins/p2/UpdateSiteP2MetadataMojo.java diff --git a/tycho-p2/tycho-p2-plugin/src/main/resources/META-INF/m2e/lifecycle-mapping-metadata.xml b/tycho-p2-plugin/src/main/resources/META-INF/m2e/lifecycle-mapping-metadata.xml similarity index 100% rename from tycho-p2/tycho-p2-plugin/src/main/resources/META-INF/m2e/lifecycle-mapping-metadata.xml rename to tycho-p2-plugin/src/main/resources/META-INF/m2e/lifecycle-mapping-metadata.xml diff --git a/tycho-p2/tycho-p2-plugin/src/test/java/org/eclipse/tycho/plugins/p2/P2MetadataMojoTest.java b/tycho-p2-plugin/src/test/java/org/eclipse/tycho/plugins/p2/P2MetadataMojoTest.java similarity index 100% rename from tycho-p2/tycho-p2-plugin/src/test/java/org/eclipse/tycho/plugins/p2/P2MetadataMojoTest.java rename to tycho-p2-plugin/src/test/java/org/eclipse/tycho/plugins/p2/P2MetadataMojoTest.java diff --git a/tycho-p2/tycho-p2-publisher-plugin/.gitignore b/tycho-p2-publisher-plugin/.gitignore similarity index 100% rename from tycho-p2/tycho-p2-publisher-plugin/.gitignore rename to tycho-p2-publisher-plugin/.gitignore diff --git a/tycho-p2/tycho-p2-publisher-plugin/.settings/org.eclipse.jdt.core.prefs b/tycho-p2-publisher-plugin/.settings/org.eclipse.jdt.core.prefs similarity index 100% rename from tycho-p2/tycho-p2-publisher-plugin/.settings/org.eclipse.jdt.core.prefs rename to tycho-p2-publisher-plugin/.settings/org.eclipse.jdt.core.prefs diff --git a/tycho-p2/tycho-p2-publisher-plugin/.settings/org.eclipse.jdt.ui.prefs b/tycho-p2-publisher-plugin/.settings/org.eclipse.jdt.ui.prefs similarity index 100% rename from tycho-p2/tycho-p2-publisher-plugin/.settings/org.eclipse.jdt.ui.prefs rename to tycho-p2-publisher-plugin/.settings/org.eclipse.jdt.ui.prefs diff --git a/tycho-p2/tycho-p2-publisher-plugin/pom.xml b/tycho-p2-publisher-plugin/pom.xml similarity index 97% rename from tycho-p2/tycho-p2-publisher-plugin/pom.xml rename to tycho-p2-publisher-plugin/pom.xml index 886107660b..7db4beda9d 100644 --- a/tycho-p2/tycho-p2-publisher-plugin/pom.xml +++ b/tycho-p2-publisher-plugin/pom.xml @@ -16,7 +16,7 @@ org.eclipse.tycho - tycho-p2 + tycho 4.0.0-SNAPSHOT diff --git a/tycho-p2/tycho-p2-publisher-plugin/src/main/java/org/eclipse/tycho/plugins/p2/publisher/AbstractPublishMojo.java b/tycho-p2-publisher-plugin/src/main/java/org/eclipse/tycho/plugins/p2/publisher/AbstractPublishMojo.java similarity index 100% rename from tycho-p2/tycho-p2-publisher-plugin/src/main/java/org/eclipse/tycho/plugins/p2/publisher/AbstractPublishMojo.java rename to tycho-p2-publisher-plugin/src/main/java/org/eclipse/tycho/plugins/p2/publisher/AbstractPublishMojo.java diff --git a/tycho-p2/tycho-p2-publisher-plugin/src/main/java/org/eclipse/tycho/plugins/p2/publisher/PublishCategoriesMojo.java b/tycho-p2-publisher-plugin/src/main/java/org/eclipse/tycho/plugins/p2/publisher/PublishCategoriesMojo.java similarity index 100% rename from tycho-p2/tycho-p2-publisher-plugin/src/main/java/org/eclipse/tycho/plugins/p2/publisher/PublishCategoriesMojo.java rename to tycho-p2-publisher-plugin/src/main/java/org/eclipse/tycho/plugins/p2/publisher/PublishCategoriesMojo.java diff --git a/tycho-p2/tycho-p2-publisher-plugin/src/main/java/org/eclipse/tycho/plugins/p2/publisher/PublishEEProfileMojo.java b/tycho-p2-publisher-plugin/src/main/java/org/eclipse/tycho/plugins/p2/publisher/PublishEEProfileMojo.java similarity index 100% rename from tycho-p2/tycho-p2-publisher-plugin/src/main/java/org/eclipse/tycho/plugins/p2/publisher/PublishEEProfileMojo.java rename to tycho-p2-publisher-plugin/src/main/java/org/eclipse/tycho/plugins/p2/publisher/PublishEEProfileMojo.java diff --git a/tycho-p2/tycho-p2-publisher-plugin/src/main/java/org/eclipse/tycho/plugins/p2/publisher/PublishOsgiEEMojo.java b/tycho-p2-publisher-plugin/src/main/java/org/eclipse/tycho/plugins/p2/publisher/PublishOsgiEEMojo.java similarity index 98% rename from tycho-p2/tycho-p2-publisher-plugin/src/main/java/org/eclipse/tycho/plugins/p2/publisher/PublishOsgiEEMojo.java rename to tycho-p2-publisher-plugin/src/main/java/org/eclipse/tycho/plugins/p2/publisher/PublishOsgiEEMojo.java index c901b87ee6..1cea4c47c3 100644 --- a/tycho-p2/tycho-p2-publisher-plugin/src/main/java/org/eclipse/tycho/plugins/p2/publisher/PublishOsgiEEMojo.java +++ b/tycho-p2-publisher-plugin/src/main/java/org/eclipse/tycho/plugins/p2/publisher/PublishOsgiEEMojo.java @@ -26,8 +26,8 @@ import org.apache.maven.plugins.annotations.ResolutionScope; import org.apache.maven.toolchain.ToolchainManager; import org.codehaus.plexus.logging.Logger; +import org.eclipse.tycho.ExecutionEnvironment; import org.eclipse.tycho.core.ee.ExecutionEnvironmentUtils; -import org.eclipse.tycho.core.ee.shared.ExecutionEnvironment; import org.eclipse.tycho.core.resolver.shared.DependencySeed; import org.eclipse.tycho.p2.tools.FacadeException; import org.eclipse.tycho.p2.tools.publisher.facade.PublisherService; diff --git a/tycho-p2/tycho-p2-publisher-plugin/src/main/java/org/eclipse/tycho/plugins/p2/publisher/PublishProductMojo.java b/tycho-p2-publisher-plugin/src/main/java/org/eclipse/tycho/plugins/p2/publisher/PublishProductMojo.java similarity index 98% rename from tycho-p2/tycho-p2-publisher-plugin/src/main/java/org/eclipse/tycho/plugins/p2/publisher/PublishProductMojo.java rename to tycho-p2-publisher-plugin/src/main/java/org/eclipse/tycho/plugins/p2/publisher/PublishProductMojo.java index a2531ea874..38802be410 100644 --- a/tycho-p2/tycho-p2-publisher-plugin/src/main/java/org/eclipse/tycho/plugins/p2/publisher/PublishProductMojo.java +++ b/tycho-p2-publisher-plugin/src/main/java/org/eclipse/tycho/plugins/p2/publisher/PublishProductMojo.java @@ -27,6 +27,8 @@ import org.eclipse.tycho.ArtifactDescriptor; import org.eclipse.tycho.ArtifactType; import org.eclipse.tycho.DependencyArtifacts; +import org.eclipse.tycho.FileLockService; +import org.eclipse.tycho.FileLocker; import org.eclipse.tycho.Interpolator; import org.eclipse.tycho.PackagingType; import org.eclipse.tycho.PlatformPropertiesUtils; @@ -36,8 +38,6 @@ import org.eclipse.tycho.core.osgitools.EclipseRepositoryProject; import org.eclipse.tycho.core.resolver.shared.DependencySeed; import org.eclipse.tycho.core.utils.TychoProjectUtils; -import org.eclipse.tycho.locking.facade.FileLockService; -import org.eclipse.tycho.locking.facade.FileLocker; import org.eclipse.tycho.model.ProductConfiguration; import org.eclipse.tycho.p2.tools.publisher.facade.PublishProductTool; import org.eclipse.tycho.p2.tools.publisher.facade.PublisherServiceFactory; diff --git a/tycho-p2/tycho-p2-publisher-plugin/src/main/java/org/eclipse/tycho/plugins/p2/publisher/persistence/AttachPublishedArtifactsMojo.java b/tycho-p2-publisher-plugin/src/main/java/org/eclipse/tycho/plugins/p2/publisher/persistence/AttachPublishedArtifactsMojo.java similarity index 97% rename from tycho-p2/tycho-p2-publisher-plugin/src/main/java/org/eclipse/tycho/plugins/p2/publisher/persistence/AttachPublishedArtifactsMojo.java rename to tycho-p2-publisher-plugin/src/main/java/org/eclipse/tycho/plugins/p2/publisher/persistence/AttachPublishedArtifactsMojo.java index 8781f1d0de..26aa02e561 100644 --- a/tycho-p2/tycho-p2-publisher-plugin/src/main/java/org/eclipse/tycho/plugins/p2/publisher/persistence/AttachPublishedArtifactsMojo.java +++ b/tycho-p2-publisher-plugin/src/main/java/org/eclipse/tycho/plugins/p2/publisher/persistence/AttachPublishedArtifactsMojo.java @@ -24,9 +24,9 @@ import org.apache.maven.project.MavenProjectHelper; import org.codehaus.plexus.logging.Logger; import org.eclipse.tycho.IDependencyMetadata.DependencyMetadataType; +import org.eclipse.tycho.PublishingRepositoryFacade; import org.eclipse.tycho.ReactorProject; import org.eclipse.tycho.core.maven.AbstractP2Mojo; -import org.eclipse.tycho.repository.registry.facade.PublishingRepositoryFacade; import org.eclipse.tycho.repository.registry.facade.ReactorRepositoryManager; /** diff --git a/tycho-p2/tycho-p2-publisher-plugin/src/main/resources/META-INF/m2e/lifecycle-mapping-metadata.xml b/tycho-p2-publisher-plugin/src/main/resources/META-INF/m2e/lifecycle-mapping-metadata.xml similarity index 100% rename from tycho-p2/tycho-p2-publisher-plugin/src/main/resources/META-INF/m2e/lifecycle-mapping-metadata.xml rename to tycho-p2-publisher-plugin/src/main/resources/META-INF/m2e/lifecycle-mapping-metadata.xml diff --git a/tycho-p2/tycho-p2-publisher-plugin/src/test/java/org/eclipse/tycho/plugins/p2/publisher/PublishProductMojoTest.java b/tycho-p2-publisher-plugin/src/test/java/org/eclipse/tycho/plugins/p2/publisher/PublishProductMojoTest.java similarity index 100% rename from tycho-p2/tycho-p2-publisher-plugin/src/test/java/org/eclipse/tycho/plugins/p2/publisher/PublishProductMojoTest.java rename to tycho-p2-publisher-plugin/src/test/java/org/eclipse/tycho/plugins/p2/publisher/PublishProductMojoTest.java diff --git a/tycho-p2/tycho-p2-repository-plugin/.gitignore b/tycho-p2-repository-plugin/.gitignore similarity index 100% rename from tycho-p2/tycho-p2-repository-plugin/.gitignore rename to tycho-p2-repository-plugin/.gitignore diff --git a/tycho-p2/tycho-p2-repository-plugin/.settings/org.eclipse.jdt.core.prefs b/tycho-p2-repository-plugin/.settings/org.eclipse.jdt.core.prefs similarity index 100% rename from tycho-p2/tycho-p2-repository-plugin/.settings/org.eclipse.jdt.core.prefs rename to tycho-p2-repository-plugin/.settings/org.eclipse.jdt.core.prefs diff --git a/tycho-p2/tycho-p2-repository-plugin/.settings/org.eclipse.jdt.ui.prefs b/tycho-p2-repository-plugin/.settings/org.eclipse.jdt.ui.prefs similarity index 100% rename from tycho-p2/tycho-p2-repository-plugin/.settings/org.eclipse.jdt.ui.prefs rename to tycho-p2-repository-plugin/.settings/org.eclipse.jdt.ui.prefs diff --git a/tycho-p2/tycho-p2-repository-plugin/pom.xml b/tycho-p2-repository-plugin/pom.xml similarity index 95% rename from tycho-p2/tycho-p2-repository-plugin/pom.xml rename to tycho-p2-repository-plugin/pom.xml index c8d7c649ee..7a5937172c 100644 --- a/tycho-p2/tycho-p2-repository-plugin/pom.xml +++ b/tycho-p2-repository-plugin/pom.xml @@ -15,13 +15,15 @@ org.eclipse.tycho - tycho-p2 + tycho 4.0.0-SNAPSHOT tycho-p2-repository-plugin maven-plugin - + + ${minimal-maven-version} + Tycho p2 Repository Plugin A plugin for creating p2 repositories diff --git a/tycho-p2/tycho-p2-repository-plugin/src/main/java/org/eclipse/tycho/plugins/p2/repository/AbstractRepositoryMojo.java b/tycho-p2-repository-plugin/src/main/java/org/eclipse/tycho/plugins/p2/repository/AbstractRepositoryMojo.java similarity index 100% rename from tycho-p2/tycho-p2-repository-plugin/src/main/java/org/eclipse/tycho/plugins/p2/repository/AbstractRepositoryMojo.java rename to tycho-p2-repository-plugin/src/main/java/org/eclipse/tycho/plugins/p2/repository/AbstractRepositoryMojo.java diff --git a/tycho-p2/tycho-p2-repository-plugin/src/main/java/org/eclipse/tycho/plugins/p2/repository/ArchiveRepositoryMojo.java b/tycho-p2-repository-plugin/src/main/java/org/eclipse/tycho/plugins/p2/repository/ArchiveRepositoryMojo.java similarity index 100% rename from tycho-p2/tycho-p2-repository-plugin/src/main/java/org/eclipse/tycho/plugins/p2/repository/ArchiveRepositoryMojo.java rename to tycho-p2-repository-plugin/src/main/java/org/eclipse/tycho/plugins/p2/repository/ArchiveRepositoryMojo.java diff --git a/tycho-p2/tycho-p2-repository-plugin/src/main/java/org/eclipse/tycho/plugins/p2/repository/AssembleRepositoryMojo.java b/tycho-p2-repository-plugin/src/main/java/org/eclipse/tycho/plugins/p2/repository/AssembleRepositoryMojo.java similarity index 100% rename from tycho-p2/tycho-p2-repository-plugin/src/main/java/org/eclipse/tycho/plugins/p2/repository/AssembleRepositoryMojo.java rename to tycho-p2-repository-plugin/src/main/java/org/eclipse/tycho/plugins/p2/repository/AssembleRepositoryMojo.java diff --git a/tycho-p2/tycho-p2-repository-plugin/src/main/java/org/eclipse/tycho/plugins/p2/repository/FixArtifactsMetadataMetadataMojo.java b/tycho-p2-repository-plugin/src/main/java/org/eclipse/tycho/plugins/p2/repository/FixArtifactsMetadataMetadataMojo.java similarity index 100% rename from tycho-p2/tycho-p2-repository-plugin/src/main/java/org/eclipse/tycho/plugins/p2/repository/FixArtifactsMetadataMetadataMojo.java rename to tycho-p2-repository-plugin/src/main/java/org/eclipse/tycho/plugins/p2/repository/FixArtifactsMetadataMetadataMojo.java diff --git a/tycho-p2/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 similarity index 100% rename from tycho-p2/tycho-p2-repository-plugin/src/main/java/org/eclipse/tycho/plugins/p2/repository/MavenP2SiteMojo.java rename to tycho-p2-repository-plugin/src/main/java/org/eclipse/tycho/plugins/p2/repository/MavenP2SiteMojo.java diff --git a/tycho-p2/tycho-p2-repository-plugin/src/main/java/org/eclipse/tycho/plugins/p2/repository/RemapArtifactToMavenRepositoriesMojo.java b/tycho-p2-repository-plugin/src/main/java/org/eclipse/tycho/plugins/p2/repository/RemapArtifactToMavenRepositoriesMojo.java similarity index 100% rename from tycho-p2/tycho-p2-repository-plugin/src/main/java/org/eclipse/tycho/plugins/p2/repository/RemapArtifactToMavenRepositoriesMojo.java rename to tycho-p2-repository-plugin/src/main/java/org/eclipse/tycho/plugins/p2/repository/RemapArtifactToMavenRepositoriesMojo.java diff --git a/tycho-p2/tycho-p2-repository-plugin/src/main/java/org/eclipse/tycho/plugins/p2/repository/VerifyIntegrityRepositoryMojo.java b/tycho-p2-repository-plugin/src/main/java/org/eclipse/tycho/plugins/p2/repository/VerifyIntegrityRepositoryMojo.java similarity index 100% rename from tycho-p2/tycho-p2-repository-plugin/src/main/java/org/eclipse/tycho/plugins/p2/repository/VerifyIntegrityRepositoryMojo.java rename to tycho-p2-repository-plugin/src/main/java/org/eclipse/tycho/plugins/p2/repository/VerifyIntegrityRepositoryMojo.java diff --git a/tycho-p2/tycho-p2-repository-plugin/src/main/resources/META-INF/m2e/lifecycle-mapping-metadata.xml b/tycho-p2-repository-plugin/src/main/resources/META-INF/m2e/lifecycle-mapping-metadata.xml similarity index 100% rename from tycho-p2/tycho-p2-repository-plugin/src/main/resources/META-INF/m2e/lifecycle-mapping-metadata.xml rename to tycho-p2-repository-plugin/src/main/resources/META-INF/m2e/lifecycle-mapping-metadata.xml diff --git a/tycho-p2/tycho-p2-repository-plugin/src/test/java/org/eclipse/tycho/p2/tools/verfier/VerifierServiceImplTest.java b/tycho-p2-repository-plugin/src/test/java/org/eclipse/tycho/p2/tools/verfier/VerifierServiceImplTest.java similarity index 100% rename from tycho-p2/tycho-p2-repository-plugin/src/test/java/org/eclipse/tycho/p2/tools/verfier/VerifierServiceImplTest.java rename to tycho-p2-repository-plugin/src/test/java/org/eclipse/tycho/p2/tools/verfier/VerifierServiceImplTest.java diff --git a/tycho-p2/tycho-p2-repository-plugin/src/test/resources/repositories/missing_artifacts/artifacts.xml b/tycho-p2-repository-plugin/src/test/resources/repositories/missing_artifacts/artifacts.xml similarity index 100% rename from tycho-p2/tycho-p2-repository-plugin/src/test/resources/repositories/missing_artifacts/artifacts.xml rename to tycho-p2-repository-plugin/src/test/resources/repositories/missing_artifacts/artifacts.xml diff --git a/tycho-p2/tycho-p2-repository-plugin/src/test/resources/repositories/missing_artifacts/content.xml b/tycho-p2-repository-plugin/src/test/resources/repositories/missing_artifacts/content.xml similarity index 100% rename from tycho-p2/tycho-p2-repository-plugin/src/test/resources/repositories/missing_artifacts/content.xml rename to tycho-p2-repository-plugin/src/test/resources/repositories/missing_artifacts/content.xml diff --git a/tycho-p2/tycho-p2-repository-plugin/src/test/resources/repositories/selfsigned/artifacts.xml b/tycho-p2-repository-plugin/src/test/resources/repositories/selfsigned/artifacts.xml similarity index 100% rename from tycho-p2/tycho-p2-repository-plugin/src/test/resources/repositories/selfsigned/artifacts.xml rename to tycho-p2-repository-plugin/src/test/resources/repositories/selfsigned/artifacts.xml diff --git a/tycho-p2/tycho-p2-repository-plugin/src/test/resources/repositories/selfsigned/content.xml b/tycho-p2-repository-plugin/src/test/resources/repositories/selfsigned/content.xml similarity index 100% rename from tycho-p2/tycho-p2-repository-plugin/src/test/resources/repositories/selfsigned/content.xml rename to tycho-p2-repository-plugin/src/test/resources/repositories/selfsigned/content.xml diff --git a/tycho-p2/tycho-p2-repository-plugin/src/test/resources/repositories/selfsigned/features/jarsigning.feature_0.0.1.201109191414.jar b/tycho-p2-repository-plugin/src/test/resources/repositories/selfsigned/features/jarsigning.feature_0.0.1.201109191414.jar similarity index 100% rename from tycho-p2/tycho-p2-repository-plugin/src/test/resources/repositories/selfsigned/features/jarsigning.feature_0.0.1.201109191414.jar rename to tycho-p2-repository-plugin/src/test/resources/repositories/selfsigned/features/jarsigning.feature_0.0.1.201109191414.jar diff --git a/tycho-p2/tycho-p2-repository-plugin/src/test/resources/repositories/selfsigned/plugins/jarsigning_0.0.1.201109191414.jar b/tycho-p2-repository-plugin/src/test/resources/repositories/selfsigned/plugins/jarsigning_0.0.1.201109191414.jar similarity index 100% rename from tycho-p2/tycho-p2-repository-plugin/src/test/resources/repositories/selfsigned/plugins/jarsigning_0.0.1.201109191414.jar rename to tycho-p2-repository-plugin/src/test/resources/repositories/selfsigned/plugins/jarsigning_0.0.1.201109191414.jar diff --git a/tycho-p2/tycho-p2-repository-plugin/src/test/resources/repositories/tampered_file/artifacts.xml b/tycho-p2-repository-plugin/src/test/resources/repositories/tampered_file/artifacts.xml similarity index 100% rename from tycho-p2/tycho-p2-repository-plugin/src/test/resources/repositories/tampered_file/artifacts.xml rename to tycho-p2-repository-plugin/src/test/resources/repositories/tampered_file/artifacts.xml diff --git a/tycho-p2/tycho-p2-repository-plugin/src/test/resources/repositories/tampered_file/content.xml b/tycho-p2-repository-plugin/src/test/resources/repositories/tampered_file/content.xml similarity index 100% rename from tycho-p2/tycho-p2-repository-plugin/src/test/resources/repositories/tampered_file/content.xml rename to tycho-p2-repository-plugin/src/test/resources/repositories/tampered_file/content.xml diff --git a/tycho-p2/tycho-p2-repository-plugin/src/test/resources/repositories/tampered_file/features/jarsigning.feature_0.0.1.201109191414.jar b/tycho-p2-repository-plugin/src/test/resources/repositories/tampered_file/features/jarsigning.feature_0.0.1.201109191414.jar similarity index 100% rename from tycho-p2/tycho-p2-repository-plugin/src/test/resources/repositories/tampered_file/features/jarsigning.feature_0.0.1.201109191414.jar rename to tycho-p2-repository-plugin/src/test/resources/repositories/tampered_file/features/jarsigning.feature_0.0.1.201109191414.jar diff --git a/tycho-p2/tycho-p2-repository-plugin/src/test/resources/repositories/tampered_file/plugins/jarsigning_0.0.1.201109191414.jar b/tycho-p2-repository-plugin/src/test/resources/repositories/tampered_file/plugins/jarsigning_0.0.1.201109191414.jar similarity index 100% rename from tycho-p2/tycho-p2-repository-plugin/src/test/resources/repositories/tampered_file/plugins/jarsigning_0.0.1.201109191414.jar rename to tycho-p2-repository-plugin/src/test/resources/repositories/tampered_file/plugins/jarsigning_0.0.1.201109191414.jar diff --git a/tycho-p2/tycho-p2-repository-plugin/src/test/resources/repositories/wrong_checksum/artifacts.xml b/tycho-p2-repository-plugin/src/test/resources/repositories/wrong_checksum/artifacts.xml similarity index 100% rename from tycho-p2/tycho-p2-repository-plugin/src/test/resources/repositories/wrong_checksum/artifacts.xml rename to tycho-p2-repository-plugin/src/test/resources/repositories/wrong_checksum/artifacts.xml diff --git a/tycho-p2/tycho-p2-repository-plugin/src/test/resources/repositories/wrong_checksum/content.xml b/tycho-p2-repository-plugin/src/test/resources/repositories/wrong_checksum/content.xml similarity index 100% rename from tycho-p2/tycho-p2-repository-plugin/src/test/resources/repositories/wrong_checksum/content.xml rename to tycho-p2-repository-plugin/src/test/resources/repositories/wrong_checksum/content.xml diff --git a/tycho-p2/tycho-p2-repository-plugin/src/test/resources/repositories/wrong_checksum/features/jarsigning.feature_0.0.1.201109191414.jar b/tycho-p2-repository-plugin/src/test/resources/repositories/wrong_checksum/features/jarsigning.feature_0.0.1.201109191414.jar similarity index 100% rename from tycho-p2/tycho-p2-repository-plugin/src/test/resources/repositories/wrong_checksum/features/jarsigning.feature_0.0.1.201109191414.jar rename to tycho-p2-repository-plugin/src/test/resources/repositories/wrong_checksum/features/jarsigning.feature_0.0.1.201109191414.jar diff --git a/tycho-p2/tycho-p2-repository-plugin/src/test/resources/repositories/wrong_checksum/plugins/jarsigning_0.0.1.201109191414.jar b/tycho-p2-repository-plugin/src/test/resources/repositories/wrong_checksum/plugins/jarsigning_0.0.1.201109191414.jar similarity index 100% rename from tycho-p2/tycho-p2-repository-plugin/src/test/resources/repositories/wrong_checksum/plugins/jarsigning_0.0.1.201109191414.jar rename to tycho-p2-repository-plugin/src/test/resources/repositories/wrong_checksum/plugins/jarsigning_0.0.1.201109191414.jar diff --git a/tycho-p2/pom.xml b/tycho-p2/pom.xml index feed20c5ad..daca69dd6a 100644 --- a/tycho-p2/pom.xml +++ b/tycho-p2/pom.xml @@ -26,10 +26,7 @@ Tycho p2 Tools Parent - tycho-p2-director-plugin - tycho-p2-plugin - tycho-p2-publisher-plugin - tycho-p2-repository-plugin + diff --git a/tycho-packaging-plugin/pom.xml b/tycho-packaging-plugin/pom.xml index 18ff88b9f5..f1b1b6d3a7 100644 --- a/tycho-packaging-plugin/pom.xml +++ b/tycho-packaging-plugin/pom.xml @@ -21,7 +21,9 @@ tycho-packaging-plugin maven-plugin - + + ${minimal-maven-version} + Tycho OSGi Packaging Plugin A plugin for packaging OSGi bundles diff --git a/tycho-packaging-plugin/src/main/java/org/eclipse/tycho/buildversion/BuildQualifierMojo.java b/tycho-packaging-plugin/src/main/java/org/eclipse/tycho/buildversion/BuildQualifierMojo.java index 7d56ef13c3..965b47f4a8 100644 --- a/tycho-packaging-plugin/src/main/java/org/eclipse/tycho/buildversion/BuildQualifierMojo.java +++ b/tycho-packaging-plugin/src/main/java/org/eclipse/tycho/buildversion/BuildQualifierMojo.java @@ -35,8 +35,8 @@ import org.apache.maven.plugins.annotations.Parameter; import org.eclipse.tycho.BuildPropertiesParser; import org.eclipse.tycho.build.BuildTimestampProvider; +import org.eclipse.tycho.core.VersioningHelper; import org.eclipse.tycho.core.osgitools.DefaultReactorProject; -import org.eclipse.tycho.core.shared.VersioningHelper; import org.osgi.framework.Version; /** diff --git a/tycho-packaging-plugin/src/main/java/org/eclipse/tycho/buildversion/ValidateVersionMojo.java b/tycho-packaging-plugin/src/main/java/org/eclipse/tycho/buildversion/ValidateVersionMojo.java index d48e01bccf..c90d5d2579 100644 --- a/tycho-packaging-plugin/src/main/java/org/eclipse/tycho/buildversion/ValidateVersionMojo.java +++ b/tycho-packaging-plugin/src/main/java/org/eclipse/tycho/buildversion/ValidateVersionMojo.java @@ -26,7 +26,7 @@ import org.eclipse.tycho.PackagingType; import org.eclipse.tycho.TychoProperties; import org.eclipse.tycho.core.ManifestHelper; -import org.eclipse.tycho.core.shared.VersioningHelper; +import org.eclipse.tycho.core.VersioningHelper; import org.osgi.framework.Constants; import org.sonatype.plexus.build.incremental.BuildContext; diff --git a/tycho-packaging-plugin/src/main/java/org/eclipse/tycho/packaging/FeatureXmlTransformer.java b/tycho-packaging-plugin/src/main/java/org/eclipse/tycho/packaging/FeatureXmlTransformer.java index da99f46291..7dd4099b9d 100644 --- a/tycho-packaging-plugin/src/main/java/org/eclipse/tycho/packaging/FeatureXmlTransformer.java +++ b/tycho-packaging-plugin/src/main/java/org/eclipse/tycho/packaging/FeatureXmlTransformer.java @@ -31,10 +31,10 @@ import org.eclipse.equinox.p2.metadata.Version; import org.eclipse.tycho.ArtifactKey; import org.eclipse.tycho.ArtifactType; +import org.eclipse.tycho.FileLockService; +import org.eclipse.tycho.FileLocker; import org.eclipse.tycho.IllegalArtifactReferenceException; import org.eclipse.tycho.TargetPlatform; -import org.eclipse.tycho.locking.facade.FileLockService; -import org.eclipse.tycho.locking.facade.FileLocker; import org.eclipse.tycho.model.Feature; import org.eclipse.tycho.model.Feature.ImportRef; import org.eclipse.tycho.model.FeatureRef; diff --git a/tycho-packaging-plugin/src/main/java/org/eclipse/tycho/packaging/LicenseFeatureHelper.java b/tycho-packaging-plugin/src/main/java/org/eclipse/tycho/packaging/LicenseFeatureHelper.java index 1970da7b4d..a02a5b11cd 100644 --- a/tycho-packaging-plugin/src/main/java/org/eclipse/tycho/packaging/LicenseFeatureHelper.java +++ b/tycho-packaging-plugin/src/main/java/org/eclipse/tycho/packaging/LicenseFeatureHelper.java @@ -32,8 +32,8 @@ import org.eclipse.tycho.BuildProperties; import org.eclipse.tycho.BuildPropertiesParser; import org.eclipse.tycho.ReactorProject; +import org.eclipse.tycho.core.BuildPropertiesImpl; import org.eclipse.tycho.core.osgitools.DefaultReactorProject; -import org.eclipse.tycho.core.shared.BuildPropertiesImpl; import org.eclipse.tycho.core.utils.TychoProjectUtils; import org.eclipse.tycho.model.Feature; diff --git a/tycho-packaging-plugin/src/main/java/org/eclipse/tycho/packaging/UpdateSiteAssembler.java b/tycho-packaging-plugin/src/main/java/org/eclipse/tycho/packaging/UpdateSiteAssembler.java index f11d771696..a275afbeaf 100644 --- a/tycho-packaging-plugin/src/main/java/org/eclipse/tycho/packaging/UpdateSiteAssembler.java +++ b/tycho-packaging-plugin/src/main/java/org/eclipse/tycho/packaging/UpdateSiteAssembler.java @@ -27,12 +27,12 @@ import org.codehaus.plexus.archiver.zip.ZipUnArchiver; import org.codehaus.plexus.component.repository.exception.ComponentLookupException; import org.codehaus.plexus.util.FileUtils; +import org.eclipse.tycho.FileLockService; +import org.eclipse.tycho.FileLocker; import org.eclipse.tycho.ReactorProject; import org.eclipse.tycho.core.ArtifactDependencyVisitor; import org.eclipse.tycho.core.FeatureDescription; import org.eclipse.tycho.core.PluginDescription; -import org.eclipse.tycho.locking.facade.FileLockService; -import org.eclipse.tycho.locking.facade.FileLocker; import org.eclipse.tycho.model.PluginRef; /** diff --git a/tycho-packaging-plugin/src/main/java/org/eclipse/tycho/packaging/reverseresolve/RepositoryArtifactCoordinateResolver.java b/tycho-packaging-plugin/src/main/java/org/eclipse/tycho/packaging/reverseresolve/RepositoryArtifactCoordinateResolver.java index f963795544..f419bb374d 100644 --- a/tycho-packaging-plugin/src/main/java/org/eclipse/tycho/packaging/reverseresolve/RepositoryArtifactCoordinateResolver.java +++ b/tycho-packaging-plugin/src/main/java/org/eclipse/tycho/packaging/reverseresolve/RepositoryArtifactCoordinateResolver.java @@ -34,7 +34,7 @@ import org.codehaus.plexus.component.annotations.Component; import org.codehaus.plexus.component.annotations.Requirement; import org.codehaus.plexus.logging.Logger; -import org.eclipse.tycho.core.shared.DependencyResolutionException; +import org.eclipse.tycho.core.DependencyResolutionException; /** * This resolves against the maven (local) repository if the jar carry a diff --git a/tycho-packaging-plugin/src/test/java/org/eclipse/tycho/packaging/IncludeValidationHelperTest.java b/tycho-packaging-plugin/src/test/java/org/eclipse/tycho/packaging/IncludeValidationHelperTest.java index d95352c89b..43cdcac582 100644 --- a/tycho-packaging-plugin/src/test/java/org/eclipse/tycho/packaging/IncludeValidationHelperTest.java +++ b/tycho-packaging-plugin/src/test/java/org/eclipse/tycho/packaging/IncludeValidationHelperTest.java @@ -28,7 +28,7 @@ import org.apache.maven.project.MavenProject; import org.codehaus.plexus.logging.AbstractLogger; import org.codehaus.plexus.logging.Logger; -import org.eclipse.tycho.core.shared.BuildPropertiesImpl; +import org.eclipse.tycho.core.BuildPropertiesImpl; import org.eclipse.tycho.testing.TestUtil; import org.junit.Test; diff --git a/tycho-source-plugin/pom.xml b/tycho-source-plugin/pom.xml index a4cafd68f6..f8e35a661c 100644 --- a/tycho-source-plugin/pom.xml +++ b/tycho-source-plugin/pom.xml @@ -21,7 +21,9 @@ tycho-source-plugin maven-plugin - + + ${minimal-maven-version} + Tycho OSGi Source Plugin A plugin for packing source on OSGi bundles diff --git a/tycho-spi/pom.xml b/tycho-spi/pom.xml index 099dffbeec..262a77221f 100644 --- a/tycho-spi/pom.xml +++ b/tycho-spi/pom.xml @@ -27,7 +27,7 @@ org.eclipse.tycho - org.eclipse.tycho.embedder.shared + tycho-api ${project.version} diff --git a/tycho-surefire/tycho-surefire-plugin/pom.xml b/tycho-surefire/tycho-surefire-plugin/pom.xml index b5471cc7cc..ab448ea3a7 100644 --- a/tycho-surefire/tycho-surefire-plugin/pom.xml +++ b/tycho-surefire/tycho-surefire-plugin/pom.xml @@ -21,6 +21,9 @@ tycho-surefire-plugin maven-plugin Tycho Surefire Plugin + + ${minimal-maven-version} + diff --git a/tycho-surefire/tycho-surefire-plugin/src/main/java/org/eclipse/tycho/surefire/AbstractEclipseTestMojo.java b/tycho-surefire/tycho-surefire-plugin/src/main/java/org/eclipse/tycho/surefire/AbstractEclipseTestMojo.java index 6a64590bda..7e30aabfa0 100644 --- a/tycho-surefire/tycho-surefire-plugin/src/main/java/org/eclipse/tycho/surefire/AbstractEclipseTestMojo.java +++ b/tycho-surefire/tycho-surefire-plugin/src/main/java/org/eclipse/tycho/surefire/AbstractEclipseTestMojo.java @@ -72,6 +72,7 @@ import org.eclipse.tycho.BuildDirectory; import org.eclipse.tycho.DefaultArtifactKey; import org.eclipse.tycho.DependencyArtifacts; +import org.eclipse.tycho.ExecutionEnvironmentConfiguration; import org.eclipse.tycho.OptionalResolutionAction; import org.eclipse.tycho.PlatformPropertiesUtils; import org.eclipse.tycho.ReactorProject; @@ -82,7 +83,6 @@ import org.eclipse.tycho.core.DependencyResolverConfiguration; import org.eclipse.tycho.core.TargetPlatformConfiguration; import org.eclipse.tycho.core.TychoProject; -import org.eclipse.tycho.core.ee.shared.ExecutionEnvironmentConfiguration; import org.eclipse.tycho.core.osgitools.DefaultReactorProject; import org.eclipse.tycho.core.osgitools.project.BuildOutputJar; import org.eclipse.tycho.core.utils.TychoProjectUtils; diff --git a/tycho-targetplatform/pom.xml b/tycho-targetplatform/pom.xml index 8b0f8fdde2..e13f3a50c1 100644 --- a/tycho-targetplatform/pom.xml +++ b/tycho-targetplatform/pom.xml @@ -11,7 +11,7 @@ org.eclipse.tycho - org.eclipse.tycho.embedder.shared + tycho-api ${project.version} diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/core/resolver/target/P2TargetPlatform.java b/tycho-targetplatform/src/main/java/org/eclipse/tycho/targetplatform/P2TargetPlatform.java similarity index 98% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/core/resolver/target/P2TargetPlatform.java rename to tycho-targetplatform/src/main/java/org/eclipse/tycho/targetplatform/P2TargetPlatform.java index 817f3560d6..1090aa11de 100644 --- a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/core/resolver/target/P2TargetPlatform.java +++ b/tycho-targetplatform/src/main/java/org/eclipse/tycho/targetplatform/P2TargetPlatform.java @@ -11,7 +11,7 @@ * SAP SE - initial API and implementation * Christoph Läubrich - Issue #845 - Feature restrictions are not taken into account when using emptyVersion *******************************************************************************/ -package org.eclipse.tycho.core.resolver.target; +package org.eclipse.tycho.targetplatform; import java.io.File; import java.util.Collection; 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 d4d5467c43..0927557c78 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 @@ -185,7 +185,7 @@ public enum IncludeMode { } public interface Repository { - URI getLocation(); + String getLocation(); String getId(); } diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/core/resolver/target/TargetDefinitionContent.java b/tycho-targetplatform/src/main/java/org/eclipse/tycho/targetplatform/TargetDefinitionContent.java similarity index 97% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/core/resolver/target/TargetDefinitionContent.java rename to tycho-targetplatform/src/main/java/org/eclipse/tycho/targetplatform/TargetDefinitionContent.java index 37c95ea98d..c8d8db63d0 100644 --- a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/core/resolver/target/TargetDefinitionContent.java +++ b/tycho-targetplatform/src/main/java/org/eclipse/tycho/targetplatform/TargetDefinitionContent.java @@ -11,7 +11,7 @@ * SAP SE - initial API and implementation * Christoph Läubrich - [Bug 538144] Support other target locations (Directory, Features, Installations) *******************************************************************************/ -package org.eclipse.tycho.core.resolver.target; +package org.eclipse.tycho.targetplatform; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.equinox.p2.metadata.IInstallableUnit; 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 ff69848cc0..532bef6de0 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 @@ -407,9 +407,9 @@ public String getTypeDescription() { private static final class Repository implements TargetDefinition.Repository { private final String id; - private final URI uri; + private final String uri; - Repository(String id, URI uri) { + Repository(String id, String uri) { this.id = id; this.uri = uri; } @@ -421,7 +421,7 @@ public String getId() { } @Override - public URI getLocation() { + public String getLocation() { return uri; } @@ -562,7 +562,7 @@ public static boolean isTargetFile(File file) { && file.getName().toLowerCase().endsWith(TargetDefinitionFile.FILE_EXTENSION) && !file.getName().startsWith(".polyglot."); } - + private static List parseLocations(Element dom) { ArrayList locations = new ArrayList<>(); Element locationsDom = getChild(dom, "locations"); @@ -640,12 +640,7 @@ private static IULocation parseIULocation(Element dom) { final List repositories = new ArrayList<>(); for (Element node : getChildren(dom, "repository")) { String id = node.getAttribute("id"); - URI uri; - try { - uri = new URI(node.getAttribute("location")); - } catch (URISyntaxException e) { - throw new TargetDefinitionSyntaxException("invalid URI", e); - } + String uri = node.getAttribute("location"); repositories.add(new Repository(id, uri)); } return new IULocation(Collections.unmodifiableList(units), Collections.unmodifiableList(repositories), diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/artifacts/TargetPlatformFilter.java b/tycho-targetplatform/src/main/java/org/eclipse/tycho/targetplatform/TargetPlatformFilter.java similarity index 99% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/artifacts/TargetPlatformFilter.java rename to tycho-targetplatform/src/main/java/org/eclipse/tycho/targetplatform/TargetPlatformFilter.java index 02c7ca0af0..9ccb1c2918 100644 --- a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/artifacts/TargetPlatformFilter.java +++ b/tycho-targetplatform/src/main/java/org/eclipse/tycho/targetplatform/TargetPlatformFilter.java @@ -10,7 +10,7 @@ * Contributors: * SAP AG - initial API and implementation *******************************************************************************/ -package org.eclipse.tycho.artifacts; +package org.eclipse.tycho.targetplatform; import java.util.Objects; import java.util.StringJoiner; diff --git a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/artifacts/TargetPlatformFilterSyntaxException.java b/tycho-targetplatform/src/main/java/org/eclipse/tycho/targetplatform/TargetPlatformFilterSyntaxException.java similarity index 95% rename from tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/artifacts/TargetPlatformFilterSyntaxException.java rename to tycho-targetplatform/src/main/java/org/eclipse/tycho/targetplatform/TargetPlatformFilterSyntaxException.java index da910ff7e9..67ee482910 100644 --- a/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/artifacts/TargetPlatformFilterSyntaxException.java +++ b/tycho-targetplatform/src/main/java/org/eclipse/tycho/targetplatform/TargetPlatformFilterSyntaxException.java @@ -10,7 +10,7 @@ * Contributors: * SAP AG - initial API and implementation *******************************************************************************/ -package org.eclipse.tycho.artifacts; +package org.eclipse.tycho.targetplatform; public class TargetPlatformFilterSyntaxException extends RuntimeException { diff --git a/tycho-testing-harness/pom.xml b/tycho-testing-harness/pom.xml index 5ea676a083..b55aa0fca1 100644 --- a/tycho-testing-harness/pom.xml +++ b/tycho-testing-harness/pom.xml @@ -53,15 +53,9 @@ - - - org.eclipse.tycho - org.eclipse.tycho.core.shared - ${project.version} - org.eclipse.tycho - org.eclipse.tycho.embedder.shared + tycho-api ${project.version} diff --git a/tycho-testing-harness/src/main/java/org/eclipse/tycho/test/util/NoopFileLockService.java b/tycho-testing-harness/src/main/java/org/eclipse/tycho/test/util/NoopFileLockService.java index ecce3dd202..51751e8ade 100644 --- a/tycho-testing-harness/src/main/java/org/eclipse/tycho/test/util/NoopFileLockService.java +++ b/tycho-testing-harness/src/main/java/org/eclipse/tycho/test/util/NoopFileLockService.java @@ -15,9 +15,9 @@ import java.io.File; -import org.eclipse.tycho.locking.facade.FileLockService; -import org.eclipse.tycho.locking.facade.FileLocker; -import org.eclipse.tycho.locking.facade.LockTimeoutException; +import org.eclipse.tycho.FileLockService; +import org.eclipse.tycho.FileLocker; +import org.eclipse.tycho.LockTimeoutException; public class NoopFileLockService implements FileLockService { diff --git a/tycho-testing-harness/src/main/java/org/eclipse/tycho/testing/TychoPlexusTestCase.java b/tycho-testing-harness/src/main/java/org/eclipse/tycho/testing/TychoPlexusTestCase.java index 43f931564c..4c92fa5847 100644 --- a/tycho-testing-harness/src/main/java/org/eclipse/tycho/testing/TychoPlexusTestCase.java +++ b/tycho-testing-harness/src/main/java/org/eclipse/tycho/testing/TychoPlexusTestCase.java @@ -19,7 +19,9 @@ import java.util.Date; import java.util.List; +import org.apache.maven.artifact.Artifact; import org.apache.maven.artifact.repository.ArtifactRepository; +import org.apache.maven.artifact.repository.layout.DefaultRepositoryLayout; import org.apache.maven.execution.MavenSession; import org.apache.maven.plugin.LegacySupport; import org.apache.maven.plugin.testing.stubs.StubArtifactRepository; @@ -66,7 +68,14 @@ public void setUpServiceAndSession() throws ComponentLookupException, IOExceptio LegacySupport legacySupport = lookup(LegacySupport.class); PlexusContainer container = ext.getContainer(); Settings settings = new Settings(); - ArtifactRepository localRepository = new StubArtifactRepository(temporaryFolder.newFolder().getAbsolutePath()); + ArtifactRepository localRepository = new StubArtifactRepository(temporaryFolder.newFolder().getAbsolutePath()) { + DefaultRepositoryLayout layout = new DefaultRepositoryLayout(); + + @Override + public String pathOf(Artifact artifact) { + return layout.pathOf(artifact); + } + }; MavenSession mavenSession = new MavenSession(container, settings, localRepository, null, null, List.of(), temporaryFolder.newFolder().getAbsolutePath(), System.getProperties(), System.getProperties(), new Date()); diff --git a/tycho-versions-plugin/pom.xml b/tycho-versions-plugin/pom.xml index 6aeadea264..3cadbf5b7c 100644 --- a/tycho-versions-plugin/pom.xml +++ b/tycho-versions-plugin/pom.xml @@ -19,6 +19,9 @@ tycho-versions-plugin maven-plugin + + ${minimal-maven-version} + Tycho Versions Plugin diff --git a/tycho-versions-plugin/src/main/java/org/eclipse/tycho/versions/UpdatePomMojo.java b/tycho-versions-plugin/src/main/java/org/eclipse/tycho/versions/UpdatePomMojo.java index 242481d63c..8cb3806e5d 100644 --- a/tycho-versions-plugin/src/main/java/org/eclipse/tycho/versions/UpdatePomMojo.java +++ b/tycho-versions-plugin/src/main/java/org/eclipse/tycho/versions/UpdatePomMojo.java @@ -13,14 +13,15 @@ package org.eclipse.tycho.versions; import java.io.IOException; +import java.util.Objects; -import org.apache.maven.execution.MavenSession; import org.apache.maven.plugin.AbstractMojo; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.MojoFailureException; import org.apache.maven.plugins.annotations.Component; import org.apache.maven.plugins.annotations.Mojo; import org.apache.maven.plugins.annotations.Parameter; +import org.apache.maven.project.MavenProject; import org.eclipse.tycho.versions.engine.PomVersionUpdater; import org.eclipse.tycho.versions.engine.ProjectMetadataReader; @@ -33,8 +34,8 @@ public class UpdatePomMojo extends AbstractMojo { private static final Object LOCK = new Object(); - @Parameter(property = "session", readonly = true) - protected MavenSession session; + @Parameter(defaultValue = "${project}", required = true, readonly = true) + private MavenProject project; @Component protected ProjectMetadataReader pomReader; @@ -46,7 +47,7 @@ public class UpdatePomMojo extends AbstractMojo { public void execute() throws MojoExecutionException, MojoFailureException { synchronized (LOCK) { try { - pomReader.addBasedir(session.getCurrentProject().getBasedir(), true); + pomReader.addBasedir(Objects.requireNonNullElse(project.getFile(), project.getBasedir()), true); pomUpdater.setProjects(pomReader.getProjects()); pomUpdater.apply(); } catch (IOException e) { diff --git a/tycho-versions-plugin/src/main/java/org/eclipse/tycho/versions/engine/ProjectMetadata.java b/tycho-versions-plugin/src/main/java/org/eclipse/tycho/versions/engine/ProjectMetadata.java index c2a541f018..e723668a7a 100644 --- a/tycho-versions-plugin/src/main/java/org/eclipse/tycho/versions/engine/ProjectMetadata.java +++ b/tycho-versions-plugin/src/main/java/org/eclipse/tycho/versions/engine/ProjectMetadata.java @@ -18,11 +18,13 @@ public class ProjectMetadata { private final File basedir; + private final File pomFile; private Map metadata = new LinkedHashMap<>(); - public ProjectMetadata(File basedir) { + public ProjectMetadata(File basedir, File pomFile) { this.basedir = basedir; + this.pomFile = pomFile; } public T getMetadata(Class type) { @@ -37,6 +39,10 @@ public File getBasedir() { return basedir; } + public File getPomFile() { + return pomFile; + } + @Override public String toString() { return basedir.toString(); diff --git a/tycho-versions-plugin/src/main/java/org/eclipse/tycho/versions/engine/ProjectMetadataReader.java b/tycho-versions-plugin/src/main/java/org/eclipse/tycho/versions/engine/ProjectMetadataReader.java index 1e7cca6435..fb5ec896d3 100644 --- a/tycho-versions-plugin/src/main/java/org/eclipse/tycho/versions/engine/ProjectMetadataReader.java +++ b/tycho-versions-plugin/src/main/java/org/eclipse/tycho/versions/engine/ProjectMetadataReader.java @@ -48,49 +48,41 @@ public void reset() { projects.clear(); } - public PomFile addBasedir(File basedir, boolean recursive) throws IOException { + public PomFile addBasedir(File file, boolean recursive) throws IOException { // Unfold configuration inheritance - - if (!basedir.exists()) { - log.info("Project does not exist at " + basedir); + if (!file.exists()) { + log.info("Project does not exist at " + file); return null; } - List modelprocessors; - try { - modelprocessors = container.lookupList(ModelProcessor.class); - } catch (ComponentLookupException e) { - throw new IOException("can't lookup ModelProcessors"); - } - // normalize basedir to allow modules that explicitly point at pom.xml file - if (basedir.isFile()) { - basedir = basedir.getParentFile(); + File pomFile; + File baseDir; + if (file.isFile()) { + pomFile = file; + baseDir = file.getParentFile(); + } else { + pomFile = lookupPomFile(file); + baseDir = file; } - if (projects.containsKey(basedir)) { + if (projects.containsKey(baseDir)) { return null; } - ProjectMetadata project = new ProjectMetadata(basedir); - File pomFile = null; - for (ModelProcessor modelProcessor : modelprocessors) { - File locatePom = modelProcessor.locatePom(basedir); - if (basedir.exists()) { - pomFile = locatePom; - break; - } - } - if (pomFile == null || !pomFile.exists() || pomFile.length() == 0) { - log.warn("No pom file found at " + basedir); + if (isInvalidPomFile(pomFile)) { + log.warn("No pom file found at " + baseDir); return null; } - projects.put(basedir, project); - PomFile pom = PomFile.read(pomFile, PomFile.POM_XML.equals(pomFile.getName())); + + ProjectMetadata project = new ProjectMetadata(baseDir, pomFile); + + projects.put(baseDir, project); + PomFile pom = PomFile.read(pomFile, pomFile.canWrite()); project.putMetadata(pom); if (recursive) { if (PACKAGING_POM.equals(pom.getPackaging())) { - for (File child : getChildren(basedir, pom)) { + for (File child : getChildren(baseDir, pom)) { addBasedir(child, recursive); } } @@ -102,7 +94,7 @@ public PomFile addBasedir(File basedir, boolean recursive) throws IOException { } //this case is required if a child module includes another parent that in fact then uses the parent from the tree //if we don't add this as well, the version update miss the indirectly referenced parent to be updated - File parentProjectPath = new File(basedir, relativePath); + File parentProjectPath = new File(baseDir, relativePath); if (parentProjectPath.exists()) { addBasedir(canonify(parentProjectPath), recursive); } @@ -111,6 +103,29 @@ public PomFile addBasedir(File basedir, boolean recursive) throws IOException { return pom; } + private File lookupPomFile(File basedir) throws IOException { + List modelprocessors; + try { + modelprocessors = container.lookupList(ModelProcessor.class); + } catch (ComponentLookupException e) { + throw new IOException("can't lookup ModelProcessors"); + } + + File pomFile = null; + for (ModelProcessor modelProcessor : modelprocessors) { + File locatePom = modelProcessor.locatePom(basedir); + if (locatePom.exists()) { + pomFile = locatePom; + break; + } + } + return pomFile; + } + + private boolean isInvalidPomFile(File pomFile) { + return pomFile == null || !pomFile.exists() || pomFile.length() == 0; + } + private Set getChildren(File basedir, PomFile project) throws IOException { LinkedHashSet children = new LinkedHashSet<>(); for (String module : project.getModules()) { @@ -132,5 +147,4 @@ public Collection getProjects() { private File canonify(File file) { return new File(file.toURI().normalize()); } - } diff --git a/tycho-versions-plugin/src/main/java/org/eclipse/tycho/versions/engine/VersionsEngine.java b/tycho-versions-plugin/src/main/java/org/eclipse/tycho/versions/engine/VersionsEngine.java index 945123ae3e..b8aed076c9 100644 --- a/tycho-versions-plugin/src/main/java/org/eclipse/tycho/versions/engine/VersionsEngine.java +++ b/tycho-versions-plugin/src/main/java/org/eclipse/tycho/versions/engine/VersionsEngine.java @@ -149,8 +149,8 @@ public void apply() throws IOException { // TODO property changes should be added as a new type of change in VersionChangeDescriptors for (PropertyChange propertyChange : propertyChanges) { if (pom == propertyChange.pom) { - ((PomManipulator) pomManipulator).applyPropertyChange(pom, propertyChange.propertyName, - propertyChange.propertyValue); + ((PomManipulator) pomManipulator).applyPropertyChange(project.getPomFile().getName(), pom, + propertyChange.propertyName, propertyChange.propertyValue); } } diff --git a/tycho-versions-plugin/src/main/java/org/eclipse/tycho/versions/manipulation/PomManipulator.java b/tycho-versions-plugin/src/main/java/org/eclipse/tycho/versions/manipulation/PomManipulator.java index d73d4d568f..8977e9928b 100644 --- a/tycho-versions-plugin/src/main/java/org/eclipse/tycho/versions/manipulation/PomManipulator.java +++ b/tycho-versions-plugin/src/main/java/org/eclipse/tycho/versions/manipulation/PomManipulator.java @@ -77,6 +77,7 @@ public void applyChanges(ProjectMetadata project, VersionChangesDescriptor versi if (!pom.isMutable()) { return; } + String pomName = project.getPomFile().getName(); // TODO visitor pattern is a better way to implement this for (PomVersionChange change : versionChangeContext.getVersionChanges()) { @@ -93,7 +94,7 @@ public void applyChanges(ProjectMetadata project, VersionChangesDescriptor versi } if (ciFriendlyProperties.size() == 1) { //thats actually a simply property change - applyPropertyChange(pom, ciFriendlyProperties.get(0), newVersion); + applyPropertyChange(pomName, pom, ciFriendlyProperties.get(0), newVersion); } else { String update = newVersion; //now the hard part starts, we need to match the pattern, the current algorithm is just dumb and only updates the first non matching property @@ -105,18 +106,19 @@ public void applyChanges(ProjectMetadata project, VersionChangesDescriptor versi update = update.substring(0, update.length() - value.length()); continue; } - applyPropertyChange(pom, property, update); + applyPropertyChange(pomName, pom, property, update); break; } } } else { - logger.info(" pom.xml//project/version: " + version + " => " + newVersion); + logger.info(" %s//project/version: %s => %s".formatted(pomName, version, newVersion)); pom.setVersion(newVersion); } } else { + GAV parent = pom.getParent(); if (parent != null && isGavEquals(parent, change) && !isCiFriendly(parent.getVersion())) { - logger.info(" pom.xml//project/parent/version: " + version + " => " + newVersion); + logger.info(" %s//project/version: %s => %s".formatted(pomName, version, newVersion)); parent.setVersion(newVersion); } } @@ -128,15 +130,16 @@ public void applyChanges(ProjectMetadata project, VersionChangesDescriptor versi // it. // - changeDependencies(" pom.xml//project/dependencies", pom.getDependencies(), change, version, newVersion); - changeDependencyManagement(" pom.xml//project/dependencyManagement", pom.getDependencyManagement(), change, - version, newVersion); + changeDependencies(" %s//project/dependencies".formatted(pomName), pom.getDependencies(), change, version, + newVersion); + changeDependencyManagement(" %s//project/dependencyManagement".formatted(pomName), + pom.getDependencyManagement(), change, version, newVersion); - changeBuild(" pom.xml//project/build", pom.getBuild(), change, version, newVersion); + changeBuild(" //project/build".formatted(pomName), pom.getBuild(), change, version, newVersion); for (Profile profile : pom.getProfiles()) { String profileId = profile.getId() != null ? profile.getId() : NULL; - String pomPath = " pom.xml//project/profiles/profile[ " + profileId + " ]"; + String pomPath = " %s//project/profiles/profile[ %s ]".formatted(pomName, profileId); changeDependencies(pomPath + "/dependencies", profile.getDependencies(), change, version, newVersion); changeDependencyManagement(pomPath + "/dependencyManagement", profile.getDependencyManagement(), change, version, newVersion); @@ -232,16 +235,17 @@ public static boolean isPluginGavEquals(GAV gav, PomVersionChange change) { @Override public void writeMetadata(ProjectMetadata project) throws IOException { PomFile pom = project.getMetadata(PomFile.class); - File pomFile = new File(project.getBasedir(), "pom.xml"); + File pomFile = project.getPomFile(); if (pom != null && pomFile.exists()) { PomFile.write(pom, pomFile); } } - public void applyPropertyChange(PomFile pom, String propertyName, String propertyValue) { - changeProperties(" pom.xml//project/properties", pom.getProperties(), propertyName, propertyValue); + public void applyPropertyChange(String pomName, PomFile pom, String propertyName, String propertyValue) { + changeProperties(" %s//project/properties".formatted(pomName), pom.getProperties(), propertyName, + propertyValue); for (Profile profile : pom.getProfiles()) { - String pomPath = " pom.xml//project/profiles/profile[ " + profile.getId() + " ]/properties"; + String pomPath = " %s//project/profiles/profile[ %s ]/properties".formatted(pomName, profile.getId()); changeProperties(pomPath, profile.getProperties(), propertyName, propertyValue); } }