[tycho] Merge mizdebsk patch with existing custom resolver patch.
Roland Grunberg
rgrunber at fedoraproject.org
Mon Mar 18 16:46:00 UTC 2013
commit f4c66702b89ef49b940ec804cda6905c089f857e
Author: Krzysztof Daniel <kdaniel at redhat.com>
Date: Mon Mar 18 12:39:27 2013 -0400
Merge mizdebsk patch with existing custom resolver patch.
tycho-use-custom-resolver.patch | 42 ++++++++++++++--------
tycho-use-plexus-to-create-workspacereader.patch | 36 ------------------
tycho.spec | 9 +++--
3 files changed, 32 insertions(+), 55 deletions(-)
---
diff --git a/tycho-use-custom-resolver.patch b/tycho-use-custom-resolver.patch
index b251c1b..5c0b6b4 100644
--- a/tycho-use-custom-resolver.patch
+++ b/tycho-use-custom-resolver.patch
@@ -1,4 +1,4 @@
-From 3f7a7496cb2038b7840bd5983df1a339723fce52 Mon Sep 17 00:00:00 2001
+From e27cbf1ed27cbe225d92510f4e9afd5088d36dce Mon Sep 17 00:00:00 2001
From: Roland Grunberg <rgrunber at redhat.com>
Date: Tue, 12 Jun 2012 10:38:51 -0400
Subject: [PATCH] Implement a custom resolver for Tycho in local mode.
@@ -29,9 +29,9 @@ Change-Id: Ia1ece07ece2412bc4a88901631f3f651ad2b634b
.../tycho/core/osgitools/AbstractTychoProject.java | 24 ++++++++++
.../tycho/core/osgitools/OsgiBundleProject.java | 29 +++++++++++-
.../DefaultTargetPlatformConfigurationReader.java | 6 ++-
- .../osgi/runtime/TychoOsgiRuntimeLocator.java | 12 +++++
+ .../osgi/runtime/TychoOsgiRuntimeLocator.java | 17 +++++++
.../p2/resolver/P2TargetPlatformResolver.java | 11 +++++
- 10 files changed, 160 insertions(+), 11 deletions(-)
+ 10 files changed, 165 insertions(+), 11 deletions(-)
diff --git a/tycho-bundles/org.eclipse.tycho.p2.resolver.impl/src/main/java/org/eclipse/tycho/p2/target/TargetDefinitionResolver.java b/tycho-bundles/org.eclipse.tycho.p2.resolver.impl/src/main/java/org/eclipse/tycho/p2/target/TargetDefinitionResolver.java
index 6ea8a81..e90d279 100644
@@ -332,29 +332,41 @@ index 63dba63..d292773 100644
setTargetPlatformResolver(result, configuration);
diff --git a/tycho-core/src/main/java/org/eclipse/tycho/osgi/runtime/TychoOsgiRuntimeLocator.java b/tycho-core/src/main/java/org/eclipse/tycho/osgi/runtime/TychoOsgiRuntimeLocator.java
-index 1e878e5..19db009 100644
+index 1e878e5..2de11ad 100644
--- a/tycho-core/src/main/java/org/eclipse/tycho/osgi/runtime/TychoOsgiRuntimeLocator.java
+++ b/tycho-core/src/main/java/org/eclipse/tycho/osgi/runtime/TychoOsgiRuntimeLocator.java
-@@ -38,6 +38,9 @@ import org.eclipse.sisu.equinox.embedder.EquinoxRuntimeLocator;
+@@ -38,6 +38,8 @@ import org.eclipse.sisu.equinox.embedder.EquinoxRuntimeLocator;
import org.eclipse.tycho.dev.DevWorkspaceResolver;
import org.eclipse.tycho.locking.facade.FileLockService;
import org.eclipse.tycho.locking.facade.FileLocker;
+import org.sonatype.aether.util.artifact.DefaultArtifact;
-+
-+import org.fedoraproject.maven.resolver.DefaultResolver;
++import org.sonatype.aether.repository.WorkspaceReader;
/**
* Implementation of {@link org.eclipse.sisu.equinox.embedder.EquinoxRuntimeLocator} for Tycho's
-@@ -201,6 +204,15 @@ public class TychoOsgiRuntimeLocator implements EquinoxRuntimeLocator {
+@@ -94,6 +96,9 @@ public class TychoOsgiRuntimeLocator implements EquinoxRuntimeLocator {
+ @Requirement
+ private DevWorkspaceResolver workspaceState;
+
++ @Requirement(hint = "ide")
++ private WorkspaceReader workspaceReader;
++
+ public void locateRuntime(EquinoxRuntimeDescription description) throws MavenExecutionException {
+ WorkspaceTychoOsgiRuntimeLocator workspaceLocator = WorkspaceTychoOsgiRuntimeLocator
+ .getResolver(this.workspaceState);
+@@ -201,6 +206,18 @@ public class TychoOsgiRuntimeLocator implements EquinoxRuntimeLocator {
Artifact artifact = repositorySystem.createArtifact(dependency.getGroupId(), dependency.getArtifactId(),
dependency.getVersion(), dependency.getType());
-+ // If we are in local mode, find the artifact on the system
-+ if (System.getenv("TYCHO_MVN_LOCAL") != null || System.getenv("TYCHO_MVN_RPMBUILD") != null) {
-+ DefaultResolver resolver = new DefaultResolver();
-+ File file = resolver.resolve(artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion(), artifact.getType());
-+ if (file != null) {
-+ artifact.setFile(file);
++ if (workspaceReader != null) {
++ DefaultArtifact newArtifact = new DefaultArtifact(artifact.getGroupId()
++ + ":" + artifact.getArtifactId()
++ + ":" + artifact.getType()
++ + ":" + artifact.getVersion());
++
++ File artifactFile = workspaceReader.findArtifact(newArtifact);
++ if (artifactFile != null) {
++ artifact.setFile(artifactFile);
+ }
+ }
+
@@ -384,5 +396,5 @@ index d6cbc6d..85e2c0d 100644
addOtherReactorProjectsToTargetPlatform(project, reactorProjects, tpBuilder);
--
-1.7.11.7
+1.8.1.4
diff --git a/tycho.spec b/tycho.spec
index ad7a7d7..08d6003 100644
--- a/tycho.spec
+++ b/tycho.spec
@@ -1,6 +1,6 @@
# Bootstrap build
# Set this if Tycho and Eclipse are not in buildroot
-%global bootstrap 0
+%global bootstrap 1
# When building version under development (non-release)
%global snap -SNAPSHOT
@@ -8,7 +8,7 @@
Name: tycho
Version: 0.17.0
-Release: 0.9.git3351b1%{?dist}
+Release: 0.10.git3351b1%{?dist}
Summary: Plugins and extensions for building Eclipse plugins and OSGI bundles with Maven
Group: Development/Libraries
@@ -45,7 +45,6 @@ Patch5: %{name}-set-reactor-cache-version.patch
Patch6: %{name}-remove-units.patch
# Additional changes needed just for bootstrap build
Patch7: %{name}-fix-bootstrap-build.patch
-Patch8: %{name}-use-plexus-to-create-workspacereader.patch
BuildArch: noarch
@@ -131,7 +130,6 @@ This package contains the API documentation for %{name}.
%patch1 -p1
%patch2 -p1
%patch3 -p1
-%patch8 -p1
find tycho-core -iname '*html' -delete
@@ -269,6 +267,9 @@ install -m 644 $osgiJarPath $RPM_BUILD_ROOT%{_javadir}/%{name}/osgi.jar
%{_javadocdir}/%{name}
%changelog
+* Mon Mar 18 2013 Krzysztof Daniel <kdaniel at redhat.com> 0.17.0-0.10.git3351b1
+- Merge mizdebsk patch with existing custom resolver patch.
+
* Mon Mar 18 2013 Krzysztof Daniel <kdaniel at redhat.com> 0.17.0-0.9.git3351b1
- Move the patch into better place.
More information about the scm-commits
mailing list