Build without Tycho

This commit is contained in:
Mikolaj Izdebski 2017-01-29 19:30:56 +01:00
parent 298008414e
commit da2aadbf94
5 changed files with 189 additions and 139 deletions

72
sisu-inject.pom Normal file
View File

@ -0,0 +1,72 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.eclipse.sisu</groupId>
<artifactId>org.eclipse.sisu.inject</artifactId>
<version>0.3.2</version>
<dependencies>
<dependency>
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
<classifier>no_aop</classifier>
<version>4.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<version>1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.enterprise</groupId>
<artifactId>cdi-api</artifactId>
<version>1.1</version>
</dependency>
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
<version>1.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.inject.extensions</groupId>
<artifactId>guice-servlet</artifactId>
<version>4.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.13</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>osgi.core</artifactId>
<version>6.0.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.9.10</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<sourceDirectory>org.eclipse.sisu.inject/src</sourceDirectory>
</build>
</project>

11
sisu-osgi-api.patch Normal file
View File

@ -0,0 +1,11 @@
--- sisu-plexus/org.eclipse.sisu.plexus/src/org/eclipse/sisu/plexus/PlexusBundlePlan.java~ 2015-09-13 20:15:37.000000000 +0200
+++ sisu-plexus/org.eclipse.sisu.plexus/src/org/eclipse/sisu/plexus/PlexusBundlePlan.java 2017-01-29 19:56:51.608151337 +0100
@@ -80,7 +80,7 @@
protected static boolean hasPlexusAnnotations( final Bundle bundle )
{
- final String imports = bundle.getHeaders().get( Constants.IMPORT_PACKAGE );
+ final String imports = bundle.getHeaders().get( Constants.IMPORT_PACKAGE ).toString();
return null != imports && imports.contains( "org.codehaus.plexus.component.annotations" );
}

12
sisu-parent.pom Normal file
View File

@ -0,0 +1,12 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.fedoraproject.maven</groupId>
<artifactId>aggregator-project</artifactId>
<version>0.3.2</version>
<packaging>pom</packaging>
<modules>
<module>sisu-inject</module>
<module>sisu-plexus</module>
</modules>
</project>

67
sisu-plexus.pom Normal file
View File

@ -0,0 +1,67 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.eclipse.sisu</groupId>
<artifactId>org.eclipse.sisu.plexus</artifactId>
<version>0.3.2</version>
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>org.eclipse.sisu.inject</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-classworlds</artifactId>
<version>2.5.2</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-component-annotations</artifactId>
<version>1.6</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
<version>3.0.22</version>
</dependency>
<dependency>
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
<classifier>no_aop</classifier>
<version>4.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.13</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>osgi.core</artifactId>
<version>6.0.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<sourceDirectory>org.eclipse.sisu.plexus/src</sourceDirectory>
<resources>
<resource>
<targetPath>META-INF/plexus</targetPath>
<filtering>false</filtering>
<directory>${basedir}/org.eclipse.sisu.plexus/META-INF/plexus</directory>
<includes>
<include>components.xml</include>
</includes>
</resource>
</resources>
</build>
</project>

166
sisu.spec
View File

