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
|
||||
Version: 4.4.0
|
||||
Release: 0
|
||||
@ -24,12 +27,16 @@ License: MIT
|
||||
Group: Development/Libraries/Java
|
||||
URL: https://github.com/auth0/%{name}
|
||||
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: java-devel >= 1.8
|
||||
BuildRequires: maven-local
|
||||
BuildRequires: mvn(com.fasterxml.jackson.core:jackson-databind)
|
||||
BuildRequires: mvn(commons-codec:commons-codec)
|
||||
BuildRequires: jackson-annotations
|
||||
BuildRequires: jackson-core
|
||||
BuildRequires: jackson-databind
|
||||
BuildRequires: java-devel >= 9
|
||||
BuildRequires: javapackages-local >= 6
|
||||
Requires: java-headless >= 1.8
|
||||
BuildArch: noarch
|
||||
|
||||
%description
|
||||
@ -44,27 +51,31 @@ API documentation for the Logback library
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
cp %{SOURCE1} lib/pom.xml
|
||||
|
||||
%pom_xpath_remove pom:dependency/pom:scope lib
|
||||
find lib -name module-info.java -print -delete
|
||||
cp %{SOURCE1} lib/build.xml
|
||||
|
||||
%build
|
||||
pushd lib
|
||||
%{mvn_build} -f
|
||||
popd
|
||||
mkdir -p lib/lib
|
||||
build-jar-repository -s lib/lib jackson-annotations jackson-core jackson-databind
|
||||
ant -f lib/build.xml jar javadoc
|
||||
|
||||
%install
|
||||
pushd lib
|
||||
%mvn_install
|
||||
%fdupes -s %{buildroot}%{_javadocdir}
|
||||
popd
|
||||
install -dm 0755 %{buildroot}%{_javadir}
|
||||
install -pm 0644 lib/target/%{name}-%{version}.jar %{buildroot}%{_javadir}/%{name}.jar
|
||||
|
||||
%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
|
||||
%doc README.md
|
||||
|
||||
%files javadoc -f lib/.mfiles-javadoc
|
||||
%files javadoc
|
||||
%{_javadocdir}/%{name}
|
||||
%license LICENSE
|
||||
|
||||
%changelog
|
||||
|
Loading…
Reference in New Issue
Block a user