Accepting request 818092 from home:fstrba:maven:test

new version

OBS-URL: https://build.opensuse.org/request/show/818092
OBS-URL: https://build.opensuse.org/package/show/Java:packages/tycho?expand=0&rev=13
This commit is contained in:
2020-07-01 11:56:25 +00:00
committed by Git OBS Bridge
parent 30f049a9e4
commit f75d9ff9c4
19 changed files with 561 additions and 457 deletions

View File

@@ -27,20 +27,15 @@
%global fp_p2_git_tag 290f67a4c717599b2f5166ea89aa5365571314b1
%global fp_p2_version 0.0.1
%global fp_p2_snap -SNAPSHOT
%global xmvn_libdir %(realpath $(dirname $(readlink -f $(which xmvn)))/../lib)
%define __requires_exclude osgi*
# Allow conditionally building without Junit 5 support
%bcond_without junit5
%if %{with bootstrap}
Name: tycho-bootstrap
%else
Name: tycho
%endif
Version: 1.2.0
Version: 1.6.0
Release: 0
Summary: Plugins and extensions for building Eclipse plugins and OSGI bundles with Maven
# license file is missing but all files having some licensing information are ASL 2.0
License: Apache-2.0 AND EPL-1.0
Group: Development/Libraries/Java
URL: https://eclipse.org/tycho
# Tycho project source
Source0: http://git.eclipse.org/c/tycho/org.eclipse.tycho.git/snapshot/org.eclipse.tycho-%{git_tag}.tar.xz
@@ -56,23 +51,23 @@ Source5: tycho-debundle.sh
# Script that can be used to install or simulate installation of P2
# artifacts. It is used in OSGi requires generation.
Source6: p2-install.sh
Patch0: tycho-fix-build.patch
# Submitted upstream: https://bugs.eclipse.org/bugs/show_bug.cgi?id=535564
Patch1: tycho-maven-archiver-3.0.1.patch
Patch2: tycho-use-custom-resolver.patch
Patch3: tycho-maven-delegation.patch
# Changes needed for building against latest surefire
# Submitted upstream: https://bugs.eclipse.org/bugs/show_bug.cgi?id=537419
Patch4: build-against-surefire-2.21.patch
Patch5: build-against-surefire-2.22.patch
# Fedora-specific patches
Patch0: 0001-Fix-the-Tycho-build-to-work-on-Fedora.patch
Patch1: 0002-Implement-a-custom-resolver-for-Tycho-in-local-mode.patch
Patch2: 0003-Tycho-should-always-delegate-artifact-resolution-to-.patch
# Submitted upstream: https://bugs.eclipse.org/bugs/show_bug.cgi?id=537963
Patch6: use-java8-for-default-ee.patch
# Build against org.apache.maven.surefire:surefire-junit-platform instead of
# against org.junit.platform:junit-platform-surefire-provider
Patch7: port-to-surefire-junit-platform.patch
Patch3: 0004-Bug-537963-Make-the-default-EE-Java-1.8.patch
# Fix compile error with uncaught exception
Patch4: 0005-Fix-uncaught-exception.patch
# Fix mis-scoped test deps, see: ebz#560394
Patch5: 0006-Mockito-does-not-have-test-scope.patch
# Fix incorrect generated requires
Patch6: 0007-Fix-dependency-problems-when-bootstrapping-with-extr.patch
Patch7: 0008-Use-custom-resolver-for-tycho-eclipserun-plugin.patch
Patch100: fedoraproject-p2-bootstrap-fix.patch
BuildRequires: bash
BuildRequires: fdupes
BuildRequires: glassfish-annotation-api
BuildRequires: java-devel >= 1.8
BuildRequires: maven-local
BuildRequires: unzip
@@ -80,72 +75,72 @@ BuildRequires: zip
BuildRequires: mvn(biz.aQute.bnd:bnd-maven-plugin)
BuildRequires: mvn(com.beust:jcommander)
BuildRequires: mvn(de.pdark:decentxml)
BuildRequires: mvn(junit:junit)
BuildRequires: mvn(io.takari.polyglot:polyglot-common)
BuildRequires: mvn(org.apache.commons:commons-compress)
BuildRequires: mvn(org.apache.commons:commons-exec)
BuildRequires: mvn(org.apache.commons:commons-lang3)
BuildRequires: mvn(org.apache.felix:maven-bundle-plugin)
BuildRequires: mvn(org.apache.maven.plugin-testing:maven-plugin-testing-harness)
BuildRequires: mvn(org.apache.maven.plugin-tools:maven-plugin-annotations)
BuildRequires: mvn(org.apache.maven.plugins:maven-clean-plugin)
BuildRequires: mvn(org.apache.maven.plugins:maven-dependency-plugin)
BuildRequires: mvn(org.apache.maven.plugins:maven-install-plugin)
BuildRequires: mvn(org.apache.maven.plugins:maven-plugin-plugin)
BuildRequires: mvn(org.apache.maven.plugins:maven-source-plugin)
BuildRequires: mvn(org.apache.maven.shared:maven-verifier)
BuildRequires: mvn(org.apache.maven.surefire:maven-surefire-common)
BuildRequires: mvn(org.apache.maven.surefire:surefire-api)
BuildRequires: mvn(org.apache.maven.surefire:surefire-booter)
BuildRequires: mvn(org.apache.maven.surefire:surefire-logger-api)
BuildRequires: mvn(org.apache.maven:maven-archiver)
BuildRequires: mvn(org.apache.maven:maven-compat)
BuildRequires: mvn(org.apache.maven:maven-core)
BuildRequires: mvn(org.apache.maven:maven-model)
BuildRequires: mvn(org.apache.maven:maven-model-builder)
BuildRequires: mvn(org.apache.maven:maven-plugin-api)
BuildRequires: mvn(org.apiguardian:apiguardian-api)
BuildRequires: mvn(org.codehaus.plexus:plexus-archiver)
BuildRequires: mvn(org.codehaus.plexus:plexus-compiler-api)
BuildRequires: mvn(org.codehaus.plexus:plexus-compiler-manager)
BuildRequires: mvn(org.codehaus.plexus:plexus-component-annotations)
BuildRequires: mvn(org.codehaus.plexus:plexus-component-metadata)
BuildRequires: mvn(org.codehaus.plexus:plexus-container-default)
BuildRequires: mvn(org.codehaus.plexus:plexus-utils)
BuildRequires: mvn(org.easymock:easymock)
BuildRequires: mvn(org.eclipse.tycho:org.eclipse.jdt.compiler.apt)
BuildRequires: mvn(org.eclipse.tycho:org.eclipse.jdt.core)
BuildRequires: mvn(org.eclipse.jdt:ecj)
BuildRequires: mvn(org.eclipse.sisu:org.eclipse.sisu.plexus)
BuildRequires: mvn(org.fedoraproject.xmvn:xmvn-api)
BuildRequires: mvn(org.fedoraproject.xmvn:xmvn-core)
BuildRequires: mvn(org.fedoraproject.xmvn:xmvn-install)
BuildRequires: mvn(org.fedoraproject.xmvn:xmvn-parent:pom:)
BuildRequires: mvn(org.hamcrest:hamcrest-core)
BuildRequires: mvn(org.mockito:mockito-core)
BuildRequires: mvn(org.opentest4j:opentest4j)
BuildRequires: mvn(org.ow2.asm:asm-debug-all)
BuildRequires: mvn(org.ow2.asm:asm-tree)
BuildRequires: mvn(org.ow2.asm:asm-util)
BuildRequires: mvn(org.slf4j:slf4j-api)
BuildRequires: mvn(org.slf4j:slf4j-simple)
BuildConflicts: java >= 9
BuildConflicts: java-devel >= 9
BuildConflicts: java-headless >= 9
Requires: ecj >= 4.7.3a-1
# maven-clean-plugin is bound to "initialize" Maven phase for
# "eclipse-repository" projects
Requires: maven-clean-plugin
Requires: maven-local
Requires: xmvn-minimal >= 3
# Extras was folded into the main tycho package
Obsoletes: tycho-extras < %{version}-%{release}
Provides: tycho-extras = %{version}-%{release}
BuildArch: noarch
# Upstream Eclipse no longer supports non-64bit arches
ExcludeArch: s390 %{arm} %{ix86}
%if %{with bootstrap}
Name: tycho-bootstrap
%else
Name: tycho
%endif
# Prebuilt Eclipse bundles needed to build Tycho when Eclipse is not present
# or when the Eclipse that is present is not compatible
%if %{with bootstrap}
Source10: eclipse-bootstrap-photon.tar.xz
Source10: eclipse-bootstrap-2019-12.tar.xz
%endif
%if %{without bootstrap}
# Ordinarily Tycho additionally requires itself and Eclipse to build
BuildRequires: %{name}-bootstrap
BuildRequires: eclipse-platform-bootstrap >= 4.8.0
Requires: eclipse-platform >= 4.8.0
Obsoletes: %{name}-bootstrap
#!BuildRequires: eclipse-emf-core-bootstrap
#!BuildRequires: eclipse-ecf-core-bootstrap
%else
%if %{with junit5}
BuildRequires: mvn(org.apache.maven.surefire:surefire-junit-platform)
BuildRequires: mvn(org.apiguardian:apiguardian-api)
BuildRequires: mvn(org.opentest4j:opentest4j)
%endif
%if %{with bootstrap}
# For bootstrapping, we just need the dependencies of the Eclipse bundles we use
BuildRequires: osgi(com.ibm.icu)
BuildRequires: osgi(javax.servlet-api)
@@ -153,14 +148,18 @@ BuildRequires: osgi(javax.servlet.jsp)
BuildRequires: osgi(org.apache.batik.css)
BuildRequires: osgi(org.apache.commons.jxpath)
BuildRequires: osgi(org.apache.felix.scr)
BuildRequires: osgi(org.sat4j.core) >= 2.3.5
BuildRequires: osgi(org.sat4j.pb) >= 2.3.5
BuildRequires: osgi(org.sat4j.core)
BuildRequires: osgi(org.sat4j.pb)
BuildRequires: osgi(org.w3c.css.sac)
%endif
%if %{with junit5}
BuildRequires: mvn(org.apache.maven.surefire:surefire-junit-platform)
BuildRequires: mvn(org.apiguardian:apiguardian-api)
BuildRequires: mvn(org.opentest4j:opentest4j)
BuildRequires: osgi(osgi.cmpn)
%else
# Ordinarily Tycho additionally requires itself and Eclipse to build
BuildRequires: %{name}-bootstrap
BuildRequires: eclipse-platform-bootstrap
Requires: eclipse-platform
Obsoletes: %{name}-bootstrap
#!BuildRequires: eclipse-emf-core-bootstrap
#!BuildRequires: eclipse-ecf-core-bootstrap
%endif
%description
@@ -190,7 +189,8 @@ no duplication of metadata between POM and OSGi metadata.
%package javadoc
Summary: Javadocs for %{name}
Group: Documentation/HTML
Obsoletes: tycho-extras-javadoc < %{version}-%{release}
Provides: tycho-extras-javadoc = %{version}-%{release}
%description javadoc
This package contains the API documentation for %{name}.
@@ -200,11 +200,11 @@ This package contains the API documentation for %{name}.
mv fedoraproject-p2-%{fp_p2_git_tag} fedoraproject-p2
%patch0 -p1
%patch1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch100
@@ -212,14 +212,15 @@ mv fedoraproject-p2-%{fp_p2_git_tag} fedoraproject-p2
# Unneeded for RPM builds
%pom_remove_plugin :maven-site-plugin
# These tycho plug-ins don't make sense in the context of RPM builds of Eclipse plug-ins
%pom_disable_module tycho-buildtimestamp-jgit tycho-extras
%pom_disable_module tycho-sourceref-jgit tycho-extras
%if %{without junit5}
%pom_disable_module org.eclipse.tycho.surefire.junit5 tycho-surefire
%pom_remove_dep ":org.eclipse.tycho.surefire.junit5" tycho-surefire/tycho-surefire-plugin
%endif
# Switch for "tycho" platform deps
%pom_change_dep org.eclipse.jdt: org.eclipse.tycho: . tycho-compiler-jdt
# Move from org.sonatype.aether to org.eclipse.aether
find . -name "*.java" | xargs sed -i 's/org.sonatype.aether/org.eclipse.aether/g'
find . -name "*.java" | xargs sed -i 's/org.eclipse.aether.util.DefaultRepositorySystemSession/org.eclipse.aether.DefaultRepositorySystemSession/g'
@@ -231,46 +232,51 @@ pushd tycho-maven-plugin/src/main/java/org/fedoraproject
cp %{SOURCE2} .
popd
# These units cannot be found during a regular build
sed -i '/^<unit id=.*$/d' tycho-bundles/tycho-bundles-target/tycho-bundles-target.target
# Homogenise requirement on OSGi bundle
%if %{with bootstrap}
sed -i -e "s/>org.eclipse.platform</>org.eclipse.tycho</" pom.xml tycho-core/pom.xml sisu-equinox/sisu-equinox-embedder/pom.xml
%else
sed -i -e "s/>org.eclipse.tycho</>org.eclipse.platform</" fedoraproject-p2/xmvn-p2-installer-plugin/pom.xml
%endif
# Target platform does not really apply to RPM builds
%pom_disable_module tycho-bundles-target tycho-bundles
%pom_xpath_remove "pom:target" tycho-bundles
# Disable maven-properties-plugin used by tests
%pom_remove_plugin org.sonatype.plugins:maven-properties-plugin tycho-extras/tycho-p2-extras-plugin
# Remove dep on maven tarball used by tests
%pom_remove_dep org.apache.maven:apache-maven tycho-extras/tycho-p2-extras-plugin
# we don't have org.apache.commons:commons-compress:jar:sources
%pom_xpath_remove "pom:dependency[pom:classifier='sources' and pom:artifactId='commons-compress']" tycho-p2/tycho-p2-director-plugin
# Previously, JUnit would re-export Hamcrest
# Now modules using org.hamcrest.core must state the requirement explicitly
for mod in tycho-bundles/org.eclipse.tycho.{p2.{maven.repository.tests,resolver.impl.test,tools.tests},test.utils,core.shared.tests}; do
sed -i 's/^Require-Bundle://
/org\.junit/ i Require-Bundle: org.hamcrest.core,' \
$mod/META-INF/MANIFEST.MF
done
# Fix bundle names
sed -i -e 's/org\.hamcrest/org.hamcrest.core/' tycho-bundles/pom.xml
sed -i -e 's/org\.mockito/org.mockito.mockito-core/' \
tycho-bundles/org.eclipse.tycho.p2.tools.tests/META-INF/MANIFEST.MF \
tycho-bundles/org.eclipse.tycho.p2.maven.repository.tests/META-INF/MANIFEST.MF \
tycho-bundles/org.eclipse.tycho.p2.resolver.shared.tests/META-INF/MANIFEST.MF
# Bootstrap Build
%if %{with bootstrap}
# Don't build tests when bootstrapping
# Don't build tests
for b in core.shared.tests p2.resolver.impl.test p2.resolver.shared.tests p2.maven.repository.tests p2.tools.tests test.utils ; do
%pom_disable_module org.eclipse.tycho.$b tycho-bundles
done
%pom_disable_module org.fedoraproject.p2.tests fedoraproject-p2
%pom_disable_module tycho-testing-harness
%pom_remove_dep -r :::test
# Bootstrap Build
%if %{with bootstrap}
# Break circular dep between tycho-lib-detector and tycho-compiler-jdt for bootstrapping
%pom_xpath_remove "pom:compilerId" tycho-lib-detector
%pom_remove_dep "org.eclipse.tycho:tycho-compiler-jdt" tycho-lib-detector
# Unpack a compatible version of Eclipse we can use to build against
tar -xf %{SOURCE10}
# Install OSGi bundles into local repo to override any incompatible system version
# that may be already installed
pushd bootstrap
for f in usr/lib/eclipse/plugins/org.eclipse.osgi.compatibility.state_*.jar \
usr/lib/eclipse/plugins/org.eclipse.osgi.services_*.jar \
usr/lib/eclipse/plugins/org.eclipse.osgi.util_*.jar \
usr/lib/eclipse/plugins/org.eclipse.osgi_*.jar ; do
xmvn -o install:install-file -Dfile=$f -Dpackaging=jar -DgroupId=org.eclipse.tycho -Dmaven.repo.local=$(pwd)/../.m2 \
-DartifactId=$(echo $(basename $f) | cut -d_ -f1) -Dversion=$(echo "${f%.jar}" | cut -d_ -f2)
-DartifactId=$(echo $(basename $f) | cut -d_ -f1) -Dversion=$(echo "${f%%.jar}" | cut -d_ -f2)
done
popd
@@ -301,6 +307,11 @@ sed -i s/$sysVer/%{version}-SNAPSHOT/ META-INF/plexus/components.xml
jar uf boot/tycho-maven-plugin.jar META-INF/plexus/components.xml
# Create XMvn metadata for the new JARs and POMs by customizing system Tycho metadata.
sed -i -e 's/xmlns=".*"//' boot/tycho-metadata.xml
%pom_xpath_remove -f "metadata/artifacts/artifact[artifactId='org.eclipse.osgi']" boot/tycho-metadata.xml
%pom_xpath_remove -f "metadata/artifacts/artifact[artifactId='org.eclipse.osgi.util']" boot/tycho-metadata.xml
%pom_xpath_remove -f "metadata/artifacts/artifact[artifactId='org.eclipse.osgi.services']" boot/tycho-metadata.xml
%pom_xpath_remove -f "metadata/artifacts/artifact[artifactId='org.eclipse.osgi.compatibility.state']" boot/tycho-metadata.xml
sed -i '
s|>/[^<]*/\([^/]*\.pom\)</path>|>'$PWD'/boot/\1</path>|
s|>'$sysVer'</version>|>%{version}-SNAPSHOT</version><compatVersions><version>%{version}-SNAPSHOT</version></compatVersions>|
@@ -325,7 +336,7 @@ sed -i '
# Add fp-p2 to main build
%pom_xpath_inject "pom:modules" "<module>fedoraproject-p2</module>"
%mvn_file :{*} tycho/@1
%{mvn_file} :{*} tycho/@1
%build
%if %{with bootstrap}
@@ -345,14 +356,12 @@ sed -i -e 's|type>eclipse.*<|type>jar<|' .xmvn-reactor
# Don't package target platform definition files
%{mvn_package} "::target::" __noinstall
# Don't package fp-p2 tests
%{mvn_package} ":org.fedoraproject.p2.tests" __noinstall
%install
# Get debundling scripts
cp %{SOURCE3} %{SOURCE5} .
%if ! %{with bootstrap}
%if %{without bootstrap}
# Debundle p2 runtime
bash tycho-debundle.sh $(pwd)/tycho-bundles/tycho-bundles-external \
$(pwd)/tycho-bundles/tycho-bundles-external/target/tycho-bundles-external-manifest.txt
@@ -364,17 +373,20 @@ bash tycho-debundle.sh $(pwd)/tycho-bundles/tycho-standalone-p2-director
%if %{with bootstrap}
# Install our own copy of OSGi runtime when bootstrapping to avoid external dep on Eclipse
for b in org.eclipse.osgi \
org.eclipse.osgi.util \
org.eclipse.osgi.services \
org.eclipse.osgi.compatibility.state ; do
osgiJarPath=$(find .m2/org/eclipse/tycho/$b/*/ -name "*.jar")
osgiPomPath=$(find .m2/org/eclipse/tycho/$b/*/ -name "*.pom")
%{mvn_artifact} $osgiPomPath $osgiJarPath
%{mvn_alias} "org.eclipse.tycho:$b" "org.eclipse.osgi:$b"
done
%endif
%mvn_install
%if ! %{with bootstrap}
%if %{without bootstrap}
%fdupes -s %{buildroot}%{_javadocdir}
install -pm 644 tycho-bundles/tycho-bundles-external/target/tycho-bundles-external-manifest.txt %{buildroot}%{_javadir}/tycho
%add_maven_depmap org.eclipse.tycho:tycho-bundles-external:txt:manifest:%{version} tycho/tycho-bundles-external-manifest.txt
%endif
@@ -409,23 +421,22 @@ install -dm 755 %{buildroot}%{_javadir}-utils/
install -pm 755 %{SOURCE6} %{buildroot}%{_javadir}-utils/
# Symlink XMvn P2 plugin with all dependencies so that it can be loaded by XMvn
xmvn_libdir=$(realpath $(dirname $(readlink -f $(which xmvn)))/../lib)
install -dm 755 %{buildroot}${xmvn_libdir}/installer/
install -dm 755 %{buildroot}%{xmvn_libdir}/installer/
%if %{with bootstrap}
ln -s %{_javadir}/tycho/org.eclipse.osgi.jar %{buildroot}${xmvn_libdir}/installer/
ln -s %{_javadir}/tycho/org.eclipse.osgi.jar %{buildroot}%{xmvn_libdir}/installer/
%else
ln -s %{_javadir}/eclipse/osgi.jar %{buildroot}${xmvn_libdir}/installer/
ln -s %{_javadir}/eclipse/osgi.jar %{buildroot}%{xmvn_libdir}/installer/
%endif
ln -s %{_javadir}/tycho/xmvn-p2-installer-plugin.jar %{buildroot}${xmvn_libdir}/installer/
ln -s %{_javadir}/tycho/org.fedoraproject.p2.jar %{buildroot}${xmvn_libdir}/installer/
ln -s %{_javadir}/tycho/xmvn-p2-installer-plugin.jar %{buildroot}%{xmvn_libdir}/installer/
ln -s %{_javadir}/tycho/org.fedoraproject.p2.jar %{buildroot}%{xmvn_libdir}/installer/
%files -f .mfiles
%{xmvn_libdir}/installer
%{_javadir}-utils/p2-install.sh
%if %{with bootstrap}
%{_javadir}/tycho/core.*.jar
%{_javadir}/tycho/equinox.*.jar
%endif
%{_datadir}/xmvn/lib/installer
%{_javadir}-utils/p2-install.sh
%doc README.md
%if %{without bootstrap}