Add capability to build without depending on Tycho or Eclipse.
When %%bootstrap flag is set, Tycho will build without a BR on Eclipse or Tycho. This can be used to build when these packages are not yet on the buildroot. This requires a zipped reactor cache containing the dependencies that would have been provided by Tycho, and Eclipse.
This commit is contained in:
parent
367ad0daca
commit
627ff82552
@ -1,8 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
rm -rf $(pwd)/.m2
|
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 clean verify 1>log1.txt 2>log2.txt || exit
|
||||||
|
|
||||||
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
|
|
||||||
|
|
||||||
tar caf maven-repo.tar.xz .m2
|
tar caf maven-repo.tar.xz .m2
|
||||||
|
@ -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 <rgrunber@redhat.com>
|
From: Roland Grunberg <rgrunber@redhat.com>
|
||||||
Date: Tue, 12 Jun 2012 09:56:38 -0400
|
Date: Tue, 12 Jun 2012 09:56:38 -0400
|
||||||
Subject: [PATCH 1/4] Fix the Tycho build to work on Fedora.
|
Subject: [PATCH 1/4] Fix the Tycho build to work on Fedora.
|
||||||
@ -20,13 +20,12 @@ Change-Id: Ic8c0514c1fa10ee53580d2654ac6a363ccd66814
|
|||||||
tycho-artifactcomparator/pom.xml | 4 ++--
|
tycho-artifactcomparator/pom.xml | 4 ++--
|
||||||
.../eclipse/tycho/p2/target/ee/CustomEEResolutionHandler.java | 2 +-
|
.../eclipse/tycho/p2/target/ee/CustomEEResolutionHandler.java | 2 +-
|
||||||
.../tycho-bundles-external/tycho-bundles-external.product | 1 -
|
.../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-standalone-p2-director/p2 Director.product | 1 -
|
||||||
tycho-compiler-jdt/pom.xml | 4 ----
|
tycho-compiler-jdt/pom.xml | 4 ----
|
||||||
.../tycho/core/maven/TychoMavenLifecycleParticipant.java | 4 +++-
|
.../tycho/core/maven/TychoMavenLifecycleParticipant.java | 4 +++-
|
||||||
.../org/eclipse/tycho/test/AbstractTychoIntegrationTest.java | 11 +++++------
|
.../org/eclipse/tycho/test/AbstractTychoIntegrationTest.java | 11 +++++------
|
||||||
.../org/eclipse/tycho/testing/EmptyLifecycleExecutor.java | 8 ++++++++
|
.../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
|
diff --git a/pom.xml b/pom.xml
|
||||||
index afe83e3..ed2d224 100644
|
index afe83e3..ed2d224 100644
|
||||||
@ -89,21 +88,6 @@ index b12ff8c..9e53672 100644
|
|||||||
<plugin id="org.eclipse.equinox.ds"/>
|
<plugin id="org.eclipse.equinox.ds"/>
|
||||||
<plugin id="org.eclipse.equinox.frameworkadmin"/>
|
<plugin id="org.eclipse.equinox.frameworkadmin"/>
|
||||||
<plugin id="org.eclipse.equinox.frameworkadmin.equinox"/>
|
<plugin id="org.eclipse.equinox.frameworkadmin.equinox"/>
|
||||||
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 @@
|
|
||||||
<?pde version="3.8"?><target name="Target platform for Tycho's bundles" sequenceNumber="8">
|
|
||||||
<locations>
|
|
||||||
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="slicer" includeSource="false" type="InstallableUnit">
|
|
||||||
-<unit id="org.eclipse.equinox.executable.feature.group" version="3.6.0.v20120913-142258-7P7OG2BFLWUl7Unz-8OO8IEVz-8"/>
|
|
||||||
-<unit id="org.eclipse.sdk.ide" version="4.3.0.I20121002-0800"/>
|
|
||||||
-<unit id="org.eclipse.equinox.core.sdk.feature.group" version="3.8.0.v20120913-170722-84FAgGhRFnbPjaFro9s2VXtitW"/>
|
|
||||||
-<unit id="org.eclipse.equinox.p2.sdk.feature.group" version="3.8.0.v20120524-0542-9N8BHpPGMMn84SxoTtoj_mfujQDR"/>
|
|
||||||
<repository location="http://download.eclipse.org/eclipse/updates/4.3-I-builds/I20121002-0800"/>
|
|
||||||
</location>
|
|
||||||
</locations>
|
|
||||||
diff --git a/tycho-bundles/tycho-standalone-p2-director/p2 Director.product b/tycho-bundles/tycho-standalone-p2-director/p2 Director.product
|
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
|
index dd80b5e..797b4ba 100644
|
||||||
--- a/tycho-bundles/tycho-standalone-p2-director/p2 Director.product
|
--- a/tycho-bundles/tycho-standalone-p2-director/p2 Director.product
|
||||||
|
15
tycho-remove-units.patch
Normal file
15
tycho-remove-units.patch
Normal file
@ -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 @@
|
||||||
|
<?pde version="3.8"?><target name="Target platform for Tycho's bundles" sequenceNumber="8">
|
||||||
|
<locations>
|
||||||
|
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="slicer" includeSource="false" type="InstallableUnit">
|
||||||
|
-<unit id="org.eclipse.equinox.executable.feature.group" version="3.6.0.v20120913-142258-7P7OG2BFLWUl7Unz-8OO8IEVz-8"/>
|
||||||
|
-<unit id="org.eclipse.sdk.ide" version="4.3.0.I20121002-0800"/>
|
||||||
|
-<unit id="org.eclipse.equinox.core.sdk.feature.group" version="3.8.0.v20120913-170722-84FAgGhRFnbPjaFro9s2VXtitW"/>
|
||||||
|
-<unit id="org.eclipse.equinox.p2.sdk.feature.group" version="3.8.0.v20120524-0542-9N8BHpPGMMn84SxoTtoj_mfujQDR"/>
|
||||||
|
<repository location="http://download.eclipse.org/eclipse/updates/4.3-I-builds/I20121002-0800"/>
|
||||||
|
</location>
|
||||||
|
</locations>
|
58
tycho.spec
58
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)
|
# When building version under development (non-release)
|
||||||
# %%global snap -SNAPSHOT
|
# %%global snap -SNAPSHOT
|
||||||
|
|
||||||
@ -5,7 +8,7 @@
|
|||||||
|
|
||||||
Name: tycho
|
Name: tycho
|
||||||
Version: 0.16.0
|
Version: 0.16.0
|
||||||
Release: 15%{?dist}
|
Release: 16%{?dist}
|
||||||
Summary: Plugins and extensions for building Eclipse plugins and OSGI bundles with Maven
|
Summary: Plugins and extensions for building Eclipse plugins and OSGI bundles with Maven
|
||||||
|
|
||||||
Group: Development/Libraries
|
Group: Development/Libraries
|
||||||
@ -21,6 +24,10 @@ Source1: EmptyMojo.java
|
|||||||
# we need to make sure we are using maven 3 deps
|
# we need to make sure we are using maven 3 deps
|
||||||
Source2: depmap.xml
|
Source2: depmap.xml
|
||||||
Source3: copy-platform-all
|
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
|
Patch0: %{name}-fix-build.patch
|
||||||
# Upstream builds against maven-surefire 2.12.3
|
# 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
|
# a different version from the nonbootstrapped. Otherwise there will
|
||||||
# be cyclic dependencies.
|
# be cyclic dependencies.
|
||||||
Patch4: %{name}-bootstrap.patch
|
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
|
# Set the built intermediary version of Tycho to be found in the reactor cache
|
||||||
Patch5: %{name}-set-reactor-cache-version.patch
|
Patch5: %{name}-set-reactor-cache-version.patch
|
||||||
|
Patch6: %{name}-remove-units.patch
|
||||||
|
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
|
|
||||||
@ -55,9 +63,11 @@ BuildRequires: maven-surefire-provider-junit
|
|||||||
BuildRequires: maven-surefire-provider-junit4
|
BuildRequires: maven-surefire-provider-junit4
|
||||||
BuildRequires: objectweb-asm4
|
BuildRequires: objectweb-asm4
|
||||||
BuildRequires: plexus-containers-component-metadata
|
BuildRequires: plexus-containers-component-metadata
|
||||||
BuildRequires: eclipse-jdt
|
|
||||||
BuildRequires: decentxml
|
BuildRequires: decentxml
|
||||||
|
%if ! %{bootstrap}
|
||||||
|
BuildRequires: eclipse-jdt
|
||||||
BuildRequires: %{name}
|
BuildRequires: %{name}
|
||||||
|
%endif
|
||||||
|
|
||||||
Requires: jpackage-utils
|
Requires: jpackage-utils
|
||||||
Requires: decentxml
|
Requires: decentxml
|
||||||
@ -67,7 +77,10 @@ Requires: maven-dependency-plugin
|
|||||||
Requires: maven-shared-verifier
|
Requires: maven-shared-verifier
|
||||||
Requires: maven-surefire-provider-junit4
|
Requires: maven-surefire-provider-junit4
|
||||||
Requires: objectweb-asm4
|
Requires: objectweb-asm4
|
||||||
#Requires: eclipse-jdt
|
Requires: ecj
|
||||||
|
%if ! %{bootstrap}
|
||||||
|
Requires: eclipse-equinox-osgi
|
||||||
|
%endif
|
||||||
|
|
||||||
|
|
||||||
%description
|
%description
|
||||||
@ -123,6 +136,12 @@ popd
|
|||||||
|
|
||||||
export MAVEN_OPTS="$MAVEN_OPTS -XX:MaxPermSize=256m"
|
export MAVEN_OPTS="$MAVEN_OPTS -XX:MaxPermSize=256m"
|
||||||
|
|
||||||
|
%if %{bootstrap}
|
||||||
|
tar -xf %{SOURCE4}
|
||||||
|
%else
|
||||||
|
|
||||||
|
%patch6 -p1
|
||||||
|
|
||||||
# installed version of Tycho
|
# installed version of Tycho
|
||||||
sysVer=`grep -C 1 "<artifactId>tycho</artifactId>" %{_mavenpomdir}/JPP.tycho-main.pom | grep "version" | sed 's/.*>\(.*\)<.*/\1/'`
|
sysVer=`grep -C 1 "<artifactId>tycho</artifactId>" %{_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
|
# 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.
|
# an intermediary build must be done to prevent a cycle at build time.
|
||||||
if [ "${sysVer}" == "${buildVer}" ]; then
|
if [ "${sysVer}" == "${buildVer}" ]; then
|
||||||
echo "Performing bootstrap build"
|
echo "Performing intermediary build"
|
||||||
%patch4 -p1
|
%patch4 -p1
|
||||||
|
|
||||||
mvn-rpmbuild -Dmaven.local.depmap.file=%{SOURCE2} -DskipTychoVersionCheck -Dmaven.test.skip=true install javadoc:aggregate
|
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
|
%patch5 -p1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
%endif
|
||||||
|
|
||||||
%build
|
%build
|
||||||
mvn-rpmbuild -Dmaven.local.depmap.file=%{SOURCE2} -DskipTychoVersionCheck -Dmaven.test.skip=true clean install javadoc:aggregate
|
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
|
install -pm 755 %{SOURCE3} $RPM_BUILD_ROOT%{_javadir}/%{name}/copy-platform-all
|
||||||
|
|
||||||
|
%if %{bootstrap}
|
||||||
# org.eclipse.osgi
|
# org.eclipse.osgi
|
||||||
install -pm 644 %{_mavenpomdir}/JPP.eclipse-osgi.pom $RPM_BUILD_ROOT%{_mavenpomdir}/JPP.tycho-osgi.pom
|
osgiJarPath=`find ".m2" -name "org.eclipse.osgi_*.jar"`
|
||||||
install -m 644 %{_javadir}/eclipse/osgi.jar $RPM_BUILD_ROOT%{_javadir}/%{name}/
|
osgiJar=`basename $osgiJarPath`
|
||||||
%add_maven_depmap JPP.%{name}-osgi.pom %{name}/osgi.jar -a "org.eclipse.tycho:org.eclipse.osgi"
|
osgiVer=`echo $osgiJar | sed 's/^.*_//' | sed 's/.jar//'`
|
||||||
|
|
||||||
# org.eclipse.jdt.core
|
mvn-rpmbuild org.apache.maven.plugins:maven-install-plugin:install-file \
|
||||||
install -pm 644 %{_mavenpomdir}/JPP.eclipse-jdt.core.pom $RPM_BUILD_ROOT%{_mavenpomdir}/JPP.tycho-jdt.core.pom
|
-Dfile=$osgiJarPath \
|
||||||
install -m 644 %{_javadir}/eclipse/jdt.core.jar $RPM_BUILD_ROOT%{_javadir}/%{name}/
|
-Dpackaging=jar \
|
||||||
%add_maven_depmap JPP.%{name}-jdt.core.pom %{name}/jdt.core.jar -a "org.eclipse.tycho:org.eclipse.jdt.core"
|
-DgroupId=org.eclipse.tycho \
|
||||||
|
-DartifactId=org.eclipse.osgi \
|
||||||
|
-Dversion=$osgiVer
|
||||||
|
|
||||||
|
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
|
%files
|
||||||
%{_mavenpomdir}/*
|
%{_mavenpomdir}/*
|
||||||
@ -219,6 +250,9 @@ install -m 644 %{_javadir}/eclipse/jdt.core.jar $RPM_BUILD_ROOT%{_javadir}/%{nam
|
|||||||
%{_javadocdir}/%{name}
|
%{_javadocdir}/%{name}
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Mon Nov 5 2012 Roland Grunberg <rgrunber@redhat.com> 0.16.0-16
|
||||||
|
- Add capability to build without depending on Tycho or Eclipse.
|
||||||
|
|
||||||
* Sat Oct 20 2012 Roland Grunberg <rgrunber@redhat.com> 0.16.0-15
|
* Sat Oct 20 2012 Roland Grunberg <rgrunber@redhat.com> 0.16.0-15
|
||||||
- Package org.eclipse.osgi and org.eclipse.jdt.core.
|
- Package org.eclipse.osgi and org.eclipse.jdt.core.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user