@ -5,7 +5,7 @@
Name: sisu Name: sisu
Epoch: 1 Epoch: 1
Version: 0.3.2 Version: 0.3.2
Release: 4%{?dist} Release: 5%{?dist}
Summary: Eclipse dependency injection framework Summary: Eclipse dependency injection framework
License: EPL License: EPL
URL: http://eclipse.org/sisu URL: http://eclipse.org/sisu
@ -13,56 +13,30 @@ URL: http://eclipse.org/sisu
Source0: http://git.eclipse.org/c/%{name}/org.eclipse.%{name}.inject.git/snapshot/%{reltype}s/%{version}%{?reltag}.tar.bz2#/org.eclipse.%{name}.inject-%{version}%{?reltag}.tar.bz2 Source0: http://git.eclipse.org/c/%{name}/org.eclipse.%{name}.inject.git/snapshot/%{reltype}s/%{version}%{?reltag}.tar.bz2#/org.eclipse.%{name}.inject-%{version}%{?reltag}.tar.bz2
Source1: http://git.eclipse.org/c/%{name}/org.eclipse.%{name}.plexus.git/snapshot/%{reltype}s/%{version}%{?reltag}.tar.bz2#/org.eclipse.%{name}.plexus-%{version}%{?reltag}.tar.bz2 Source1: http://git.eclipse.org/c/%{name}/org.eclipse.%{name}.plexus.git/snapshot/%{reltype}s/%{version}%{?reltag}.tar.bz2#/org.eclipse.%{name}.plexus-%{version}%{?reltag}.tar.bz2
Source100: %{name}-parent.pom
Source101: %{name}-inject.pom
Source102: %{name}-plexus.pom
Patch0: %{name}-OSGi-import-guava.patch Patch0: %{name}-OSGi-import-guava.patch
Patch2: %{name}-ignored-tests.patch Patch2: %{name}-ignored-tests.patch
Patch3: %{name}-osgi-api.patch
BuildArch: noarch BuildArch: noarch
BuildRequires: maven-local >= 4.2 BuildRequires: maven-local
BuildRequires: mvn(ch.qos.logback:logback-classic) BuildRequires: mvn(com.google.inject.extensions:guice-servlet)
BuildRequires: mvn(com.google.inject.extensions:guice-assistedinject) BuildRequires: mvn(com.google.inject:guice::no_aop:)
BuildRequires: mvn(com.google.inject:guice)
BuildRequires: mvn(javax.annotation:javax.annotation-api) BuildRequires: mvn(javax.annotation:javax.annotation-api)
BuildRequires: mvn(javax.enterprise:cdi-api) BuildRequires: mvn(javax.enterprise:cdi-api)
BuildRequires: mvn(javax.inject:javax.inject)
BuildRequires: mvn(javax.servlet:servlet-api)
BuildRequires: mvn(junit:junit) BuildRequires: mvn(junit:junit)
BuildRequires: mvn(net.sf.cglib:cglib)
BuildRequires: mvn(org.apache.felix:org.apache.felix.framework)
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-deploy-plugin)
BuildRequires: mvn(org.codehaus.mojo:build-helper-maven-plugin)
BuildRequires: mvn(org.codehaus.plexus:plexus-classworlds) BuildRequires: mvn(org.codehaus.plexus:plexus-classworlds)
BuildRequires: mvn(org.codehaus.plexus:plexus-component-annotations) BuildRequires: mvn(org.codehaus.plexus:plexus-component-annotations)
BuildRequires: mvn(org.codehaus.plexus:plexus-utils) BuildRequires: mvn(org.codehaus.plexus:plexus-utils)
BuildRequires: mvn(org.eclipse.tycho:tycho-maven-plugin) BuildRequires: mvn(org.osgi:osgi.core)
BuildRequires: mvn(org.eclipse.tycho:tycho-source-plugin)
BuildRequires: mvn(org.jacoco:jacoco-maven-plugin)
BuildRequires: mvn(org.osgi:org.osgi.core)
BuildRequires: mvn(org.ow2.asm:asm)
BuildRequires: mvn(org.slf4j:slf4j-api) BuildRequires: mvn(org.slf4j:slf4j-api)
BuildRequires: mvn(org.sonatype.oss:oss-parent:pom:) BuildRequires: mvn(org.testng:testng)
BuildRequires: osgi(aopalliance)
BuildRequires: osgi(com.google.inject)
BuildRequires: osgi(com.google.inject.servlet)
BuildRequires: osgi(com.google.guava)
BuildRequires: osgi(javax.el)
BuildRequires: osgi(javax.enterprise.cdi-api)
BuildRequires: osgi(javax.inject)
BuildRequires: osgi(javax.servlet)
BuildRequires: osgi(javax.xml.rpc)
BuildRequires: osgi(org.apache.geronimo.specs.geronimo-annotation_1.1_spec)
BuildRequires: osgi(org.apache.geronimo.specs.geronimo-ejb_3.1_spec)
BuildRequires: osgi(org.codehaus.plexus.classworlds)
BuildRequires: osgi(org.codehaus.plexus.component-annotations)
BuildRequires: osgi(org.codehaus.plexus.utils)
BuildRequires: osgi(org.eclipse.jdt.apt.core)
BuildRequires: osgi(org.eclipse.osgi)
BuildRequires: osgi(org.eclipse.osgi.source)
BuildRequires: osgi(org.hamcrest.core)
BuildRequires: osgi(org.junit)
BuildRequires: osgi(org.testng)
BuildRequires: osgi(slf4j.api)
%description %description
@ -71,30 +45,7 @@ style dependency injection.
%package inject %package inject
Summary: Sisu inject Summary: Sisu inject
Obsoletes: %{name}-tests < 1:0.3.2-5
Obsoletes: %{name} < %{epoch}:%{version}-%{release}
Obsoletes: %{name}-bean < %{epoch}:%{version}-%{release}
Obsoletes: %{name}-bean-binders < %{epoch}:%{version}-%{release}
Obsoletes: %{name}-bean-containers < %{epoch}:%{version}-%{release}
Obsoletes: %{name}-bean-converters < %{epoch}:%{version}-%{release}
Obsoletes: %{name}-bean-inject < %{epoch}:%{version}-%{release}
Obsoletes: %{name}-bean-locators < %{epoch}:%{version}-%{release}
Obsoletes: %{name}-bean-reflect < %{epoch}:%{version}-%{release}
Obsoletes: %{name}-bean-scanners < %{epoch}:%{version}-%{release}
Obsoletes: %{name}-containers < %{epoch}:%{version}-%{release}
Obsoletes: %{name}-inject-bean < %{epoch}:%{version}-%{release}
Obsoletes: %{name}-inject-plexus < %{epoch}:%{version}-%{release}
Obsoletes: %{name}-osgi-registry < %{epoch}:%{version}-%{release}
Obsoletes: %{name}-parent < %{epoch}:%{version}-%{release}
Obsoletes: %{name}-plexus-binders < %{epoch}:%{version}-%{release}
Obsoletes: %{name}-plexus-converters < %{epoch}:%{version}-%{release}
Obsoletes: %{name}-plexus-lifecycles < %{epoch}:%{version}-%{release}
Obsoletes: %{name}-plexus-locators < %{epoch}:%{version}-%{release}
Obsoletes: %{name}-plexus-metadata < %{epoch}:%{version}-%{release}
Obsoletes: %{name}-plexus-scanners < %{epoch}:%{version}-%{release}
Obsoletes: %{name}-plexus-shim < %{epoch}:%{version}-%{release}
Obsoletes: %{name}-registries < %{epoch}:%{version}-%{release}
Obsoletes: %{name}-spi-registry < %{epoch}:%{version}-%{release}
%description inject %description inject
This package contains %{summary}. This package contains %{summary}.
@ -105,12 +56,6 @@ Summary: Sisu Plexus
%description plexus %description plexus
This package contains %{summary}. This package contains %{summary}.
%package tests
Summary: Sisu tests
%description tests
This package contains %{summary}.
%package javadoc %package javadoc
Summary: API documentation for Sisu Summary: API documentation for Sisu
@ -122,96 +67,39 @@ This package contains %{summary}.
tar xf %{SOURCE0} && mv %{reltype}s/* sisu-inject && rmdir %{reltype}s tar xf %{SOURCE0} && mv %{reltype}s/* sisu-inject && rmdir %{reltype}s
tar xf %{SOURCE1} && mv %{reltype}s/* sisu-plexus && rmdir %{reltype}s tar xf %{SOURCE1} && mv %{reltype}s/* sisu-plexus && rmdir %{reltype}s
cp %{SOURCE100} pom.xml
cp %{SOURCE101} sisu-inject/pom.xml
cp %{SOURCE102} sisu-plexus/pom.xml
%patch0 %patch0
%patch2 %patch2
%patch3
# Unbundle ASM
rm -rf sisu-inject/org.eclipse.sisu.inject/src/org/eclipse/sisu/space/asm/
sed -i 's/org.eclipse.sisu.space.asm/org.objectweb.asm/' $(find -name *.java)
sed -i 's/Import-Package: /&org.objectweb.asm;version="5",/' sisu-inject/org.eclipse.sisu.inject/META-INF/MANIFEST.MF
%pom_add_dep org.ow2.asm:asm sisu-inject/org.eclipse.sisu.inject
%pom_add_dep org.ow2.asm:asm sisu-plexus/org.eclipse.sisu.plexus.tests
%mvn_file ":{*}" @1 %mvn_file ":{*}" @1
%mvn_package ":*{inject,plexus,tests}" @1 %mvn_package ":*{inject,plexus}" @1
%mvn_alias :org.eclipse.sisu.plexus org.sonatype.sisu:sisu-inject-plexus %mvn_package : __noinstall
%pom_disable_module org.eclipse.sisu.inject.site sisu-inject
%pom_disable_module org.eclipse.sisu.plexus.site sisu-plexus
%pom_add_dep net.sf.cglib:cglib::test sisu-inject/org.eclipse.sisu.inject.tests
%pom_add_dep net.sf.cglib:cglib::test sisu-plexus/org.eclipse.sisu.plexus.tests
for pom in \
sisu-inject \
sisu-inject/org.eclipse.sisu.inject \
sisu-inject/org.eclipse.sisu.inject.extender \
sisu-plexus \
sisu-plexus/org.eclipse.sisu.plexus \
sisu-plexus/org.eclipse.sisu.plexus.extender
do
%pom_remove_plugin :target-platform-configuration $pom
done
for pom in \
sisu-inject/org.eclipse.sisu.inject \
sisu-inject/org.eclipse.sisu.inject.extender \
sisu-plexus/org.eclipse.sisu.plexus \
sisu-plexus/org.eclipse.sisu.plexus.extender
do
%pom_remove_plugin :animal-sniffer-maven-plugin $pom
done
for pom in sisu-inject/org.eclipse.sisu.inject.tests/pom.xml sisu-plexus/org.eclipse.sisu.plexus/pom.xml; do
%pom_xpath_inject "pom:dependency[pom:artifactId='cdi-api']" '<scope>provided</scope>' $pom
done
# missing dep org.eclipse.tycho.extras:tycho-sourceref-jgit
%pom_xpath_remove "pom:plugin[pom:artifactId[text()='tycho-packaging-plugin']]/pom:dependencies" sisu-inject
%pom_xpath_remove "pom:plugin[pom:artifactId[text()='tycho-packaging-plugin']]/pom:configuration/pom:sourceReferences" sisu-inject
%pom_xpath_remove "pom:plugin[pom:artifactId[text()='tycho-packaging-plugin']]/pom:dependencies" sisu-plexus
%pom_xpath_remove "pom:plugin[pom:artifactId[text()='tycho-packaging-plugin']]/pom:configuration/pom:sourceReferences" sisu-plexus
cat <<EOF >pom.xml
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>org.fedoraproject.maven</groupId>
<artifactId>aggregator-project</artifactId>
<version>dummy</version>
<packaging>pom</packaging>
<modules>
<module>sisu-inject</module>
<module>sisu-plexus</module>
</modules>
</project>
EOF
%build %build
%mvn_build -i %mvn_build
%install %install
%mvn_artifact sisu-inject/pom.xml
%mvn_artifact sisu-inject/org.eclipse.sisu.inject/pom.xml sisu-inject/org.eclipse.sisu.inject/target/org.eclipse.sisu.inject-%{version}%{?reltag}.jar
%mvn_artifact sisu-inject/org.eclipse.sisu.inject.tests/pom.xml sisu-inject/org.eclipse.sisu.inject.tests/target/org.eclipse.sisu.inject.tests-%{version}%{?reltag}.jar
%mvn_artifact sisu-plexus/pom.xml
%mvn_artifact sisu-plexus/org.eclipse.sisu.plexus/pom.xml sisu-plexus/org.eclipse.sisu.plexus/target/org.eclipse.sisu.plexus-%{version}%{?reltag}.jar
%mvn_artifact sisu-plexus/org.eclipse.sisu.plexus.tests/pom.xml sisu-plexus/org.eclipse.sisu.plexus.tests/target/org.eclipse.sisu.plexus.tests-%{version}%{?reltag}.jar
%mvn_install %mvn_install
%files inject -f .mfiles-inject %files inject -f .mfiles-inject
%doc sisu-inject/LICENSE.txt %doc sisu-inject/LICENSE.txt
%files plexus -f .mfiles-plexus %files plexus -f .mfiles-plexus
%files tests -f .mfiles-tests
%files javadoc -f .mfiles-javadoc %files javadoc -f .mfiles-javadoc
%doc sisu-inject/LICENSE.txt %doc sisu-inject/LICENSE.txt
%changelog %changelog
* Sun Jan 29 2017 Mikolaj Izdebski <mizdebsk@redhat.com> - 1:0.3.2-5
- Build without Tycho
- Remove sisu-tests subpackage
- Drop old obsoletes
* Mon Feb 22 2016 Mikolaj Izdebski <mizdebsk@redhat.com> - 1:0.3.2-4 * Mon Feb 22 2016 Mikolaj Izdebski <mizdebsk@redhat.com> - 1:0.3.2-4
- Add alias for org.sonatype.sisu:sisu-inject-plexus - Add alias for org.sonatype.sisu:sisu-inject-plexus