diff --git a/make_bootstrap_repo.sh b/make_bootstrap_repo.sh index 4a7cf5c..9f5a284 100755 --- a/make_bootstrap_repo.sh +++ b/make_bootstrap_repo.sh @@ -1,8 +1,6 @@ #!/bin/bash rm -rf $(pwd)/.m2 -export TYCHO_TARGET_PLATFORM=/usr/lib/eclipse - -mvn-local -Dmaven.repo.local=$(pwd)/.m2 -Dmaven.local.debug=true -X -Dmaven.test.skip -Dsite.generation=true clean install 1>log1.txt 2>log2.txt || exit +mvn-local -Dmaven.repo.local=$(pwd)/.m2 -Dmaven.local.debug=true -X -Dmaven.test.skip clean verify 1>log1.txt 2>log2.txt || exit tar caf maven-repo.tar.xz .m2 diff --git a/tycho-fix-build.patch b/tycho-fix-build.patch index 03a99ea..0e3111f 100644 --- a/tycho-fix-build.patch +++ b/tycho-fix-build.patch @@ -1,4 +1,4 @@ -From 1f2c5e307b8d8d2a46ee5eb32359e33d9db3c225 Mon Sep 17 00:00:00 2001 +From 06f5c9b4caf08c1aa2a3febb67a9db1e2f7c3781 Mon Sep 17 00:00:00 2001 From: Roland Grunberg Date: Tue, 12 Jun 2012 09:56:38 -0400 Subject: [PATCH 1/4] Fix the Tycho build to work on Fedora. @@ -20,13 +20,12 @@ Change-Id: Ic8c0514c1fa10ee53580d2654ac6a363ccd66814 tycho-artifactcomparator/pom.xml | 4 ++-- .../eclipse/tycho/p2/target/ee/CustomEEResolutionHandler.java | 2 +- .../tycho-bundles-external/tycho-bundles-external.product | 1 - - tycho-bundles/tycho-bundles-target/tycho.target | 4 ---- .../tycho-standalone-p2-director/p2 Director.product | 1 - tycho-compiler-jdt/pom.xml | 4 ---- .../tycho/core/maven/TychoMavenLifecycleParticipant.java | 4 +++- .../org/eclipse/tycho/test/AbstractTychoIntegrationTest.java | 11 +++++------ .../org/eclipse/tycho/testing/EmptyLifecycleExecutor.java | 8 ++++++++ - 10 files changed, 19 insertions(+), 25 deletions(-) + 9 files changed, 19 insertions(+), 21 deletions(-) diff --git a/pom.xml b/pom.xml index afe83e3..ed2d224 100644 @@ -89,21 +88,6 @@ index b12ff8c..9e53672 100644 -diff --git a/tycho-bundles/tycho-bundles-target/tycho.target b/tycho-bundles/tycho-bundles-target/tycho.target -index 3436ba6..da4da36 100644 ---- a/tycho-bundles/tycho-bundles-target/tycho.target -+++ b/tycho-bundles/tycho-bundles-target/tycho.target -@@ -2,10 +2,6 @@ - - - -- -- -- -- - - - diff --git a/tycho-bundles/tycho-standalone-p2-director/p2 Director.product b/tycho-bundles/tycho-standalone-p2-director/p2 Director.product index dd80b5e..797b4ba 100644 --- a/tycho-bundles/tycho-standalone-p2-director/p2 Director.product diff --git a/tycho-remove-units.patch b/tycho-remove-units.patch new file mode 100644 index 0000000..179a3f5 --- /dev/null +++ b/tycho-remove-units.patch @@ -0,0 +1,15 @@ +diff --git a/tycho-bundles/tycho-bundles-target/tycho.target b/tycho-bundles/tycho-bundles-target/tycho.target +index 3436ba6..da4da36 100644 +--- a/tycho-bundles/tycho-bundles-target/tycho.target ++++ b/tycho-bundles/tycho-bundles-target/tycho.target +@@ -2,10 +2,6 @@ + + + +- +- +- +- + + + diff --git a/tycho.spec b/tycho.spec index 36ede66..4c071ab 100644 --- a/tycho.spec +++ b/tycho.spec @@ -1,3 +1,6 @@ +# Bootstrap build +# Set this if Tycho and Eclipse are not in buildroot +%global bootstrap 0 # When building version under development (non-release) # %%global snap -SNAPSHOT @@ -5,7 +8,7 @@ Name: tycho Version: 0.16.0 -Release: 15%{?dist} +Release: 16%{?dist} Summary: Plugins and extensions for building Eclipse plugins and OSGI bundles with Maven Group: Development/Libraries @@ -21,6 +24,10 @@ Source1: EmptyMojo.java # we need to make sure we are using maven 3 deps Source2: depmap.xml Source3: copy-platform-all +# Bootstrap repo for building when Tycho and Eclipse not built. +%if %{bootstrap} +Source4: maven-repo.tar.xz +%endif Patch0: %{name}-fix-build.patch # Upstream builds against maven-surefire 2.12.3 @@ -31,9 +38,10 @@ Patch3: %{name}-use-custom-resolver.patch # a different version from the nonbootstrapped. Otherwise there will # be cyclic dependencies. Patch4: %{name}-bootstrap.patch -# Maven local mode will look in reactore cache for exact version (path lookup) +# Maven local mode will look in reactor cache for exact version (path lookup) # Set the built intermediary version of Tycho to be found in the reactor cache Patch5: %{name}-set-reactor-cache-version.patch +Patch6: %{name}-remove-units.patch BuildArch: noarch @@ -55,9 +63,11 @@ BuildRequires: maven-surefire-provider-junit BuildRequires: maven-surefire-provider-junit4 BuildRequires: objectweb-asm4 BuildRequires: plexus-containers-component-metadata -BuildRequires: eclipse-jdt BuildRequires: decentxml +%if ! %{bootstrap} +BuildRequires: eclipse-jdt BuildRequires: %{name} +%endif Requires: jpackage-utils Requires: decentxml @@ -67,7 +77,10 @@ Requires: maven-dependency-plugin Requires: maven-shared-verifier Requires: maven-surefire-provider-junit4 Requires: objectweb-asm4 -#Requires: eclipse-jdt +Requires: ecj +%if ! %{bootstrap} +Requires: eclipse-equinox-osgi +%endif %description @@ -123,6 +136,12 @@ popd export MAVEN_OPTS="$MAVEN_OPTS -XX:MaxPermSize=256m" +%if %{bootstrap} +tar -xf %{SOURCE4} +%else + +%patch6 -p1 + # installed version of Tycho sysVer=`grep -C 1 "tycho" %{_mavenpomdir}/JPP.tycho-main.pom | grep "version" | sed 's/.*>\(.*\)<.*/\1/'` @@ -134,7 +153,7 @@ echo "System version is ${sysVer} and attempting to build ${buildVer}." # If version installed on system is the same as the version being built # an intermediary build must be done to prevent a cycle at build time. if [ "${sysVer}" == "${buildVer}" ]; then -echo "Performing bootstrap build" +echo "Performing intermediary build" %patch4 -p1 mvn-rpmbuild -Dmaven.local.depmap.file=%{SOURCE2} -DskipTychoVersionCheck -Dmaven.test.skip=true install javadoc:aggregate @@ -143,6 +162,8 @@ mvn-rpmbuild -Dmaven.local.depmap.file=%{SOURCE2} -DskipTychoVersionCheck -Dmave %patch5 -p1 fi +%endif + %build mvn-rpmbuild -Dmaven.local.depmap.file=%{SOURCE2} -DskipTychoVersionCheck -Dmaven.test.skip=true clean install javadoc:aggregate @@ -199,15 +220,25 @@ cp -pr target/site/api*/* $RPM_BUILD_ROOT%{_javadocdir}/%{name} install -pm 755 %{SOURCE3} $RPM_BUILD_ROOT%{_javadir}/%{name}/copy-platform-all +%if %{bootstrap} # org.eclipse.osgi -install -pm 644 %{_mavenpomdir}/JPP.eclipse-osgi.pom $RPM_BUILD_ROOT%{_mavenpomdir}/JPP.tycho-osgi.pom -install -m 644 %{_javadir}/eclipse/osgi.jar $RPM_BUILD_ROOT%{_javadir}/%{name}/ -%add_maven_depmap JPP.%{name}-osgi.pom %{name}/osgi.jar -a "org.eclipse.tycho:org.eclipse.osgi" +osgiJarPath=`find ".m2" -name "org.eclipse.osgi_*.jar"` +osgiJar=`basename $osgiJarPath` +osgiVer=`echo $osgiJar | sed 's/^.*_//' | sed 's/.jar//'` + +mvn-rpmbuild org.apache.maven.plugins:maven-install-plugin:install-file \ +-Dfile=$osgiJarPath \ +-Dpackaging=jar \ +-DgroupId=org.eclipse.tycho \ +-DartifactId=org.eclipse.osgi \ +-Dversion=$osgiVer -# org.eclipse.jdt.core -install -pm 644 %{_mavenpomdir}/JPP.eclipse-jdt.core.pom $RPM_BUILD_ROOT%{_mavenpomdir}/JPP.tycho-jdt.core.pom -install -m 644 %{_javadir}/eclipse/jdt.core.jar $RPM_BUILD_ROOT%{_javadir}/%{name}/ -%add_maven_depmap JPP.%{name}-jdt.core.pom %{name}/jdt.core.jar -a "org.eclipse.tycho:org.eclipse.jdt.core" +osgiPomPath=`find ".m2/org/eclipse/tycho/org.eclipse.osgi" -name "org.eclipse.osgi-*.pom"` + +install -pm 644 $osgiPomPath $RPM_BUILD_ROOT%{_mavenpomdir}/JPP.tycho-osgi.pom +install -m 644 $osgiJarPath $RPM_BUILD_ROOT%{_javadir}/%{name}/osgi.jar +%add_maven_depmap JPP.%{name}-osgi.pom %{name}/osgi.jar -a "org.eclipse.tycho:org.eclipse.osgi" +%endif %files %{_mavenpomdir}/* @@ -219,6 +250,9 @@ install -m 644 %{_javadir}/eclipse/jdt.core.jar $RPM_BUILD_ROOT%{_javadir}/%{nam %{_javadocdir}/%{name} %changelog +* Mon Nov 5 2012 Roland Grunberg 0.16.0-16 +- Add capability to build without depending on Tycho or Eclipse. + * Sat Oct 20 2012 Roland Grunberg 0.16.0-15 - Package org.eclipse.osgi and org.eclipse.jdt.core.