blob: 37c5fb8e739880ce9d859fe38b46d9a38089b958 [file] [log] [blame]
<?xml version="1.0"?>
<!-- This file is intended for ANT, a Java based build tool.
ANT is availale from http://jakarta.apache.org/ant/index.html
This build file is intended to build the org.apache.xml.security package,
available from http://www.xmlsecurity.org/src/ and
http://xml.apache.org/
-->
<project name="The org.apache.xml.security Package" default="usage" basedir=".">
<target name="usage" >
<echo message=""/>
<echo message=""/>
<echo message="${product.Name} Build instructions"/>
<echo message="-------------------------------------------------------------"/>
<echo message=""/>
<echo message=" available targets are:"/>
<echo message=""/>
<echo message=" compile --> compiles everything"/>
<echo message=" compile.library --> compiles the source code"/>
<echo message=" compile.samples --> compiles the samples source code"/>
<echo message=" compile.tests --> compiles the tests source code"/>
<echo message=" docs --> generates the HTML documentation"/>
<echo message=" javadocs --> generates the API documentation (needs Java 1.2 or higher)"/>
<echo message=" test --> runs the defined JUnit tests"/>
<echo message=" clean --> cleans up all generated files and directories"/>
<echo message=" usage --> provides help on using the build tool (default)"/>
<echo message=" jar --> creates the JAR file"/>
<echo message=""/>
<echo message=" See comments inside the build.xml file for more details."/>
<echo message="-------------------------------------------------------------"/>
<echo message=""/>
<echo message=""/>
</target>
<target name="init">
<property name='product.Name' value='Apache-XML-Security-J'/>
<property name='product.name' value='xml-security'/>
<property name='product.shortname' value='xmlsec'/>
<property name='product.Version' value='1.0.0'/>
<property name='product.version' value='1.0.0'/>
<property name='product_version' value='1_0_0'/>
<property name="year" value="2000-2002"/>
<property name="copyright" value="Copyright &#169; ${year} Apache XML Project. All Rights Reserved."/>
<echo message= "---------------- ${product.Name} v${product.Version} [${year}] ---------------"/>
<property name="build.compiler" value="classic"/>
<!--
<property name="build.compiler" value="jikes" />
-->
<property name="src" value="src" />
<property name="src.samples" value="src_samples" />
<property name="src.unitTests" value="src_unitTests" />
<property name="src.JCE.BC" value="src_JCE_BC" />
<property name="build.dir" value="./build"/>
<property name="build.src" value="${build.dir}/src"/>
<property name="build.dest" value="${build.dir}/classes"/>
<property name="build.samples" value="${build.dir}/samples"/>
<property name="build.tests" value="${build.dir}/tests"/>
<property name="build.data" value="${build.dir}/data"/>
<property name="build.docs" value="${build.dir}/docs"/>
<property name="build.javadocs" value="${build.docs}/javadocs"/>
<property name="build.srcdist" value="${build.dir}/dist_src"/>
<property name="build.bindist" value="${build.dir}/dist_bin"/>
<property name="jar.library" value="${product.shortname}.jar" />
<property name="jar.samples" value="${product.shortname}Samples.jar" />
<property name="jar.tests" value="${product.shortname}Tests.jar" />
<property name="cvs.server" value="cvs.apache.org" />
<property name="cvs.path" value="/home/cvs" />
<property name="cvs.package" value="xml-security" />
<property name="cvs.user.developer" value="geuerp" />
<property name="cvs.user.anonymous" value="anonymous" />
<property name="cvs.cvsRoot.developer" value=":ext:${cvs.user.developer}@${cvs.server}:${cvs.path}" />
<property name="cvs.cvsRoot.anonymous" value=":pserver:${cvs.user.anonymous}@${cvs.server}:${cvs.path}" />
<property name="tools.dir" value="./tools"/>
<property name="doc.xml" value="${doc}/xml"/>
<property name="doc.html" value="${doc}/html"/>
<property name="doc.book" value="${doc.xml}/docs-book.xml"/>
<property name="doc.style" value="${doc.xml}/style-apachexml"/>
<property name="doc.style.jar" value="${tools.dir}/style-apachexml.jar"/>
<property name="doc.generator" value="org.apache.stylebook.StyleBook"/>
<property name="doc.generator.package" value="${tools.dir}/stylebook-1.0-b2.jar"/>
<property name="libs" value="libs" />
<!--
Date: Sat, 26 Jan 2002 16:22:07 +1100
From: David Hook <dgh@wumpus.com.au>
To: Christian Geuer-Pollmann <geuer-pollmann@nue.et-inf.uni-siegen.de>
Subject: Re: "New" HMAC and Signature algorithms ?
It's ready to go, you can find the beta's at:
basic signed jar - http://www.bouncycastle.org/bcprov-jdk13-112b.jar
signed jar with JCE as well- http://www.bouncycastle.org/jce-jdk13-112b.jar
source - http://www.bouncycastle.org/crypto.tar.gz
Regards,
David.
-->
<property name="jce.download.file" value="jce-jdk13-112.jar" />
<property name="jce.download" value="http://www.bouncycastle.org/download/${jce.download.file}" />
<property name="lib.jce" value="${libs}/bc-${jce.download.file}" />
<!-- http://download.sourceforge.net/junit/junit3.7.zip -->
<property name="lib.junit" value="${libs}/junit3.7.jar" />
<property name="lib.xerces.1" value="${libs}/xercesImpl.jar" />
<property name="lib.xerces.2" value="${libs}/xmlParserAPIs.jar" />
<property name="lib.xalan.1" value="${libs}/xalan.jar" />
<property name="lib.xalan.2" value="${libs}/xml-apis.jar" />
<property name="lib.log4j" value="${libs}/jakarta-log4j-1.2alpha5.jar" />
<path id="classpath.library">
<pathelement path="${build.dest}" />
<pathelement path="${lib.xerces.1}" />
<pathelement path="${lib.xerces.2}" />
<pathelement path="${lib.xalan.1}" />
<pathelement path="${lib.xalan.2}" />
<pathelement path="${lib.log4j}" />
<pathelement path="${lib.jce}" />
</path>
<path id="classpath.test">
<!-- classpath for test is librarypath plus log4j -->
<path refid="classpath.library" />
<pathelement path="${lib.junit}" />
</path>
</target>
<property name="doc" value="./doc" />
<property name="doc.html" value="${doc}/html" />
<property name="doc.pdf" value="${doc}/pdf" />
<property name="doc.html.api" value="${doc.html}/api" />
<property name="javadoc.packages"
value="
org.apache.xml.security.Init,
org.apache.xml.security.algorithms.*,
org.apache.xml.security.algorithms.encryption.*,
org.apache.xml.security.algorithms.encryption.helper.*,
org.apache.xml.security.algorithms.encryption.implementations.*,
org.apache.xml.security.algorithms.encryption.implementations.BC.*,
org.apache.xml.security.algorithms.encryption.params.*,
org.apache.xml.security.algorithms.implementations.*,
org.apache.xml.security.c14n.*,
org.apache.xml.security.c14n.helper.*,
org.apache.xml.security.c14n.implementations.*,
org.apache.xml.security.encryption.*,
org.apache.xml.security.encryption.type.*,
org.apache.xml.security.exceptions.*,
org.apache.xml.security.keys.*,
org.apache.xml.security.keys.content.*,
org.apache.xml.security.keys.content.keyvalues.*,
org.apache.xml.security.keys.content.x509.*,
org.apache.xml.security.keys.keyresolver.*,
org.apache.xml.security.keys.keyresolver.implementations.*,
org.apache.xml.security.keys.provider.*,
org.apache.xml.security.keys.storage.*,
org.apache.xml.security.keys.storage.implementations.*,
org.apache.xml.security.resource.*,
org.apache.xml.security.signature.*,
org.apache.xml.security.transforms.*,
org.apache.xml.security.transforms.implementations.*,
org.apache.xml.security.utils.*,
org.apache.xml.security.utils.resolver.*,
org.apache.xml.security.utils.resolver.implementations.*
" />
<target name="prepare" depends="init">
<tstamp />
<mkdir dir="${build.dir}" />
<!-- check whether JUnit is available -->
<available property="junit.present" classname="junit.framework.TestCase">
<classpath refid="classpath.test" />
</available>
<available property="bcprov.present"
classname="org.bouncycastle.asn1.DERInputStream">
<classpath refid="classpath.library" />
</available>
</target>
<target name="prepare-src" depends="prepare">
<!-- create directories -->
<mkdir dir="${build.src}"/>
<mkdir dir="${build.dest}"/>
<!-- copy src files -->
<copy todir="${build.src}">
<fileset
dir="${src}"
includes="org/**" />
</copy>
<!-- substitute tokens as needed -->
<replace file="${build.src}/org/apache/xml/security/utils/Version.java"
token="@@VERSION@@" value="${product.Name} ${product.Version}"/>
</target>
<target name="get-jce"
depends="prepare"
unless="bcprov.present">
<get src="${jce.download}"
dest="${lib.jce}"
verbose="true"
usetimestamp="true"/>
</target>
<target name="compile.library" depends="prepare-src, get-jce">
<!-- Compile the java code from ${src} into ${build} -->
<javac srcdir="${build.src}" destdir="${build.dest}">
<classpath refid="classpath.library" />
</javac>
<!-- Copy Property files -->
<copy todir="${build.dest}" >
<fileset dir="${src}" includes="**/*.properties"/>
<fileset dir="${src}" includes="**/*.xml"/>
<fileset dir="${src}" includes="**/*.zip"/>
</copy>
</target>
<target name="compile.tests"
depends="compile.library"
if="junit.present">
<!-- Compile the java code from ${src} into ${build.dest} -->
<javac srcdir="${src.unitTests}" destdir="${build.dest}">
<classpath refid="classpath.test" />
</javac>
<!-- Copy Property files -->
<copy todir="${build.dest}" >
<fileset dir="${src.unitTests}" includes="**/*.properties"/>
<fileset dir="${src.unitTests}" includes="**/*.xml"/>
<fileset dir="${src.unitTests}" includes="**/*.zip"/>
</copy>
</target>
<target name="compile.samples"
depends="compile.library">
<!-- Compile the java code from ${src} into ${build.dest} -->
<javac srcdir="${src.samples}"
destdir="${build.dest}">
<classpath refid="classpath.library" />
</javac>
<!-- Copy Property files -->
<copy todir="${build.dest}" >
<fileset dir="${src.samples}" includes="**/*.properties"/>
<fileset dir="${src.samples}" includes="**/*.xml"/>
<fileset dir="${src.samples}" includes="**/*.zip"/>
</copy>
</target>
<target name="compile.JCE.BC"
depends="prepare"
if="bcprov.present">
<javac srcdir="${src.JCE.BC}"
destdir="${build.dest}">
<classpath refid="classpath.library" />
</javac>
</target>
<target name="compile"
depends="compile.library, compile.samples, compile.tests"
description="compile everything" />
<target name="test"
depends="init, compile.tests"
if="junit.present"
description="Starts all JUnit test cases">
<java classname="junit.textui.TestRunner"
fork="yes"
taskname="junit"
failonerror="true">
<arg value="org.apache.xml.security.test.AllTests"/>
<classpath refid="classpath.test" />
</java>
</target>
<target name="clean"
description="Clean up all temporary build files">
<delete dir="${build.dest}" />
<delete file="${build.jar}" />
<delete dir="bak" />
<delete dir="{$doc.html.api}" />
<delete file="log.txt" />
</target>
<target name="javadocs"
depends="compile"
description="generates javadoc from all .java files">
<mkdir dir="${build.docs}"/>
<mkdir dir="${build.javadocs}"/>
<javadoc sourcepath="${src}"
destdir="${build.javadocs}"
packagenames="${javadoc.packages}"
classpathref="classpath.test"/>
</target>
<!--
<property name="jar.library" value="{product.shortname}.jar" />
<property name="jar.samples" value="{product.shortname}Samples.jar" />
<property name="jar.tests" value="{product.shortname}Tests.jar" />
-->
<target name="jar"
depends="compile"
description="Creates the ${build.jar} JAR file">
<jar jarfile="${build.dir}/${jar.library}"
basedir="${build.dest}"
includes="org/apache/**,META-INF/**"
excludes="org/apache/xml/security/temp/**, org/apache/xml/security/samples/**, org/apache/xml/security/test/**" />
<jar jarfile="${build.dir}/${jar.samples}"
basedir="${build.dest}"
includes="org/apache/xml/security/samples/**,META-INF/**" />
<jar jarfile="${build.dir}/${jar.tests}"
basedir="${build.dest}"
includes="org/apache/xml/security/test/**,META-INF/**" />
<!-- compress="false" -->
</target>
<target name="gump"
description="Target for the gump run"
depends="clean,javadocs,jar,test" />
<target name="generate-keys">
<genkey alias="test2"
keyalg="DSA"
keypass="xmlsecurity"
storepass="xmlsecurity"
keystore="data/keystoreAnt.jks"
validity="2000" >
<dname>
<param name="CN" value="Christian Geuer-Pollmann"/>
<param name="OU" value="FB12NUE"/>
<param name="O" value="University of Siegen"/>
<param name="C" value="DE"/>
</dname>
</genkey>
</target>
<target name="sign"
description="creates a signature"
depends="compile">
<delete file="signature.xml" />
<java classname="org.apache.xml.security.samples.signature.CreateSignature"
fork="yes"
taskname="CreateSignature"
failonerror="true">
<classpath refid="classpath.test" />
</java>
</target>
<target name="verify"
description="verifies a signature"
depends="compile">
<java classname="org.apache.xml.security.samples.signature.VerifySignature"
fork="yes"
taskname="VerifySignature"
failonerror="true">
<classpath refid="classpath.test" />
</java>
</target>
<target name="signAndVerify"
description="creates and verifies a signature"
depends="sign, verify" />
<target name="docs">
<mkdir dir="${doc.html}"/>
<unjar src="${doc.style.jar}" dest="${doc.style}"/>
<java fork="yes"
classname="${doc.generator}">
<arg value="targetDirectory=${doc.html}"/>
<arg value="${doc.book}"/>
<arg value="${doc.style}"/>
<classpath>
<pathelement path="${doc.generator.package}" />
<pathelement path="${tools.dir}/xerces.jar" />
<pathelement path="${tools.dir}/xalan.jar" />
</classpath>
</java>
<delete dir="${doc.style}"/>
</target>
<target name="mega-sample" depends="compile.samples">
<echo message="Now I'll try to verify merlins example fifteen-HMAC"/>
<java classname="org.apache.xml.security.samples.signature.VerifyMerlinsExamplesFifteen"
fork="yes">
<classpath refid="classpath.library" />
</java>
<echo message=""/>
<echo message=""/>
<echo message=""/>
<echo message=""/>
<echo message=""/>
<echo message="Now I'll try to verify merlins example sixteen"/>
<java classname="org.apache.xml.security.samples.signature.VerifyMerlinsExamplesSixteen"
fork="yes">
<classpath refid="classpath.library" />
</java>
<echo message=""/>
<echo message=""/>
<echo message=""/>
<echo message=""/>
<echo message=""/>
<echo message="Now I'll create a signature in signature.xml and verify it"/>
<java classname="org.apache.xml.security.samples.signature.CreateSignature"
fork="yes">
<classpath refid="classpath.library" />
</java>
<java classname="org.apache.xml.security.samples.signature.VerifySignature"
fork="yes">
<classpath refid="classpath.library" />
</java>
<echo message=""/>
<echo message=""/>
<echo message=""/>
<echo message=""/>
<echo message=""/>
<echo message="Now I'll create a signature like merlin-16 but without XSLT"/>
<java classname="org.apache.xml.security.samples.signature.CreateMerlinsExampleSixteen"
fork="yes">
<classpath refid="classpath.library" />
</java>
<echo message=""/>
<echo message=""/>
<echo message="Please look into log.txt, merlinsSixteenRecreated.xml and signature.xml"/>
</target>
<property name="lib.doclet.mif" value="${tools.dir}/mifdoclet.jar" />
<path id="classpath.doclet.mif">
<path refid="classpath.library" />
<pathelement path="${lib.doclet.mif}"/>
</path>
<target name="javadoc-pdf"
description="Generates javadoc in Adobe MakerInterchangeFormat (.mif) from all .java files">
<mkdir dir="${doc.pdf}"/>
<javadoc sourcepath="${src}"
destdir="${doc.pdf}"
packagenames="${javadoc.packages}"
doclet="com.sun.tools.doclets.mif.MIFDoclet"
docletpath="${lib.doclet.mif}"
additionalparam="-book data/websigMiflet.xml -batch dzbatcher -print pdf"
classpathref="classpath.doclet.mif" />
</target>
<target name="createEnvelopingSignature" depends="compile.samples">
<java classname="org.apache.xml.security.samples.signature.CreateEnvelopingSignature"
fork="yes">
<classpath refid="classpath.library" />
</java>
</target>
<!-- =================================================================== -->
<!-- Creates the source distribution -->
<!-- =================================================================== -->
<target name="srcdist" depends="init" >
<mkdir dir="${build.dir}"/>
<mkdir dir="${build.srcdist}"/>
<mkdir dir="${build.srcdist}/libs"/>
<copy todir="${build.srcdist}">
<fileset dir=".">
<include name="build.xml"/>
<include name="README"/>
<include name="INSTALL"/>
<include name="LICENSE.txt"/>
<include name="TODO"/>
<include name="keys.asc"/>
<include name="data/**"/>
<exclude name="data/de/uni-siegen/**"/>
<exclude name="data/com/ibm/xss4j-20011029/**"/>
<include name="${src}/**" />
<include name="${src.samples}/**" />
<include name="${src.unitTests}/**" />
<include name="doc/xml/**" />
<exclude name="**/CVS/**"/>
</fileset>
</copy>
<zip zipfile="${product.name}-src-${product_version}.zip"
basedir="${build.srcdist}"
/>
</target>
<!-- =================================================================== -->
<!-- Creates the binary distribution -->
<!-- =================================================================== -->
<target name="bindist" depends="javadocs, docs, compile" >
<mkdir dir="${build.bindist}"/>
<mkdir dir="${build.bindist}/${libs}"/>
<copy todir="${build.bindist}">
<fileset dir=".">
<include name="build.xml"/>
<include name="README"/>
<include name="INSTALL"/>
<include name="LICENSE.txt"/>
<include name="TODO"/>
<include name="keys.asc"/>
<include name="data/**"/>
<exclude name="data/de/uni-siegen/**"/>
<exclude name="data/com/ibm/xss4j-20011029/**"/>
<include name="${lib.junit}" />
<include name="${lib.xerces.1}" />
<include name="${lib.xerces.2}" />
<include name="${lib.xalan.1}" />
<include name="${lib.xalan.2}" />
<include name="${lib.log4j}" />
<include name="${src.samples}/**" />
<exclude name="**/CVS/**"/>
</fileset>
</copy>
<jar jarfile="${build.bindist}/${libs}/${jar.library}"
basedir="${build.dest}"
includes="org/apache/**,META-INF/**"
excludes="org/apache/xml/security/temp/**, org/apache/xml/security/samples/**, org/apache/xml/security/test/**" />
<jar jarfile="${build.bindist}/${libs}/${jar.samples}"
basedir="${build.dest}"
includes="org/apache/xml/security/samples/**,META-INF/**" />
<jar jarfile="${build.bindist}/${libs}/${jar.tests}"
basedir="${build.dest}"
includes="org/apache/xml/security/test/**,META-INF/**" />
<copy todir="${build.bindist}/doc/api">
<fileset dir="${build.javadocs}"/>
</copy>
<copy todir="${build.bindist}/doc">
<fileset dir="${doc.html}"/>
</copy>
<zip zipfile="${product.name}-bin-${product_version}.zip"
basedir="${build.bindist}"
/>
</target>
<target name="dist" depends="srcdist, bindist" />
</project>