[tycho/f17] Non-bootstrap build.
by Roland Grunberg
commit fca17a767a08bbeb7b0852d639fc19d91a075ac1
Author: Roland Grunberg <rgrunber(a)redhat.com>
Date: Mon Jun 11 15:18:19 2012 -0400
Non-bootstrap build.
tycho.spec | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/tycho.spec b/tycho.spec
index 72bbe9a..576ca87 100644
--- a/tycho.spec
+++ b/tycho.spec
@@ -1,5 +1,5 @@
%global eclipsedir %{_libdir}/eclipse
-%global bootstrap 1
+%global bootstrap 0
%if %{bootstrap}
%global snap -SNAPSHOT
@@ -9,7 +9,7 @@
Name: tycho
Version: 0.14.1
-Release: 4.1%{?dist}
+Release: 5%{?dist}
Summary: Plugins and extensions for building Eclipse plugins and OSGI bundles with Maven
Group: Development/Libraries
@@ -197,6 +197,9 @@ install -pm 755 %{SOURCE3} %{buildroot}%{_javadir}/%{name}/copy-platform-all
%{_javadocdir}/%{name}
%changelog
+* Mon Jun 11 2012 Roland Grunberg <rgrunber(a)redhat.com> 0.14.1-5
+- Non-bootstrap build.
+
* Tue May 29 2012 Roland Grunberg <rgrunber(a)redhat.com> 0.14.1-4.1
- Fix Tycho Surfire to run Eclipse test bundles.
- Implement automatic creation of a system p2 repository.
11 years, 10 months
[tycho/f17] Only create system p2 repository when running in local mode.
by Roland Grunberg
commit 1c43d75aec63de6a71b836244af44b7f4c3562fb
Author: Roland Grunberg <rgrunber(a)redhat.com>
Date: Mon Jun 11 15:00:17 2012 -0400
Only create system p2 repository when running in local mode.
tycho-use-custom-resolver.patch | 30 ++++++++++++++++--------------
1 files changed, 16 insertions(+), 14 deletions(-)
---
diff --git a/tycho-use-custom-resolver.patch b/tycho-use-custom-resolver.patch
index 1e3992d..db8b4b3 100644
--- a/tycho-use-custom-resolver.patch
+++ b/tycho-use-custom-resolver.patch
@@ -1,4 +1,4 @@
-From 590e6eb40fb807c5b45c8360b80b7a12185b37a6 Mon Sep 17 00:00:00 2001
+From 7d87e41ad0f3356b74d93be8588ef69539edcc91 Mon Sep 17 00:00:00 2001
From: Roland Grunberg <rgrunber(a)redhat.com>
Date: Thu, 7 Jun 2012 16:41:33 -0400
Subject: [PATCH] Implement a custom resolver for Tycho in local mode.
@@ -20,11 +20,11 @@ Change-Id: I0609a1caecad753d811c5a93183547b33737657f
---
.../tycho/p2/target/TargetDefinitionResolver.java | 8 +++-
.../tycho/p2/target/TargetPlatformBuilderImpl.java | 5 +++
- .../core/maven/TychoMavenLifecycleParticipant.java | 13 +++++++
+ .../core/maven/TychoMavenLifecycleParticipant.java | 15 ++++++++
.../tycho/core/osgitools/OsgiBundleProject.java | 38 +++++++++++++++++++-
.../tycho/osgi/runtime/TychoP2RuntimeLocator.java | 17 +++++++++
.../p2/resolver/P2TargetPlatformResolver.java | 10 +++++
- 6 files changed, 88 insertions(+), 3 deletions(-)
+ 6 files changed, 90 insertions(+), 3 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 2d7d3b9..c628e6e 100644
@@ -69,7 +69,7 @@ index 9da87bb..5785029 100644
metadataRepository = metadataRepositoryManager.loadRepository(location, monitor);
metadataRepositories.add(metadataRepository);
diff --git a/tycho-core/src/main/java/org/eclipse/tycho/core/maven/TychoMavenLifecycleParticipant.java b/tycho-core/src/main/java/org/eclipse/tycho/core/maven/TychoMavenLifecycleParticipant.java
-index 80810d6..e3c6732 100644
+index 80810d6..24efc87 100644
--- a/tycho-core/src/main/java/org/eclipse/tycho/core/maven/TychoMavenLifecycleParticipant.java
+++ b/tycho-core/src/main/java/org/eclipse/tycho/core/maven/TychoMavenLifecycleParticipant.java
@@ -11,6 +11,7 @@
@@ -80,20 +80,22 @@ index 80810d6..e3c6732 100644
import java.util.List;
import org.apache.maven.AbstractMavenLifecycleParticipant;
-@@ -51,6 +52,18 @@ public class TychoMavenLifecycleParticipant extends AbstractMavenLifecyclePartic
+@@ -51,6 +52,20 @@ public class TychoMavenLifecycleParticipant extends AbstractMavenLifecyclePartic
registerExecutionListener(session);
configureComponents(session);
+ // Create a system p2 repository for local dependency resolution
-+ try {
-+ String[] cmd = new String[] { "/usr/share/java/tycho/copy-platform-all",
-+ System.getProperty("user.dir") + "/.m2/p2/repo" };
-+ Process p = Runtime.getRuntime().exec(cmd);
-+ p.waitFor();
-+ } catch (IOException e) {
-+ // Continue
-+ } catch (InterruptedException e) {
-+ // Continue
++ if (System.getProperty("maven.local.mode") != null) {
++ try {
++ String[] cmd = new String[] { "/usr/share/java/tycho/copy-platform-all",
++ System.getProperty("user.dir") + "/.m2/p2/repo" };
++ Process p = Runtime.getRuntime().exec(cmd);
++ p.waitFor();
++ } catch (IOException e) {
++ // Continue
++ } catch (InterruptedException e) {
++ // Continue
++ }
+ }
+
List<MavenProject> projects = session.getProjects();
11 years, 10 months
[tycho/f17] Allow for building SWT fragments (BZ #380934).
by Roland Grunberg
commit 350cd55d4c8fc6c92d70011ef02db091da1da0ad
Author: Roland Grunberg <rgrunber(a)redhat.com>
Date: Mon Jun 11 11:43:44 2012 -0400
Allow for building SWT fragments (BZ #380934).
tycho-fix-swt.patch | 129 +++++++++++++++++++++++++++++++++++++++++++++++++++
tycho.spec | 7 ++-
2 files changed, 134 insertions(+), 2 deletions(-)
---
diff --git a/tycho-fix-swt.patch b/tycho-fix-swt.patch
new file mode 100644
index 0000000..f28a984
--- /dev/null
+++ b/tycho-fix-swt.patch
@@ -0,0 +1,129 @@
+From 198ef97930794f59230035f350f286255ea63c61 Mon Sep 17 00:00:00 2001
+From: Igor Fedorenko <igor(a)ifedorenko.com>
+Date: Wed, 30 May 2012 10:01:36 -0400
+Subject: [PATCH] 380934 do not 'fixSWT' for swt fragment projects
+
+Change-Id: I2990ff68acfe14e104480ba85ce30c2138d74e45
+Signed-off-by: Igor Fedorenko <igor(a)ifedorenko.com>
+---
+ .../swt/org.eclipse.swt/META-INF/MANIFEST.MF | 4 ++
+ .../resolver/swt/swtFragment/META-INF/MANIFEST.MF | 6 ++
+ .../tycho/p2/impl/resolver/P2ResolverTest.java | 54 ++++++++++++++++++++
+ .../impl/resolver/ProjectorResolutionStrategy.java | 12 ++++
+ 4 files changed, 76 insertions(+), 0 deletions(-)
+ create mode 100644 tycho-bundles/org.eclipse.tycho.p2.resolver.impl.test/resources/resolver/swt/org.eclipse.swt/META-INF/MANIFEST.MF
+ create mode 100644 tycho-bundles/org.eclipse.tycho.p2.resolver.impl.test/resources/resolver/swt/swtFragment/META-INF/MANIFEST.MF
+
+diff --git a/tycho-bundles/org.eclipse.tycho.p2.resolver.impl.test/resources/resolver/swt/org.eclipse.swt/META-INF/MANIFEST.MF b/tycho-bundles/org.eclipse.tycho.p2.resolver.impl.test/resources/resolver/swt/org.eclipse.swt/META-INF/MANIFEST.MF
+new file mode 100644
+index 0000000..b2eda0d
+--- /dev/null
++++ b/tycho-bundles/org.eclipse.tycho.p2.resolver.impl.test/resources/resolver/swt/org.eclipse.swt/META-INF/MANIFEST.MF
+@@ -0,0 +1,4 @@
++Manifest-Version: 1.0
++Bundle-ManifestVersion: 2
++Bundle-SymbolicName: org.eclipse.swt
++Bundle-Version: 3.0.0.qualifier
+diff --git a/tycho-bundles/org.eclipse.tycho.p2.resolver.impl.test/resources/resolver/swt/swtFragment/META-INF/MANIFEST.MF b/tycho-bundles/org.eclipse.tycho.p2.resolver.impl.test/resources/resolver/swt/swtFragment/META-INF/MANIFEST.MF
+new file mode 100644
+index 0000000..380c312
+--- /dev/null
++++ b/tycho-bundles/org.eclipse.tycho.p2.resolver.impl.test/resources/resolver/swt/swtFragment/META-INF/MANIFEST.MF
+@@ -0,0 +1,6 @@
++Manifest-Version: 1.0
++Bundle-ManifestVersion: 2
++Bundle-Name: org.eclipse.tycho.p2.impl.resolver.test.swtFragment
++Bundle-SymbolicName: org.eclipse.tycho.p2.impl.resolver.swtFragment
++Bundle-Version: 1.0.0.qualifier
++Fragment-Host: org.eclipse.swt; bundle-version="[3.0.0,4.0.0)"
+diff --git a/tycho-bundles/org.eclipse.tycho.p2.resolver.impl.test/src/test/java/org/eclipse/tycho/p2/impl/resolver/P2ResolverTest.java b/tycho-bundles/org.eclipse.tycho.p2.resolver.impl.test/src/test/java/org/eclipse/tycho/p2/impl/resolver/P2ResolverTest.java
+index 7d5ea2d..cc7baf4 100644
+--- a/tycho-bundles/org.eclipse.tycho.p2.resolver.impl.test/src/test/java/org/eclipse/tycho/p2/impl/resolver/P2ResolverTest.java
++++ b/tycho-bundles/org.eclipse.tycho.p2.resolver.impl.test/src/test/java/org/eclipse/tycho/p2/impl/resolver/P2ResolverTest.java
+@@ -222,6 +222,60 @@ public class P2ResolverTest extends P2ResolverTestBase {
+ assertContainsUnit("org.eclipse.swt.gtk.linux.x86_64", result.getNonReactorUnits());
+ }
+
++ @Test
++ public void swt() throws Exception {
++ File swt = resourceFile("resolver/swt/org.eclipse.swt");
++ addReactorProject(swt, TYPE_ECLIPSE_PLUGIN, "org.eclipse.swt");
++ File swtFragment = resourceFile("resolver/swt/swtFragment");
++ addReactorProject(swtFragment, TYPE_ECLIPSE_PLUGIN, "org.eclipse.tycho.p2.impl.resolver.test.swtFragment");
++
++ List<P2ResolutionResult> results = impl.resolveProject(context.buildTargetPlatform(), swt);
++
++ Assert.assertEquals(1, results.size());
++ P2ResolutionResult result = results.get(0);
++
++ Assert.assertEquals(1, result.getArtifacts().size());
++ assertContainLocation(result, swt);
++ }
++
++ @Test
++ public void swtFragment() throws Exception {
++ File swt = resourceFile("resolver/swt/org.eclipse.swt");
++ addReactorProject(swt, TYPE_ECLIPSE_PLUGIN, "org.eclipse.swt");
++ File swtFragment = resourceFile("resolver/swt/swtFragment");
++ addReactorProject(swtFragment, TYPE_ECLIPSE_PLUGIN, "org.eclipse.tycho.p2.impl.resolver.test.swtFragment");
++
++ List<P2ResolutionResult> results = impl.resolveProject(context.buildTargetPlatform(), swtFragment);
++
++ Assert.assertEquals(1, results.size());
++ P2ResolutionResult result = results.get(0);
++
++ Assert.assertEquals(2, result.getArtifacts().size());
++ Assert.assertEquals(0, result.getNonReactorUnits().size());
++
++ assertContainLocation(result, swtFragment);
++ assertContainLocation(result, swt);
++ }
++
++ @Test
++ public void swtFragmentWithRemoteSWT() throws Exception {
++ context.addP2Repository(resourceFile("repositories/e361").toURI());
++
++ File swtFragment = resourceFile("resolver/swt/swtFragment");
++ addReactorProject(swtFragment, TYPE_ECLIPSE_PLUGIN, "org.eclipse.tycho.p2.impl.resolver.test.swtFragment");
++
++ List<P2ResolutionResult> results = impl.resolveProject(context.buildTargetPlatform(), swtFragment);
++
++ Assert.assertEquals(1, results.size());
++ P2ResolutionResult result = results.get(0);
++
++ Assert.assertEquals(2, result.getArtifacts().size());
++ Assert.assertEquals(1, result.getNonReactorUnits().size());
++
++ assertContainLocation(result, swtFragment);
++ assertContainsUnit("org.eclipse.swt", result.getNonReactorUnits());
++ }
++
+ private static void assertContainsUnit(String unitID, Set<?> units) {
+ Assert.assertFalse("Unit " + unitID + " not found", getInstallableUnits(unitID, units).isEmpty());
+ }
+diff --git a/tycho-bundles/org.eclipse.tycho.p2.resolver.impl/src/main/java/org/eclipse/tycho/p2/impl/resolver/ProjectorResolutionStrategy.java b/tycho-bundles/org.eclipse.tycho.p2.resolver.impl/src/main/java/org/eclipse/tycho/p2/impl/resolver/ProjectorResolutionStrategy.java
+index 3d0f3db..c5bf797 100644
+--- a/tycho-bundles/org.eclipse.tycho.p2.resolver.impl/src/main/java/org/eclipse/tycho/p2/impl/resolver/ProjectorResolutionStrategy.java
++++ b/tycho-bundles/org.eclipse.tycho.p2.resolver.impl/src/main/java/org/eclipse/tycho/p2/impl/resolver/ProjectorResolutionStrategy.java
+@@ -110,6 +110,18 @@ public class ProjectorResolutionStrategy extends AbstractSlicerResolutionStrateg
+ return;
+ }
+
++ // 380934 one of rootIUs can be SWT or an SWT fragment
++ for (IInstallableUnit iu : rootIUs) {
++ if ("org.eclipse.swt".equals(iu.getId())) {
++ return;
++ }
++ for (IProvidedCapability provided : iu.getProvidedCapabilities()) {
++ if ("osgi.fragment".equals(provided.getNamespace()) && "org.eclipse.swt".equals(provided.getName())) {
++ return;
++ }
++ }
++ }
++
+ IInstallableUnit swtFragment = null;
+
+ all_ius: for (Iterator<IInstallableUnit> iter = availableIUs.query(QueryUtil.ALL_UNITS, monitor).iterator(); iter
+--
+1.7.7.6
+
diff --git a/tycho.spec b/tycho.spec
index 9621a35..72bbe9a 100644
--- a/tycho.spec
+++ b/tycho.spec
@@ -30,11 +30,12 @@ Source3: copy-platform-all
Patch0: %{name}-fix-build.patch
Patch1: %{name}-fix-surefire.patch
Patch2: %{name}-use-custom-resolver.patch
+Patch3: %{name}-fix-swt.patch
# Set some temporary build version so that the bootstrapped build has
# a different version from the nonbootstrapped. Otherwise there will
# be cyclic dependencies.
%if %{bootstrap}
-Patch3: %{name}-bootstrap.patch
+Patch4: %{name}-bootstrap.patch
%endif
BuildArch: noarch
@@ -112,8 +113,9 @@ This package contains the API documentation for %{name}.
%patch0 -p2
%patch1 -p1
%patch2 -p1
-%if %{bootstrap}
%patch3 -p1
+%if %{bootstrap}
+%patch4 -p1
%endif
find tycho-core -iname '*html' -delete
@@ -198,6 +200,7 @@ install -pm 755 %{SOURCE3} %{buildroot}%{_javadir}/%{name}/copy-platform-all
* Tue May 29 2012 Roland Grunberg <rgrunber(a)redhat.com> 0.14.1-4.1
- Fix Tycho Surfire to run Eclipse test bundles.
- Implement automatic creation of a system p2 repository.
+- Allow building SWT fragments (BZ #380934).
* Wed May 23 2012 Roland Grunberg <rgrunber(a)redhat.com> 0.14.1-4
- Non-bootstrap build.
11 years, 10 months
[tycho/f17] Implement automatic creation of a system p2 repository.
by Roland Grunberg
commit c658ed4f347e58515eba363d7faa7bb328d0a2f2
Author: Roland Grunberg <rgrunber(a)redhat.com>
Date: Mon Jun 11 13:14:37 2012 -0400
Implement automatic creation of a system p2 repository.
Automatically create a local p2 repository of all bundles on the system
so that they may be used for local dependency resolution. This is done
using a modified version of Eclipse's copy-platform script.
copy-platform-all | 95 ++++++++++++++++++++++
tycho-use-custom-resolver.patch | 167 +++++++++++++++++++++++++++++----------
tycho.spec | 3 +
3 files changed, 223 insertions(+), 42 deletions(-)
---
diff --git a/copy-platform-all b/copy-platform-all
new file mode 100755
index 0000000..0adfd14
--- /dev/null
+++ b/copy-platform-all
@@ -0,0 +1,95 @@
+#! /bin/sh
+
+where=$1'-sdk'
+repo=$1; shift
+eclipse=$(rpm --eval '%{_eclipse_base}'); shift
+
+datadir=/usr/share/eclipse
+
+mkdir -p $where/plugins $where/features
+pushd $where
+
+ (cd $eclipse;
+ ls -d plugins/* features/* 2>/dev/null) |
+ while read f; do
+ [ ! -e $f ] && ln -s $eclipse/$f $f
+ done
+ (cd $eclipse/dropins; ls -d * 2>/dev/null) |
+ while read f; do
+ if [ -e $eclipse/dropins/$f/eclipse ]; then
+ (cd $eclipse/dropins/$f/eclipse;
+ ls -d plugins/* features/* 2>/dev/null) |
+ while read g; do
+ [ ! -e $g ] && \
+ ln -s $eclipse/dropins/$f/eclipse/$g $g
+ done
+ else
+ (cd $eclipse/dropins/$f;
+ ls -d plugins/* features/* 2>/dev/null) |
+ while read g; do
+ [ ! -e $g ] && \
+ ln -s $eclipse/dropins/$f/$g $g
+ done
+ fi
+ done
+ (cd $datadir/dropins; ls -d * 2>/dev/null) |
+ while read f; do
+ if [ -e $datadir/dropins/$f/eclipse ]; then
+ (cd $datadir/dropins/$f/eclipse;
+ ls -d plugins/* features/* 2>/dev/null) |
+ while read g; do
+ [ ! -e $g ] && \
+ ln -s $datadir/dropins/$f/eclipse/$g $g
+ done
+ else
+ (cd $datadir/dropins/$f;
+ ls -d plugins/* features/* 2>/dev/null) |
+ while read g; do
+ [ ! -e $g ] && \
+ ln -s $datadir/dropins/$g $g
+ done
+ fi
+ done
+
+for p in $(ls -d $eclipse/dropins/jdt/plugins/*); do
+ plugin=$(basename $p)
+ [ ! -e plugins/$plugin ] && ln -s $eclipse/dropins/jdt/plugins/$plugin plugins/$plugin
+done
+for f in $(ls -d $eclipse/dropins/jdt/features/*); do
+ feature=$(basename $f)
+ [ ! -e features/$feature ] && ln -s $eclipse/dropins/jdt/features/$feature features/$feature
+done
+for p in $(ls -d $eclipse/dropins/sdk/plugins/*); do
+ plugin=$(basename $p)
+ [ ! -e plugins/$plugin ] && ln -s $eclipse/dropins/sdk/plugins/$plugin plugins/$plugin
+done
+for f in $(ls -d $eclipse/dropins/sdk/features/*); do
+ feature=$(basename $f)
+ [ ! -e features/$feature ] && ln -s $eclipse/dropins/sdk/features/$feature features/$feature
+done
+for p in $(ls -d $eclipse/plugins/*); do
+ plugin=$(basename $p)
+ [ ! -e plugins/$plugin ] && ln -s $eclipse/plugins/$plugin plugins/$plugin
+done
+for f in $(ls -d $eclipse/features/*); do
+ feature=$(basename $f)
+ [ ! -e features/$feature ] && ln -s $eclipse/features/$feature features/$feature
+done
+
+for p in $(find /usr/share/java -name "*.jar"); do
+ unzip -p $p 'META-INF/MANIFEST.MF' | grep -q 'Bundle-ManifestVersion'
+ if [ $? = 0 ]; then
+ plugin=$(basename $p)
+ [ ! -e plugins/$plugin ] && ln -s $p plugins/$plugin
+ fi
+done
+
+popd
+
+eclipse -nosplash -application org.eclipse.equinox.p2.publisher.FeaturesAndBundlesPublisher \
+-metadataRepository file:$repo \
+-artifactRepository file:$repo \
+-source $where \
+-compress -append -publishArtifacts
+
+rm -rf $where
diff --git a/tycho-use-custom-resolver.patch b/tycho-use-custom-resolver.patch
index 5c6f8b3..1e3992d 100644
--- a/tycho-use-custom-resolver.patch
+++ b/tycho-use-custom-resolver.patch
@@ -1,5 +1,33 @@
+From 590e6eb40fb807c5b45c8360b80b7a12185b37a6 Mon Sep 17 00:00:00 2001
+From: Roland Grunberg <rgrunber(a)redhat.com>
+Date: Thu, 7 Jun 2012 16:41:33 -0400
+Subject: [PATCH] Implement a custom resolver for Tycho in local mode.
+
+When running in local mode, dependencies should be resolved by looking
+on the local system. Remote repositories should be ignored unless
+offline mode is disabled.
+
+Automatically create a local p2 repository of all bundles on the system
+so that they may be used for local dependency resolution. This is done
+using a modified version of Eclipse's copy-platform script.
+
+Since Fedora 17, we need an Execution Environment of at least JavaSE-1.6
+for Eclipse bundles. Eclipse Juno platform bundles depend on
+javax.annotation. In Fedora this is provided by geronimo-annotation, but
+has a dependency on javax.lang.model (since 1.6).
+
+Change-Id: I0609a1caecad753d811c5a93183547b33737657f
+---
+ .../tycho/p2/target/TargetDefinitionResolver.java | 8 +++-
+ .../tycho/p2/target/TargetPlatformBuilderImpl.java | 5 +++
+ .../core/maven/TychoMavenLifecycleParticipant.java | 13 +++++++
+ .../tycho/core/osgitools/OsgiBundleProject.java | 38 +++++++++++++++++++-
+ .../tycho/osgi/runtime/TychoP2RuntimeLocator.java | 17 +++++++++
+ .../p2/resolver/P2TargetPlatformResolver.java | 10 +++++
+ 6 files changed, 88 insertions(+), 3 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 2d7d3b9..3084fff 100644
+index 2d7d3b9..c628e6e 100644
--- 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
@@ -24,6 +24,7 @@ import org.eclipse.core.runtime.CoreException;
@@ -25,63 +53,52 @@ index 2d7d3b9..3084fff 100644
IQueryable<IInstallableUnit> locationUnits = new CompoundQueryable<IInstallableUnit>(
diff --git a/tycho-bundles/org.eclipse.tycho.p2.resolver.impl/src/main/java/org/eclipse/tycho/p2/target/TargetPlatformBuilderImpl.java b/tycho-bundles/org.eclipse.tycho.p2.resolver.impl/src/main/java/org/eclipse/tycho/p2/target/TargetPlatformBuilderImpl.java
-index 9da87bb..3d15c5e 100644
+index 9da87bb..5785029 100644
--- a/tycho-bundles/org.eclipse.tycho.p2.resolver.impl/src/main/java/org/eclipse/tycho/p2/target/TargetPlatformBuilderImpl.java
+++ b/tycho-bundles/org.eclipse.tycho.p2.resolver.impl/src/main/java/org/eclipse/tycho/p2/target/TargetPlatformBuilderImpl.java
@@ -255,6 +255,11 @@ public class TargetPlatformBuilderImpl implements TargetPlatformBuilder {
return;
}
-+ // We cannot resolve a non-file URI in local mode
-+ if (System.getProperty("maven.local.mode") != null && !URIUtil.isFileURI(location)) {
++ // We cannot resolve a non-file URI in local mode while offline
++ if (System.getProperty("maven.local.mode") != null && offline && !URIUtil.isFileURI(location)) {
+ return;
+ }
+
try {
metadataRepository = metadataRepositoryManager.loadRepository(location, monitor);
metadataRepositories.add(metadataRepository);
-diff --git a/tycho-core/src/main/java/org/eclipse/tycho/osgi/runtime/TychoP2RuntimeLocator.java b/tycho-core/src/main/java/org/eclipse/tycho/osgi/runtime/TychoP2RuntimeLocator.java
-index 15b3fff..c8f14df 100644
---- a/tycho-core/src/main/java/org/eclipse/tycho/osgi/runtime/TychoP2RuntimeLocator.java
-+++ b/tycho-core/src/main/java/org/eclipse/tycho/osgi/runtime/TychoP2RuntimeLocator.java
-@@ -23,6 +23,7 @@ import org.apache.maven.artifact.repository.ArtifactRepository;
- import org.apache.maven.artifact.resolver.ArtifactResolutionException;
- import org.apache.maven.artifact.resolver.ArtifactResolutionRequest;
- import org.apache.maven.artifact.resolver.ArtifactResolutionResult;
-+import org.apache.maven.artifact.resolver.JavadirWorkspaceReader;
- import org.apache.maven.artifact.resolver.ResolutionErrorHandler;
- import org.apache.maven.execution.MavenSession;
- import org.apache.maven.model.Dependency;
-@@ -38,6 +39,7 @@ import org.codehaus.plexus.util.FileUtils;
- import org.eclipse.sisu.equinox.embedder.EquinoxRuntimeLocator;
- import org.eclipse.tycho.locking.facade.FileLockService;
- import org.eclipse.tycho.locking.facade.FileLocker;
-+import org.sonatype.aether.util.artifact.DefaultArtifact;
+diff --git a/tycho-core/src/main/java/org/eclipse/tycho/core/maven/TychoMavenLifecycleParticipant.java b/tycho-core/src/main/java/org/eclipse/tycho/core/maven/TychoMavenLifecycleParticipant.java
+index 80810d6..e3c6732 100644
+--- a/tycho-core/src/main/java/org/eclipse/tycho/core/maven/TychoMavenLifecycleParticipant.java
++++ b/tycho-core/src/main/java/org/eclipse/tycho/core/maven/TychoMavenLifecycleParticipant.java
+@@ -11,6 +11,7 @@
+ package org.eclipse.tycho.core.maven;
- @Component(role = EquinoxRuntimeLocator.class)
- public class TychoP2RuntimeLocator implements EquinoxRuntimeLocator {
-@@ -158,6 +160,21 @@ public class TychoP2RuntimeLocator implements EquinoxRuntimeLocator {
- }
+ import java.io.File;
++import java.io.IOException;
+ import java.util.List;
- private File resolveArtifact(MavenSession session, Artifact artifact) throws MavenExecutionException {
-+
-+ // If we are in local mode, find the artifact on the system
-+ if (System.getProperty("maven.local.mode") != null) {
-+ JavadirWorkspaceReader wReader = new JavadirWorkspaceReader();
-+ DefaultArtifact newArtifact = new DefaultArtifact(artifact.getGroupId()
-+ + ":" + artifact.getArtifactId()
-+ + ":" + artifact.getType()
-+ + ":" + artifact.getVersion());
-+ File file = wReader.findArtifact(newArtifact);
-+ if (file != null) {
-+ artifact.setFile(file);
-+ return file;
-+ }
+ import org.apache.maven.AbstractMavenLifecycleParticipant;
+@@ -51,6 +52,18 @@ public class TychoMavenLifecycleParticipant extends AbstractMavenLifecyclePartic
+ registerExecutionListener(session);
+ configureComponents(session);
+
++ // Create a system p2 repository for local dependency resolution
++ try {
++ String[] cmd = new String[] { "/usr/share/java/tycho/copy-platform-all",
++ System.getProperty("user.dir") + "/.m2/p2/repo" };
++ Process p = Runtime.getRuntime().exec(cmd);
++ p.waitFor();
++ } catch (IOException e) {
++ // Continue
++ } catch (InterruptedException e) {
++ // Continue
+ }
+
- List<ArtifactRepository> repositories = new ArrayList<ArtifactRepository>();
- for (MavenProject project : session.getProjects()) {
- repositories.addAll(project.getPluginArtifactRepositories());
+ List<MavenProject> projects = session.getProjects();
+ for (MavenProject project : projects) {
+ resolver.setupProject(session, project, DefaultReactorProject.adapt(project));
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 8d18453..051913e 100644
--- a/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/OsgiBundleProject.java
@@ -138,3 +155,69 @@ index 8d18453..051913e 100644
} catch (UnknownEnvironmentException e) {
throw new RuntimeException("Unknown execution environment specified in build.properties of project "
+ project, e);
+diff --git a/tycho-core/src/main/java/org/eclipse/tycho/osgi/runtime/TychoP2RuntimeLocator.java b/tycho-core/src/main/java/org/eclipse/tycho/osgi/runtime/TychoP2RuntimeLocator.java
+index 15b3fff..c8f14df 100644
+--- a/tycho-core/src/main/java/org/eclipse/tycho/osgi/runtime/TychoP2RuntimeLocator.java
++++ b/tycho-core/src/main/java/org/eclipse/tycho/osgi/runtime/TychoP2RuntimeLocator.java
+@@ -23,6 +23,7 @@ import org.apache.maven.artifact.repository.ArtifactRepository;
+ import org.apache.maven.artifact.resolver.ArtifactResolutionException;
+ import org.apache.maven.artifact.resolver.ArtifactResolutionRequest;
+ import org.apache.maven.artifact.resolver.ArtifactResolutionResult;
++import org.apache.maven.artifact.resolver.JavadirWorkspaceReader;
+ import org.apache.maven.artifact.resolver.ResolutionErrorHandler;
+ import org.apache.maven.execution.MavenSession;
+ import org.apache.maven.model.Dependency;
+@@ -38,6 +39,7 @@ import org.codehaus.plexus.util.FileUtils;
+ import org.eclipse.sisu.equinox.embedder.EquinoxRuntimeLocator;
+ import org.eclipse.tycho.locking.facade.FileLockService;
+ import org.eclipse.tycho.locking.facade.FileLocker;
++import org.sonatype.aether.util.artifact.DefaultArtifact;
+
+ @Component(role = EquinoxRuntimeLocator.class)
+ public class TychoP2RuntimeLocator implements EquinoxRuntimeLocator {
+@@ -158,6 +160,21 @@ public class TychoP2RuntimeLocator implements EquinoxRuntimeLocator {
+ }
+
+ private File resolveArtifact(MavenSession session, Artifact artifact) throws MavenExecutionException {
++
++ // If we are in local mode, find the artifact on the system
++ if (System.getProperty("maven.local.mode") != null) {
++ JavadirWorkspaceReader wReader = new JavadirWorkspaceReader();
++ DefaultArtifact newArtifact = new DefaultArtifact(artifact.getGroupId()
++ + ":" + artifact.getArtifactId()
++ + ":" + artifact.getType()
++ + ":" + artifact.getVersion());
++ File file = wReader.findArtifact(newArtifact);
++ if (file != null) {
++ artifact.setFile(file);
++ return file;
++ }
++ }
++
+ List<ArtifactRepository> repositories = new ArrayList<ArtifactRepository>();
+ for (MavenProject project : session.getProjects()) {
+ repositories.addAll(project.getPluginArtifactRepositories());
+diff --git a/tycho-p2/tycho-p2-facade/src/main/java/org/eclipse/tycho/p2/resolver/P2TargetPlatformResolver.java b/tycho-p2/tycho-p2-facade/src/main/java/org/eclipse/tycho/p2/resolver/P2TargetPlatformResolver.java
+index d4bcc9a..57ae997 100644
+--- a/tycho-p2/tycho-p2-facade/src/main/java/org/eclipse/tycho/p2/resolver/P2TargetPlatformResolver.java
++++ b/tycho-p2/tycho-p2-facade/src/main/java/org/eclipse/tycho/p2/resolver/P2TargetPlatformResolver.java
+@@ -204,6 +204,16 @@ public class P2TargetPlatformResolver extends AbstractTargetPlatformResolver imp
+ ee != null ? ee.getProfileName() : null, configuration.isDisableP2Mirrors());
+ tpBuilder.setProjectLocation(project.getBasedir());
+
++ // Add Fedora Local P2 Repository when running in local mode
++ if (System.getProperty("maven.local.mode") != null) {
++ String uri = "file:" + System.getProperty("user.dir") + "/.m2/p2/repo";
++ try {
++ tpBuilder.addP2Repository(new URI(uri));
++ } catch (URISyntaxException e) {
++ getLogger().warn("Unable to resolve repository URI : " + uri, e);
++ }
++ }
++
+ addThisReactorProjectToTargetPlatform(session, project, configuration, tpBuilder);
+
+ addOtherReactorProjectsToTargetPlatform(project, reactorProjects, tpBuilder);
+--
+1.7.7.6
+
diff --git a/tycho.spec b/tycho.spec
index 6030c6b..9621a35 100644
--- a/tycho.spec
+++ b/tycho.spec
@@ -25,6 +25,7 @@ Source0: %{name}-0.14.x.tar.bz2
Source1: EmptyMojo.java
# we need to make sure we are using maven 3 deps
Source2: depmap.xml
+Source3: copy-platform-all
Patch0: %{name}-fix-build.patch
Patch1: %{name}-fix-surefire.patch
@@ -176,6 +177,7 @@ install -pm 644 pom.xml $RPM_BUILD_ROOT%{_mavenpomdir}/JPP.%{name}-main.pom
install -dm 755 %{buildroot}%{_javadocdir}/%{name}
cp -pr target/site/api*/* %{buildroot}%{_javadocdir}/%{name}
+install -pm 755 %{SOURCE3} %{buildroot}%{_javadir}/%{name}/copy-platform-all
%post
%update_maven_depmap
@@ -195,6 +197,7 @@ cp -pr target/site/api*/* %{buildroot}%{_javadocdir}/%{name}
%changelog
* Tue May 29 2012 Roland Grunberg <rgrunber(a)redhat.com> 0.14.1-4.1
- Fix Tycho Surfire to run Eclipse test bundles.
+- Implement automatic creation of a system p2 repository.
* Wed May 23 2012 Roland Grunberg <rgrunber(a)redhat.com> 0.14.1-4
- Non-bootstrap build.
11 years, 10 months
[tycho/f17] Fix Surfire test plugin.
by Roland Grunberg
commit e6b1e7eea4779d55357508967cf89fe09fa01d1e
Author: Roland Grunberg <rgrunber(a)redhat.com>
Date: Tue May 29 15:04:45 2012 -0400
Fix Surfire test plugin.
When running an Eclipse bundle's tests, Tycho Surefire resolves its
runtime dependencies using a class loader, which is in fact just looking
through Bundle-ClassPath. As a result, it must copy over and include
system jars in its Bundle-ClassPath. We use Fedora system jars to
satisfy these dependencies but even these jars differ slightly in terms
of provided classes.
tycho-bootstrap.patch | 4 +-
tycho-fix-build.patch | 10 ---
tycho-fix-surefire.patch | 160 ++++++++++++++++++++++++++++++++++++++++++++++
tycho.spec | 15 +++--
4 files changed, 172 insertions(+), 17 deletions(-)
---
diff --git a/tycho-bootstrap.patch b/tycho-bootstrap.patch
index 631718e..46fd1e3 100644
--- a/tycho-bootstrap.patch
+++ b/tycho-bootstrap.patch
@@ -670,8 +670,8 @@ diff -rauN tycho-0.14.x.old/tycho-surefire/org.eclipse.tycho.surefire.osgibooter
--- tycho-0.14.x.old/tycho-surefire/org.eclipse.tycho.surefire.osgibooter/META-INF/MANIFEST.MF 2012-02-24 06:40:15.000000000 -0500
+++ tycho-0.14.x/tycho-surefire/org.eclipse.tycho.surefire.osgibooter/META-INF/MANIFEST.MF 2012-03-30 14:49:39.000000000 -0400
@@ -7,6 +7,6 @@
- jars/surefire-booter-2.10.jar,
- jars/surefire-api-2.10.jar
+ jars/surefire-api-2.10.jar,
+ jars/plexus-utils-3.0.jar
-Bundle-Version: 0.14.1
+Bundle-Version: 0.14.1.qualifier
Bundle-Name: Tycho Surefire OSGi Booter Eclipse Application (Incubation)
diff --git a/tycho-fix-build.patch b/tycho-fix-build.patch
index f78242c..3265ec3 100644
--- a/tycho-fix-build.patch
+++ b/tycho-fix-build.patch
@@ -97,16 +97,6 @@
} catch (BundleException e) {
throw new OsgiManifestParserException(location, e);
}
---- ./tycho-0.14.0.old/tycho-surefire/org.eclipse.tycho.surefire.junit/META-INF/MANIFEST.MF 2012-02-06 10:26:59.000000000 -0500
-+++ ./tycho-0.14.0/tycho-surefire/org.eclipse.tycho.surefire.junit/META-INF/MANIFEST.MF 2012-02-14 12:04:02.275017810 -0500
-@@ -6,6 +6,6 @@
- Fragment-Host: org.eclipse.tycho.surefire.osgibooter;bundle-version="0.14.0"
- Bundle-RequiredExecutionEnvironment: J2SE-1.5,
- JavaSE-1.6
--Require-Bundle: org.junit;bundle-version="[3.8.0,4.0.0)"
-+Require-Bundle: org.junit;bundle-version="[3.8.0,4.9.0)"
- Bundle-ClassPath: jars/surefire-junit3-2.10.jar
- Bundle-Vendor: %providerName
--- ./tycho-0.14.x.old/tycho-core/src/main/java/org/eclipse/tycho/core/utils/EEVersion.java 2012-02-24 06:40:15.000000000 -0500
+++ ./tycho-0.14.x/tycho-core/src/main/java/org/eclipse/tycho/core/utils/EEVersion.java 2012-05-03 14:09:09.000000000 -0400
@@ -18,7 +18,7 @@
diff --git a/tycho-fix-surefire.patch b/tycho-fix-surefire.patch
new file mode 100644
index 0000000..2419e2d
--- /dev/null
+++ b/tycho-fix-surefire.patch
@@ -0,0 +1,160 @@
+From 5ddb88911071664de0e07f7f247aeeaedecc8cab Mon Sep 17 00:00:00 2001
+From: Roland Grunberg <rgrunber(a)redhat.com>
+Date: Tue, 29 May 2012 14:27:27 -0400
+Subject: [PATCH] Resolve all necessary dependencies for Tycho Surefire.
+
+When running an Eclipse bundle's tests, Tycho Surefire resolves its
+runtime dependencies using a class loader, which is in fact just looking
+through Bundle-ClassPath. As a result, it must copy over and include
+system jars in its Bundle-ClassPath. We use Fedora system jars to
+satisfy these dependencies but even these jars differ slightly in terms
+of provided classes. This patch addresses this issue.
+
+Basically, the jars added to the Bundle-ClassPath in this patch, provide
+the additional classes that are in the original jars used upstream.
+---
+ pom.xml | 2 +-
+ .../META-INF/MANIFEST.MF | 5 +++--
+ .../build.properties | 2 +-
+ .../org.eclipse.tycho.surefire.junit/pom.xml | 5 +++++
+ .../META-INF/MANIFEST.MF | 4 +++-
+ .../build.properties | 2 +-
+ .../org.eclipse.tycho.surefire.junit4/pom.xml | 10 ++++++++++
+ .../META-INF/MANIFEST.MF | 3 ++-
+ .../org.eclipse.tycho.surefire.osgibooter/pom.xml | 5 +++++
+ 9 files changed, 31 insertions(+), 7 deletions(-)
+
+diff --git a/pom.xml b/pom.xml
+index e9d8624..ca20999 100644
+--- a/pom.xml
++++ b/pom.xml
+@@ -79,7 +79,7 @@
+ <junitVersion>3.8.2</junitVersion>
+ <plexusVersion>1.5.5</plexusVersion>
+ <plexusInterpolationVersion>1.14</plexusInterpolationVersion>
+- <plexusUtilsVersion>2.0.4</plexusUtilsVersion>
++ <plexusUtilsVersion>3.0</plexusUtilsVersion>
+ <sisuInjectVersion>1.4.2</sisuInjectVersion>
+ <wagonVersion>1.0-beta-6</wagonVersion>
+ <securityDispatcherVersion>1.3</securityDispatcherVersion>
+diff --git a/tycho-surefire/org.eclipse.tycho.surefire.junit/META-INF/MANIFEST.MF b/tycho-surefire/org.eclipse.tycho.surefire.junit/META-INF/MANIFEST.MF
+index 9264109..a27abe4 100644
+--- a/tycho-surefire/org.eclipse.tycho.surefire.junit/META-INF/MANIFEST.MF
++++ b/tycho-surefire/org.eclipse.tycho.surefire.junit/META-INF/MANIFEST.MF
+@@ -6,6 +6,7 @@ Bundle-Version: 0.14.1
+ Fragment-Host: org.eclipse.tycho.surefire.osgibooter;bundle-version="0.14.0"
+ Bundle-RequiredExecutionEnvironment: J2SE-1.5,
+ JavaSE-1.6
+-Require-Bundle: org.junit;bundle-version="[3.8.0,4.0.0)"
+-Bundle-ClassPath: jars/surefire-junit3-2.10.jar
++Require-Bundle: org.junit;bundle-version="[3.8.0,4.9.0)"
++Bundle-ClassPath: jars/surefire-junit3-2.10.jar,
++ jars/common-junit3-2.10.jar
+ Bundle-Vendor: %providerName
+diff --git a/tycho-surefire/org.eclipse.tycho.surefire.junit/build.properties b/tycho-surefire/org.eclipse.tycho.surefire.junit/build.properties
+index 499ce76..fe88b19 100644
+--- a/tycho-surefire/org.eclipse.tycho.surefire.junit/build.properties
++++ b/tycho-surefire/org.eclipse.tycho.surefire.junit/build.properties
+@@ -9,5 +9,5 @@
+ # Sonatype Inc. - initial API and implementation
+ ###############################################################################
+ bin.includes = META-INF/,\
+- jars/surefire-junit3-2.10.jar,\
++ jars/,\
+ plugin.properties
+diff --git a/tycho-surefire/org.eclipse.tycho.surefire.junit/pom.xml b/tycho-surefire/org.eclipse.tycho.surefire.junit/pom.xml
+index 2a4afc8..ae35035 100644
+--- a/tycho-surefire/org.eclipse.tycho.surefire.junit/pom.xml
++++ b/tycho-surefire/org.eclipse.tycho.surefire.junit/pom.xml
+@@ -47,6 +47,11 @@
+ <artifactId>surefire-junit3</artifactId>
+ <version>${surefire-version}</version>
+ </artifactItem>
++ <artifactItem>
++ <groupId>org.apache.maven.surefire</groupId>
++ <artifactId>common-junit3</artifactId>
++ <version>${surefire-version}</version>
++ </artifactItem>
+ </artifactItems>
+ </configuration>
+ </execution>
+diff --git a/tycho-surefire/org.eclipse.tycho.surefire.junit4/META-INF/MANIFEST.MF b/tycho-surefire/org.eclipse.tycho.surefire.junit4/META-INF/MANIFEST.MF
+index bbb54a8..82e66d1 100644
+--- a/tycho-surefire/org.eclipse.tycho.surefire.junit4/META-INF/MANIFEST.MF
++++ b/tycho-surefire/org.eclipse.tycho.surefire.junit4/META-INF/MANIFEST.MF
+@@ -6,7 +6,9 @@ Bundle-Version: 0.14.1
+ Fragment-Host: org.eclipse.tycho.surefire.osgibooter;bundle-version="0.14.0"
+ Bundle-RequiredExecutionEnvironment: J2SE-1.5,
+ JavaSE-1.6
+-Bundle-ClassPath: jars/surefire-junit4-2.10.jar
++Bundle-ClassPath: jars/surefire-junit4-2.10.jar,
++ jars/common-junit3-2.10.jar,
++ jars/common-junit4-2.10.jar
+ Import-Package: junit.framework;version="4.0.0",
+ org.junit;version="4.0.0",
+ org.junit.runner;version="4.0.0",
+diff --git a/tycho-surefire/org.eclipse.tycho.surefire.junit4/build.properties b/tycho-surefire/org.eclipse.tycho.surefire.junit4/build.properties
+index b787149..fe88b19 100644
+--- a/tycho-surefire/org.eclipse.tycho.surefire.junit4/build.properties
++++ b/tycho-surefire/org.eclipse.tycho.surefire.junit4/build.properties
+@@ -9,5 +9,5 @@
+ # Sonatype Inc. - initial API and implementation
+ ###############################################################################
+ bin.includes = META-INF/,\
+- jars/surefire-junit4-2.10.jar,\
++ jars/,\
+ plugin.properties
+diff --git a/tycho-surefire/org.eclipse.tycho.surefire.junit4/pom.xml b/tycho-surefire/org.eclipse.tycho.surefire.junit4/pom.xml
+index 08ab16a..2ed7c3a 100644
+--- a/tycho-surefire/org.eclipse.tycho.surefire.junit4/pom.xml
++++ b/tycho-surefire/org.eclipse.tycho.surefire.junit4/pom.xml
+@@ -71,6 +71,16 @@
+ <artifactId>surefire-junit4</artifactId>
+ <version>${surefire-version}</version>
+ </artifactItem>
++ <artifactItem>
++ <groupId>org.apache.maven.surefire</groupId>
++ <artifactId>common-junit3</artifactId>
++ <version>${surefire-version}</version>
++ </artifactItem>
++ <artifactItem>
++ <groupId>org.apache.maven.surefire</groupId>
++ <artifactId>common-junit4</artifactId>
++ <version>${surefire-version}</version>
++ </artifactItem>
+ </artifactItems>
+ </configuration>
+ </execution>
+diff --git a/tycho-surefire/org.eclipse.tycho.surefire.osgibooter/META-INF/MANIFEST.MF b/tycho-surefire/org.eclipse.tycho.surefire.osgibooter/META-INF/MANIFEST.MF
+index fda57c6..ab5de08 100644
+--- a/tycho-surefire/org.eclipse.tycho.surefire.osgibooter/META-INF/MANIFEST.MF
++++ b/tycho-surefire/org.eclipse.tycho.surefire.osgibooter/META-INF/MANIFEST.MF
+@@ -5,7 +5,8 @@ Require-Bundle: org.eclipse.osgi;bundle-version="3.2.2",
+ Eclipse-AutoStart: true
+ Bundle-ClassPath: .,
+ jars/surefire-booter-2.10.jar,
+- jars/surefire-api-2.10.jar
++ jars/surefire-api-2.10.jar,
++ jars/plexus-utils-3.0.jar
+ Bundle-Version: 0.14.1
+ Bundle-Name: Tycho Surefire OSGi Booter Eclipse Application (Incubation)
+ Bundle-ManifestVersion: 2
+diff --git a/tycho-surefire/org.eclipse.tycho.surefire.osgibooter/pom.xml b/tycho-surefire/org.eclipse.tycho.surefire.osgibooter/pom.xml
+index cd5b2d7..d1d24da 100644
+--- a/tycho-surefire/org.eclipse.tycho.surefire.osgibooter/pom.xml
++++ b/tycho-surefire/org.eclipse.tycho.surefire.osgibooter/pom.xml
+@@ -52,6 +52,11 @@
+ <artifactId>surefire-booter</artifactId>
+ <version>${surefire-version}</version>
+ </artifactItem>
++ <artifactItem>
++ <groupId>org.codehaus.plexus</groupId>
++ <artifactId>plexus-utils</artifactId>
++ <version>${plexusUtilsVersion}</version>
++ </artifactItem>
+ </artifactItems>
+ </configuration>
+ </execution>
+--
+1.7.7.6
+
diff --git a/tycho.spec b/tycho.spec
index 3aa466e..6030c6b 100644
--- a/tycho.spec
+++ b/tycho.spec
@@ -1,5 +1,5 @@
%global eclipsedir %{_libdir}/eclipse
-%global bootstrap 0
+%global bootstrap 1
%if %{bootstrap}
%global snap -SNAPSHOT
@@ -9,7 +9,7 @@
Name: tycho
Version: 0.14.1
-Release: 4%{?dist}
+Release: 4.1%{?dist}
Summary: Plugins and extensions for building Eclipse plugins and OSGI bundles with Maven
Group: Development/Libraries
@@ -27,12 +27,13 @@ Source1: EmptyMojo.java
Source2: depmap.xml
Patch0: %{name}-fix-build.patch
-Patch1: %{name}-use-custom-resolver.patch
+Patch1: %{name}-fix-surefire.patch
+Patch2: %{name}-use-custom-resolver.patch
# Set some temporary build version so that the bootstrapped build has
# a different version from the nonbootstrapped. Otherwise there will
# be cyclic dependencies.
%if %{bootstrap}
-Patch2: %{name}-bootstrap.patch
+Patch3: %{name}-bootstrap.patch
%endif
BuildArch: noarch
@@ -109,8 +110,9 @@ This package contains the API documentation for %{name}.
%patch0 -p2
%patch1 -p1
-%if %{bootstrap}
%patch2 -p1
+%if %{bootstrap}
+%patch3 -p1
%endif
find tycho-core -iname '*html' -delete
@@ -191,6 +193,9 @@ cp -pr target/site/api*/* %{buildroot}%{_javadocdir}/%{name}
%{_javadocdir}/%{name}
%changelog
+* Tue May 29 2012 Roland Grunberg <rgrunber(a)redhat.com> 0.14.1-4.1
+- Fix Tycho Surfire to run Eclipse test bundles.
+
* Wed May 23 2012 Roland Grunberg <rgrunber(a)redhat.com> 0.14.1-4
- Non-bootstrap build.
11 years, 10 months
[java-oauth] Initial import (#820995).
by gil
commit 4c16c1ed4db859d08b26f307308745c81094fa0e
Author: gil <puntogil(a)libero.it>
Date: Tue Jun 12 21:30:48 2012 +0200
Initial import (#820995).
.gitignore | 1 +
java-oauth.spec | 123 +++++++++++++++++++++++++++++++++++++++++++++
oauth-20100601-poms.patch | 61 ++++++++++++++++++++++
sources | 1 +
4 files changed, 186 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..04014fe 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/oauth-20100601-clean-src-svn.tar.gz
diff --git a/java-oauth.spec b/java-oauth.spec
new file mode 100644
index 0000000..27c2aa7
--- /dev/null
+++ b/java-oauth.spec
@@ -0,0 +1,123 @@
+%global oname oauth
+Name: java-oauth
+Version: 20100601
+Release: 2%{?dist}
+Summary: An open protocol to allow API authentication
+Group: Development/Libraries
+License: ASL 2.0
+Url: http://code.google.com/p/oauth/
+# svn export http://oauth.googlecode.com/svn/code/java oauth-20100601
+# find oauth-20100601 -name "*.bat" -delete
+# find oauth-20100601 -name "*.class" -delete
+# find oauth-20100601 -name "*.jar" -delete
+# tar czf oauth-20100601-clean-src-svn.tar.gz oauth-20100601
+Source0: oauth-20100601-clean-src-svn.tar.gz
+
+# remove unavailable test deps org.mortbay.jetty jetty-embedded 6.1.11
+# unavailable deps disable this modules: core-old example test
+
+# x test
+# org.mortbay.jetty jetty-embedded 6.1.11
+
+# x oauth-example-desktop
+# org.codehaus.mojo appassembler-maven-plugin
+# org.mortbay.jetty jetty-embedded 6.1.11
+
+# x oauth-example-provider oauth-example-consumer
+# org.mortbay.jetty jetty-maven-plugin
+
+Patch0: oauth-20100601-poms.patch
+BuildRequires: java-devel
+BuildRequires: jpackage-utils
+
+BuildRequires: httpcomponents-client
+BuildRequires: jakarta-commons-httpclient
+BuildRequires: tomcat-servlet-3.0-api
+
+BuildRequires: maven
+BuildRequires: maven-compiler-plugin
+BuildRequires: maven-install-plugin
+BuildRequires: maven-jar-plugin
+BuildRequires: maven-javadoc-plugin
+BuildRequires: maven-resources-plugin
+BuildRequires: maven-source-plugin
+BuildRequires: maven-surefire-plugin
+
+Requires: httpcomponents-client
+Requires: jakarta-commons-httpclient
+Requires: tomcat-servlet-3.0-api
+
+Requires: java
+Requires: jpackage-utils
+BuildArch: noarch
+
+%description
+An open protocol to allow API authentication
+in a simple and standard method from desktop and
+web applications.
+
+%package javadoc
+Group: Documentation
+Summary: Javadoc for %{name}
+Requires: jpackage-utils
+
+%description javadoc
+This package contains javadoc for %{name}.
+
+%prep
+%setup -q -n %{oname}-%{version}
+%patch0 -p1
+
+%build
+# unavailable test deps
+mvn-rpmbuild -Dmaven.test.skip=true -Dproject.build.sourceEncoding=UTF-8 install javadoc:aggregate
+
+%install
+
+mkdir -p %{buildroot}%{_javadir}/%{oname}
+install -pm 644 core/commons/target/%{oname}-%{version}.jar %{buildroot}%{_javadir}/%{oname}/%{oname}.jar
+install -pm 644 core/consumer/target/%{oname}-consumer-%{version}.jar %{buildroot}%{_javadir}/%{oname}/%{oname}-consumer.jar
+install -pm 644 core/httpclient3/target/%{oname}-httpclient3-%{version}.jar %{buildroot}%{_javadir}/%{oname}/%{oname}-httpclient3.jar
+install -pm 644 core/httpclient4/target/%{oname}-httpclient4-%{version}.jar %{buildroot}%{_javadir}/%{oname}/%{oname}-httpclient4.jar
+install -pm 644 core/provider/target/%{oname}-provider-%{version}.jar %{buildroot}%{_javadir}/%{oname}/%{oname}-provider.jar
+
+mkdir -p %{buildroot}%{_mavenpomdir}
+install -pm 644 pom.xml %{buildroot}%{_mavenpomdir}/JPP.%{oname}-parent.pom
+install -pm 644 core/pom.xml %{buildroot}%{_mavenpomdir}/JPP.%{oname}-core-parent.pom
+install -pm 644 core/commons/pom.xml %{buildroot}%{_mavenpomdir}/JPP.%{oname}-%{oname}.pom
+install -pm 644 core/consumer/pom.xml %{buildroot}%{_mavenpomdir}/JPP.%{oname}-%{oname}-consumer.pom
+install -pm 644 core/httpclient3/pom.xml %{buildroot}%{_mavenpomdir}/JPP.%{oname}-%{oname}-httpclient3.pom
+install -pm 644 core/httpclient4/pom.xml %{buildroot}%{_mavenpomdir}/JPP.%{oname}-%{oname}-httpclient4.pom
+install -pm 644 core/provider/pom.xml %{buildroot}%{_mavenpomdir}/JPP.%{oname}-%{oname}-provider.pom
+
+%add_maven_depmap JPP.%{oname}-parent.pom
+%add_maven_depmap JPP.%{oname}-core-parent.pom
+%add_maven_depmap JPP.%{oname}-%{oname}.pom %{oname}/%{oname}.jar
+%add_maven_depmap JPP.%{oname}-%{oname}-consumer.pom %{oname}/%{oname}-consumer.jar
+%add_maven_depmap JPP.%{oname}-%{oname}-httpclient3.pom %{oname}/%{oname}-httpclient3.jar
+%add_maven_depmap JPP.%{oname}-%{oname}-httpclient4.pom %{oname}/%{oname}-httpclient4.jar
+%add_maven_depmap JPP.%{oname}-%{oname}-provider.pom %{oname}/%{oname}-provider.jar
+
+mv %{buildroot}%{_mavendepmapfragdir}/%{name} %{buildroot}%{_mavendepmapfragdir}/%{oname}
+
+mkdir -p %{buildroot}%{_javadocdir}/%{oname}
+cp -rp target/site/apidocs/* %{buildroot}%{_javadocdir}/%{oname}
+
+%files
+%{_javadir}/%{oname}/%{oname}*.jar
+%{_mavenpomdir}/JPP.%{oname}*.pom
+%{_mavendepmapfragdir}/%{oname}
+%doc LICENSE.txt
+
+%files javadoc
+%{_javadocdir}/%{oname}
+%doc LICENSE.txt
+
+%changelog
+* Thu May 24 2012 gil cattaneo <puntogil(a)libero.it> 20100601-2
+- renamed java-oauth
+- moved all of the jar files into oauth subdirectory
+
+* Fri May 11 2012 gil cattaneo <puntogil(a)libero.it> 20100601-1
+- initial rpm
+
diff --git a/oauth-20100601-poms.patch b/oauth-20100601-poms.patch
new file mode 100644
index 0000000..bd84b8a
--- /dev/null
+++ b/oauth-20100601-poms.patch
@@ -0,0 +1,61 @@
+diff -Nru oauth-20100601/core/httpclient4/pom.xml oauth-20100601-gil/core/httpclient4/pom.xml
+--- oauth-20100601/core/httpclient4/pom.xml 2010-06-01 08:52:53.000000000 +0200
++++ oauth-20100601-gil/core/httpclient4/pom.xml 2011-08-11 04:07:52.503617677 +0200
+@@ -27,11 +27,11 @@
+ <version>20100601</version>
+ <scope>test</scope>
+ </dependency>
+- <dependency>
++ <!--dependency>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>jetty-embedded</artifactId>
+ <version>6.1.11</version>
+ <scope>test</scope>
+- </dependency>
++ </dependency-->
+ </dependencies>
+ </project>
+diff -Nru oauth-20100601/core/pom.xml oauth-20100601-gil/core/pom.xml
+--- oauth-20100601/core/pom.xml 2010-06-01 08:52:53.000000000 +0200
++++ oauth-20100601-gil/core/pom.xml 2011-08-11 04:20:09.279576152 +0200
+@@ -17,7 +17,7 @@
+ <module>httpclient3</module>
+ <module>httpclient4</module>
+ <module>provider</module>
+- <module>test</module>
++ <!--This module contains tests, only. There is no interesting source code. module>test</module-->
+ </modules>
+ <reporting>
+ <plugins>
+diff -Nru oauth-20100601/core/test/pom.xml oauth-20100601-gil/core/test/pom.xml
+--- oauth-20100601/core/test/pom.xml 2010-06-01 08:52:53.000000000 +0200
++++ oauth-20100601-gil/core/test/pom.xml 2011-08-11 04:07:18.564619589 +0200
+@@ -41,12 +41,12 @@
+ <version>20100601</version>
+ <scope>test</scope>
+ </dependency>
+- <dependency>
++ <!--dependency>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>jetty-embedded</artifactId>
+ <version>6.1.11</version>
+ <scope>test</scope>
+- </dependency>
++ </dependency-->
+ </dependencies>
+ <repositories>
+ <repository>
+diff -Nru oauth-20100601/pom.xml oauth-20100601-gil/pom.xml
+--- oauth-20100601/pom.xml 2010-06-01 08:52:53.000000000 +0200
++++ oauth-20100601-gil/pom.xml 2011-08-11 04:19:21.436578850 +0200
+@@ -14,8 +14,8 @@
+
+ <modules>
+ <module>core</module>
+- <module>core-old</module>
+- <module>example</module>
++ <!-- This module contains tests, only. There is no interesting source code. module>core-old</module-->
++ <!--module>example</module-->
+ </modules>
+
+ <build>
diff --git a/sources b/sources
index e69de29..23234b0 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+16e7a89ab063d291eb6f6d0341d1feef oauth-20100601-clean-src-svn.tar.gz
11 years, 10 months
[maven] Implement experimental dependency checking
by Stanislav Ochotnicky
commit d1265ccd6f42503c0ba3e8e0f1c6d96073825295
Author: Mikolaj Izdebski <mizdebsk(a)redhat.com>
Date: Mon Jun 11 21:10:55 2012 +0200
Implement experimental dependency checking
maven-script-rpmbuild | 25 ++++++++++++++++++++++---
maven.spec | 6 +++++-
2 files changed, 27 insertions(+), 4 deletions(-)
---
diff --git a/maven-script-rpmbuild b/maven-script-rpmbuild
index d44f74a..aabab06 100644
--- a/maven-script-rpmbuild
+++ b/maven-script-rpmbuild
@@ -1,4 +1,5 @@
-#!/bin/sh
+#!/bin/bash
+
if [ -f /usr/share/java-utils/java-functions ] ; then
. /usr/share/java-utils/java-functions
set_jvm
@@ -32,6 +33,9 @@ function help()
# add maven.repo.local if it's not defined already
local_add="-Dmaven.repo.local=$(pwd)/.m2/"
+log_file="$(umask 2 && mktemp -t mvn-rpmbuild.$$.XXXXXXXXXX)"
+logfile_add="-Dmaven.resolver.logfile=$log_file"
+
function process_args()
{
while [ $# != 0 ]; do
@@ -62,6 +66,21 @@ echo $JAVA_HOME
export JAVA_HOME
# can't put it on command line due to
# http://jira.codehaus.org/browse/SUREFIRE-121
-export MAVEN_OPTS="$MAVEN_OPTS -Dmaven.local.mode ${local_add}"
+export MAVEN_OPTS="$MAVEN_OPTS -Dmaven.local.mode ${local_add} ${logfile_add}"
+
+$M2_HOME/bin/mvn -o "$@" || exit $?
+
+
+sanitize() {
+ for obj in $1; do
+ echo -n 'mvn-rpmbuild: possibly redundant dependency: '
+ rpm -qf "$(readlink -f $obj)" | sed 's/-[^-]*-[^-]*$//'
+ done | sort -u
+}
+
+installed=$(sanitize "$(rpm -ql `package-cleanup --all --leaves | xargs` | egrep '\.(jar|pom)$')")
+used=$(sanitize "$(cat $log_file 2>/dev/null)")
+
+diff - /dev/fd/3 <<<"$installed" 3<<<"$used" | grep '^< ' | sed s/..//
-$M2_HOME/bin/mvn -o "$@"
+:
diff --git a/maven.spec b/maven.spec
index 92f2cc5..e140ad4 100644
--- a/maven.spec
+++ b/maven.spec
@@ -2,7 +2,7 @@
Name: maven
Version: 3.0.4
-Release: 6%{?dist}
+Release: 7%{?dist}
Summary: Java project management and project comprehension tool
Group: Development/Tools
@@ -97,6 +97,7 @@ Requires: sisu >= 2.1.1-2
Requires: sonatype-oss-parent
Requires: xbean
Requires: xerces-j2
+Requires: yum-utils
# for noarch->arch change
@@ -359,6 +360,9 @@ ln -sf `rpm --eval '%%{_jnidir}'` %{_datadir}/%{name}/repository-jni/JPP
%changelog
+* Mon Jun 11 2012 Mikolaj Izdebski <mizdebsk(a)redhat.com> - 3.0.4-7
+- Implement redundant dependency checks
+
* Thu May 24 2012 Krzysztof Daniel <kdaniel(a)redhat.com> 3.0.4-6
- Bug 824789 -Use the version if it is possible.
11 years, 10 months
[maven] Implement resolver logging
by Stanislav Ochotnicky
commit ebf5130c1b77ccb68c8c6244a4348a42622ceaa0
Author: Mikolaj Izdebski <mizdebsk(a)redhat.com>
Date: Mon Jun 11 20:49:09 2012 +0200
Implement resolver logging
JavadirWorkspaceReader.java | 22 ++++++++++++++++++++++
1 files changed, 22 insertions(+), 0 deletions(-)
---
diff --git a/JavadirWorkspaceReader.java b/JavadirWorkspaceReader.java
index 5dd598c..1698929 100644
--- a/JavadirWorkspaceReader.java
+++ b/JavadirWorkspaceReader.java
@@ -24,7 +24,29 @@ public class JavadirWorkspaceReader implements WorkspaceReader {
return workspaceRepository;
}
+ private static final String LOG_FILE = System.getProperty("maven.resolver.logfile");
+ private static final java.util.concurrent.Semaphore LOG_SEMAPHORE = new java.util.concurrent.Semaphore(1);
+
public File findArtifact(Artifact artifact) {
+ File f = findArtifactImpl(artifact);
+
+ LOG_SEMAPHORE.acquireUninterruptibly();
+ try {
+ if (LOG_FILE != null && f != null) {
+ java.io.FileOutputStream fos = new java.io.FileOutputStream(LOG_FILE, true);
+ java.io.PrintStream ps = new java.io.PrintStream(fos);
+ ps.println(f.getAbsolutePath());
+ ps.close();
+ }
+ }
+ catch (Exception _) {}
+ finally {
+ LOG_SEMAPHORE.release();
+ return f;
+ }
+ }
+
+ private File findArtifactImpl(Artifact artifact) {
MavenJPackageDepmap.debug("=============JAVADIRREADER-FIND_ARTIFACT: "
+ artifact.getArtifactId());
StringBuffer path = new StringBuffer();
11 years, 10 months