Accepting request 984859 from Java:packages:test

Build using ant

OBS-URL: https://build.opensuse.org/request/show/984859
OBS-URL: https://build.opensuse.org/package/show/Java:packages/picocli?expand=0&rev=4
This commit is contained in:
Fridrich Strba 2022-06-24 09:52:09 +00:00 committed by Git OBS Bridge
parent 4010a70a78
commit d35c01c22f
3 changed files with 120 additions and 4 deletions

98
picocli-build.xml Normal file
View File

@ -0,0 +1,98 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="picocli" default="package" basedir=".">
<!-- ====================================================================== -->
<!-- Build environment properties -->
<!-- ====================================================================== -->
<property file="build.properties"/>
<property name="project.artifactId" value="picocli"/>
<property name="project.version" value="4.6.2"/>
<property name="compiler.source" value="1.8"/>
<property name="compiler.target" value="${compiler.source}"/>
<property name="build.finalName" value="${project.artifactId}-${project.version}"/>
<property name="build.dir" value="target"/>
<property name="build.outputDir" value="${build.dir}/classes"/>
<property name="build.srcDir" value="src/main/java"/>
<property name="build.resourceDir" value="src/main/resources"/>
<property name="reporting.outputDirectory" value="${build.dir}/site"/>
<!-- ====================================================================== -->
<!-- Cleaning up target -->
<!-- ====================================================================== -->
<target name="clean" description="Clean the output directory">
<delete dir="${build.dir}"/>
</target>
<!-- ====================================================================== -->
<!-- Compilation target -->
<!-- ====================================================================== -->
<target name="compile" description="Compile the code">
<mkdir dir="${build.outputDir}"/>
<javac destdir="${build.outputDir}"
nowarn="false"
debug="true"
optimize="false"
deprecation="true"
target="${compiler.target}"
verbose="false"
fork="false"
source="${compiler.source}">
<src>
<pathelement location="${build.srcDir}"/>
</src>
</javac>
</target>
<!-- ====================================================================== -->
<!-- Javadoc target -->
<!-- ====================================================================== -->
<target name="javadoc" description="Generates the Javadoc of the application">
<javadoc sourcepath="${build.srcDir}"
packagenames="*"
destdir="${reporting.outputDirectory}/apidocs"
access="protected"
source="${compiler.source}"
verbose="false"
version="true"
use="true"
author="true"
splitindex="false"
nodeprecated="false"
nodeprecatedlist="false"
notree="false"
noindex="false"
nohelp="false"
nonavbar="false"
serialwarn="false"
charset="ISO-8859-1"
linksource="false"
breakiterator="false"/>
</target>
<!-- ====================================================================== -->
<!-- Package target -->
<!-- ====================================================================== -->
<target name="package" depends="compile" description="Package the application">
<jar jarfile="${build.dir}/${build.finalName}.jar"
compress="true"
index="false"
basedir="${build.outputDir}"
excludes="**/package.html"/>
</target>
<!-- ====================================================================== -->
<!-- A dummy target for the package named after the type it creates -->
<!-- ====================================================================== -->
<target name="jar" depends="package" description="Builds the jar for the application"/>
</project>

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Fri Jun 24 09:48:56 UTC 2022 - Fridrich Strba <fstrba@suse.com>
- Build picocli using ant to avoid cycles
-------------------------------------------------------------------
Tue Jan 18 08:15:11 UTC 2022 - Fridrich Strba <fstrba@suse.com>

View File

@ -24,9 +24,11 @@ License: Apache-2.0
Group: Development/Libraries/Java
URL: https://picocli.info/
Source0: https://github.com/remkop/%{name}/archive/v%{version}.tar.gz
Source1: %{name}-build.xml
BuildRequires: ant
BuildRequires: aqute-bnd
BuildRequires: fdupes
BuildRequires: maven-local
BuildRequires: javapackages-local
BuildArch: noarch
%description
@ -44,9 +46,10 @@ This package contains the API documentation for %{name}.
%prep
%setup -q -n %{name}-%{version}
%pom_xpath_set pom:project/pom:version %{version}
cp %{SOURCE1} build.xml
%build
%mvn_build -f
%ant jar javadoc
# Convert to OSGi bundle
bnd wrap \
--bsn %{name} \
@ -57,14 +60,24 @@ bnd wrap \
mv target/%{name}-%{version}.bar target/%{name}-%{version}.jar
%install
%mvn_install
#jar
install -dm 0755 %{buildroot}%{_javadir}/%{name}
install -pm 0644 target/%{name}-%{version}.jar %{buildroot}%{_javadir}/%{name}/%{name}.jar
#pom
install -dm 0755 %{buildroot}%{_mavenpomdir}/%{name}
install -pm 0644 pom.xml %{buildroot}%{_mavenpomdir}/%{name}/%{name}.pom
%add_maven_depmap %{name}/%{name}.pom %{name}/%{name}.jar
#javadoc
install -dm 0755 %{buildroot}%{_javadocdir}/%{name}
cp -r target/site/apidocs/* %{buildroot}%{_javadocdir}/%{name}/
%fdupes -s %{buildroot}%{_javadocdir}
%files -f .mfiles
%license LICENSE
%doc README.md
%files javadoc -f .mfiles-javadoc
%files javadoc
%{_javadocdir}/%{name}
%license LICENSE
%changelog