forked from pool/java-jwt
This commit is contained in:
parent
ea4fd7f65e
commit
1756653100
143
java-jwt-build.xml
Normal file
143
java-jwt-build.xml
Normal file
@ -0,0 +1,143 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
|
<project name="java-jwt" default="package" basedir=".">
|
||||||
|
|
||||||
|
<!-- ====================================================================== -->
|
||||||
|
<!-- Build environment properties -->
|
||||||
|
<!-- ====================================================================== -->
|
||||||
|
|
||||||
|
<property name="project.groupId" value="com.auth0"/>
|
||||||
|
<property name="project.artifactId" value="java-jwt"/>
|
||||||
|
<property name="project.version" value="4.4.0"/>
|
||||||
|
|
||||||
|
<property name="compiler.release" value="8"/>
|
||||||
|
<property name="compiler.source" value="1.${compiler.release}"/>
|
||||||
|
<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.jmhDir" value="src/jmh/java"/>
|
||||||
|
<property name="build.resourceDir" value="src/main/resources"/>
|
||||||
|
<property name="build.javadocDir" value="src/main/javadoc"/>
|
||||||
|
|
||||||
|
<property name="reporting.outputDirectory" value="${build.dir}/site"/>
|
||||||
|
|
||||||
|
<!-- ====================================================================== -->
|
||||||
|
<!-- Defining classpaths -->
|
||||||
|
<!-- ====================================================================== -->
|
||||||
|
|
||||||
|
<path id="build.classpath">
|
||||||
|
<fileset dir="lib">
|
||||||
|
<include name="**/*.jar"/>
|
||||||
|
</fileset>
|
||||||
|
</path>
|
||||||
|
|
||||||
|
<!-- ====================================================================== -->
|
||||||
|
<!-- 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"
|
||||||
|
release="${compiler.release}"
|
||||||
|
target="${compiler.target}"
|
||||||
|
verbose="false"
|
||||||
|
fork="false"
|
||||||
|
source="${compiler.source}">
|
||||||
|
<src>
|
||||||
|
<pathelement location="${build.srcDir}"/>
|
||||||
|
</src>
|
||||||
|
<classpath>
|
||||||
|
<path refid="build.classpath"/>
|
||||||
|
</classpath>
|
||||||
|
<exclude name="**/module-info.java"/>
|
||||||
|
</javac>
|
||||||
|
<!-- module-info.java built with source/target 9 -->
|
||||||
|
<javac destdir="${build.outputDir}"
|
||||||
|
nowarn="false"
|
||||||
|
debug="true"
|
||||||
|
encoding="utf-8"
|
||||||
|
optimize="false"
|
||||||
|
deprecation="true"
|
||||||
|
release="9"
|
||||||
|
verbose="false"
|
||||||
|
fork="false">
|
||||||
|
<modulepath>
|
||||||
|
<path refid="build.classpath"/>
|
||||||
|
<pathelement location="${build.outputDir}"/>
|
||||||
|
</modulepath>
|
||||||
|
<src>
|
||||||
|
<pathelement location="${build.srcDir}"/>
|
||||||
|
</src>
|
||||||
|
<include name="**/module-info.java"/>
|
||||||
|
</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">
|
||||||
|
<classpath refid="build.classpath"/>
|
||||||
|
</javadoc>
|
||||||
|
</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">
|
||||||
|
<manifest>
|
||||||
|
<attribute name="Implementation-Title" value="${project.artifactId}"/>
|
||||||
|
<attribute name="Implementation-Version" value="${project.version}"/>
|
||||||
|
</manifest>
|
||||||
|
</jar>
|
||||||
|
|
||||||
|
</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>
|
@ -16,6 +16,9 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
|
# The automatic requires would be java-headless >= 9, but the
|
||||||
|
# binaries are java 8 compatible
|
||||||
|
%define __requires_exclude java-headless
|
||||||
Name: java-jwt
|
Name: java-jwt
|
||||||
Version: 4.4.0
|
Version: 4.4.0
|
||||||
Release: 0
|
Release: 0
|
||||||
@ -24,12 +27,16 @@ License: MIT
|
|||||||
Group: Development/Libraries/Java
|
Group: Development/Libraries/Java
|
||||||
URL: https://github.com/auth0/%{name}
|
URL: https://github.com/auth0/%{name}
|
||||||
Source0: https://github.com/auth0/%{name}/archive/%{version}.tar.gz
|
Source0: https://github.com/auth0/%{name}/archive/%{version}.tar.gz
|
||||||
Source1: https://repo1.maven.org/maven2/com/auth0/%{name}/%{version}/%{name}-%{version}.pom
|
Source1: %{name}-build.xml
|
||||||
|
Source2: https://repo1.maven.org/maven2/com/auth0/%{name}/%{version}/%{name}-%{version}.pom
|
||||||
|
BuildRequires: ant
|
||||||
BuildRequires: fdupes
|
BuildRequires: fdupes
|
||||||
BuildRequires: java-devel >= 1.8
|
BuildRequires: jackson-annotations
|
||||||
BuildRequires: maven-local
|
BuildRequires: jackson-core
|
||||||
BuildRequires: mvn(com.fasterxml.jackson.core:jackson-databind)
|
BuildRequires: jackson-databind
|
||||||
BuildRequires: mvn(commons-codec:commons-codec)
|
BuildRequires: java-devel >= 9
|
||||||
|
BuildRequires: javapackages-local >= 6
|
||||||
|
Requires: java-headless >= 1.8
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
|
|
||||||
%description
|
%description
|
||||||
@ -44,27 +51,31 @@ API documentation for the Logback library
|
|||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q
|
%setup -q
|
||||||
cp %{SOURCE1} lib/pom.xml
|
cp %{SOURCE1} lib/build.xml
|
||||||
|
|
||||||
%pom_xpath_remove pom:dependency/pom:scope lib
|
|
||||||
find lib -name module-info.java -print -delete
|
|
||||||
|
|
||||||
%build
|
%build
|
||||||
pushd lib
|
mkdir -p lib/lib
|
||||||
%{mvn_build} -f
|
build-jar-repository -s lib/lib jackson-annotations jackson-core jackson-databind
|
||||||
popd
|
ant -f lib/build.xml jar javadoc
|
||||||
|
|
||||||
%install
|
%install
|
||||||
pushd lib
|
install -dm 0755 %{buildroot}%{_javadir}
|
||||||
%mvn_install
|
install -pm 0644 lib/target/%{name}-%{version}.jar %{buildroot}%{_javadir}/%{name}.jar
|
||||||
%fdupes -s %{buildroot}%{_javadocdir}
|
|
||||||
popd
|
|
||||||
|
|
||||||
%files -f lib/.mfiles
|
install -dm 0755 %{buildroot}%{_mavenpomdir}
|
||||||
|
%{mvn_install_pom} %{SOURCE2} %{buildroot}%{_mavenpomdir}/%{name}.pom
|
||||||
|
%add_maven_depmap %{name}.pom %{name}.jar
|
||||||
|
|
||||||
|
install -dm 0755 %{buildroot}%{_javadocdir}
|
||||||
|
cp -r lib/target/site/apidocs %{buildroot}%{_javadocdir}/%{name}
|
||||||
|
%fdupes -s %{buildroot}%{_javadocdir}
|
||||||
|
|
||||||
|
%files -f .mfiles
|
||||||
%license LICENSE
|
%license LICENSE
|
||||||
%doc README.md
|
%doc README.md
|
||||||
|
|
||||||
%files javadoc -f lib/.mfiles-javadoc
|
%files javadoc
|
||||||
|
%{_javadocdir}/%{name}
|
||||||
%license LICENSE
|
%license LICENSE
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
Loading…
Reference in New Issue
Block a user