Blame SOURCES/tycho-extras-use-custom-resolver.patch

b314cc
From 1136a52447b28da1dfa29c46b8ba025435a798be Mon Sep 17 00:00:00 2001
b314cc
From: Roland Grunberg <rgrunber@redhat.com>
b314cc
Date: Mon, 6 May 2013 14:20:58 -0400
b314cc
Subject: [PATCH] Use custom resolver for tycho-eclipserun-plugin.
b314cc
b314cc
Add various system local OSGi bundle locations to the target platform
b314cc
used by tycho-eclipserun-plugin.
b314cc
b314cc
Change-Id: Ifd0aae3f32c8077cd0ae33e70f40698c1129788d
b314cc
---
b314cc
 tycho-eclipserun-plugin/pom.xml                                |  5 +++++
b314cc
 .../org/eclipse/tycho/extras/eclipserun/EclipseRunMojo.java    | 10 ++++++++++
b314cc
 2 files changed, 15 insertions(+)
b314cc
b314cc
diff --git a/tycho-eclipserun-plugin/pom.xml b/tycho-eclipserun-plugin/pom.xml
b314cc
index 708b35c..c4e9b17 100644
b314cc
--- a/tycho-eclipserun-plugin/pom.xml
b314cc
+++ b/tycho-eclipserun-plugin/pom.xml
b314cc
@@ -38,6 +38,11 @@
b314cc
 			<groupId>org.eclipse.tycho.extras</groupId>
b314cc
 			<artifactId>tycho-p2-extras-plugin</artifactId>
b314cc
 		</dependency>
b314cc
+                <dependency>
b314cc
+			<groupId>org.fedoraproject.p2</groupId>
b314cc
+			<artifactId>org.fedoraproject.p2</artifactId>
b314cc
+			<version>0.0.1-SNAPSHOT</version>
b314cc
+		</dependency>
b314cc
 	</dependencies>
b314cc
 	<profiles>
b314cc
 		<profile>
b314cc
diff --git a/tycho-eclipserun-plugin/src/main/java/org/eclipse/tycho/extras/eclipserun/EclipseRunMojo.java b/tycho-eclipserun-plugin/src/main/java/org/eclipse/tycho/extras/eclipserun/EclipseRunMojo.java
b314cc
index 4c4baf0..18db847 100644
b314cc
--- a/tycho-eclipserun-plugin/src/main/java/org/eclipse/tycho/extras/eclipserun/EclipseRunMojo.java
b314cc
+++ b/tycho-eclipserun-plugin/src/main/java/org/eclipse/tycho/extras/eclipserun/EclipseRunMojo.java
b314cc
@@ -13,6 +13,7 @@ package org.eclipse.tycho.extras.eclipserun;
b314cc
 
b314cc
 import java.io.File;
b314cc
 import java.net.MalformedURLException;
b314cc
+import java.net.URI;
b314cc
 import java.util.ArrayList;
b314cc
 import java.util.List;
b314cc
 import java.util.Map;
b314cc
@@ -51,6 +52,7 @@ import org.eclipse.tycho.p2.resolver.facade.P2Resolver;
b314cc
 import org.eclipse.tycho.p2.resolver.facade.P2ResolverFactory;
b314cc
 import org.eclipse.tycho.p2.target.facade.TargetPlatformConfigurationStub;
b314cc
 import org.eclipse.tycho.plugins.p2.extras.Repository;
b314cc
+import org.fedoraproject.p2.EclipseSystemLayout;
b314cc
 
b314cc
 /**
b314cc
  * Launch an eclipse process with arbitrary commandline arguments. The eclipse installation is
b314cc
@@ -187,6 +189,14 @@ public class EclipseRunMojo extends AbstractMojo {
b314cc
         TargetPlatformConfigurationStub tpConfiguration = new TargetPlatformConfigurationStub();
b314cc
         // we want to resolve from remote repos only
b314cc
         tpConfiguration.setForceIgnoreLocalArtifacts(true);
b314cc
+
b314cc
+        // Add Fedora Local P2 Repository when running in local mode
b314cc
+        if (System.getProperty("TYCHO_MVN_LOCAL") != null || System.getProperty("TYCHO_MVN_RPMBUILD") != null) {
b314cc
+            for (URI uri : EclipseSystemLayout.getRepositories()) {
b314cc
+                tpConfiguration.addP2Repository(new MavenRepositoryLocation(uri.getPath(), uri));
b314cc
+            }
b314cc
+        }
b314cc
+
b314cc
         for (Repository repository : repositories) {
b314cc
             tpConfiguration.addP2Repository(new MavenRepositoryLocation(repository.getId(), repository.getLocation()));
b314cc
         }
b314cc
-- 
b314cc
1.9.3
b314cc