blob: 95757bba45dc7da85b449f78b03bb3ac6339708d [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://xml.apache.org/security/
-->
<project name="The org.apache.xml.security Package" default="usage" basedir=".">
<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.major' value='1'/>
<property name='product.version.minor' value='0'/>
<property name='product.version.level' value='5D2'/>
<property name='product.Version' value='${product.version.major}.${product.version.minor}.${product.version.level}'/>
<property name='product.version' value='${product.version.major}.${product.version.minor}.${product.version.level}'/>
<property name='product_version' value='${product.version.major}_${product.version.minor}_${product.version.level}'/>
<property name="year" value="2000-2002" />
<property name="copyright" value="Copyright &#169; ${year} Apache XML Project. All Rights Reserved." />
<!--<property name="build.compiler" value="classic" />
<property name="build.compiler" value="jikes" />-->
<property name="dir.data" value="./data" />
<property name="dir.doc" value="./doc" />
<property name="dir.libs" value="./libs" />
<property name="dir.src" value="./src" />
<property name="dir.src.unitTests" value="./src_unitTests" />
<property name="dir.src.samples" value="./src_samples" />
<property name="build.dir" value="./build" />
<property name="build.data" value="${build.dir}/data" />
<property name="build.src" value="${build.dir}/src" />
<property name="build.tests" value="${build.dir}/tests" />
<property name="build.samples" value="${build.dir}/samples" />
<property name="build.classes" value="${build.dir}/classes" />
<property name="build.srcdist" value="${build.dir}/${product.name}_${product_version}_src" />
<property name="build.bindist" value="${build.dir}/${product.name}_${product_version}_bin" />
<property name="build.manifest.dir" value="${build.classes}/META-INF"/>
<property name="jar.manifest" value="${build.manifest.dir}/MANIFEST.MF"/>
<property name="jar.library" value="${product.shortname}.jar" />
<property name="jar.tests" value="${product.shortname}Tests.jar" />
<property name="jar.samples" value="${product.shortname}Samples.jar" />
<property name="build.doc" value="${build.dir}/doc" />
<property name="build.doc.xml" value="${build.doc}/xml" />
<property name="build.doc.html" value="${build.doc}/html" />
<property name="build.javadoc" value="${build.doc.html}/api" />
<property name="build.junit.xml" value="${build.doc.xml}/junit" />
<property name="build.junit.html" value="${build.doc.html}/junit" />
<property name="cvs.cvsRoot.anonymous" value=":pserver:${cvs.user.anonymous}@${cvs.server}:${cvs.path}public" />
<property name="cvs.cvsRoot.developer" value=":ext:${cvs.user.developer}@${cvs.server}:${cvs.path}" />
<property name="cvs.package" value="xml-security" />
<property name="cvs.path" value="/home/cvs" />
<property name="cvs.server" value="cvs.apache.org" />
<property name="cvs.user.anonymous" value="anoncvs" />
<property name="cvs.user.developer" value="geuerp" />
<property name="doc.xml" value="${dir.doc}/xml" />
<property name="doc.book" value="${build.doc.xml}/sources/docs-book.xml" />
<!-- To validate that the MD5 and SHA1 checksums are in sync, please see
http://www.bouncycastle.org/checksums.html -->
<property name="jce.download.file" value="jce-jdk13-114.jar" />
<property name="jce.download.md5" value="8a90f10826c0b8a4460231dcef0e0e45" />
<property name="jce.download.sha1" value="f3cf2677ad8fa7a038ab3a62e05afef9615ea579" />
<!--
The most recent one is this here
<property name="jce.download.file" value="jce-jdk13-115.jar" />
<property name="jce.download.md5" value="38c40aa5c386e3ba5fac70916bcc5b0d" />
<property name="jce.download.sha1" value="15f5af7fc73e4ff5c059f83f47509b9720e129e7" />
-->
<property name="jce.download" value="http://www.bouncycastle.org/download/${jce.download.file}" />
<property name="lib.jce" value="${dir.libs}/bc-${jce.download.file}" />
<property name="lib.junit" value="${dir.libs}/junit3.7.jar" />
<property name="lib.log4j" value="${dir.libs}/jakarta-log4j-1.2.6.jar" />
<property name="lib.styleApache" value="${dir.libs}/style-apachexml.jar" />
<property name="lib.stylebook" value="${dir.libs}/stylebook-1.0-b3_xalan-2.jar" />
<property name="lib.xalan.1" value="${dir.libs}/xalan.jar" />
<property name="lib.xalan.2" value="${dir.libs}/xml-apis.jar" />
<property name="lib.xerces.1" value="${dir.libs}/xercesImpl.jar" />
<property name="lib.xerces.2" value="${dir.libs}/xmlParserAPIs.jar" />
<path id="classpath.libraries" description="3rd party libs">
<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.xmlsec" description="xmlsec classes; first try pure class files, then jars">
<pathelement path="${build.classes}" />
<pathelement path="${build.dir}/${jar.library}" />
<pathelement path="${build.dir}/${jar.tests}" />
<pathelement path="${build.dir}/${jar.samples}" />
</path>
<path id="classpath.library">
<path refid="classpath.xmlsec" />
<path refid="classpath.libraries" />
</path>
<path id="classpath.test">
<!-- classpath for test is librarypath plus junit -->
<path refid="classpath.library" />
<pathelement path="${lib.junit}" />
</path>
<path id="classpath.test.jar">
<!-- classpath for test is librarypath plus junit -->
<path refid="classpath.library" />
<pathelement path="${build.dir}/${jar.library}" />
<pathelement path="${build.dir}/${jar.tests}" />
</path>
<patternset id="distFiles">
<include name="build.xml" />
<include name="INSTALL" />
<include name="keys.asc" />
<include name="LICENSE.txt" />
<include name="README" />
<include name="Readme.html" />
<include name="TODO" />
</patternset>
<patternset id="dataFiles">
<include name="data/**" />
<exclude name="data/de/uni-siegen/**" />
<exclude name="data/com/ibm/xss4j-20011029/**/*" />
</patternset>
<patternset id="srcFiles">
<!-- for some strange reasons, I can't use ${src} but must use src -->
<include name="src/**/*" />
<include name="src/org/apache/xml/security/**/*.java" />
<include name="src/org/apache/xml/security/**/*.xml" />
<include name="src/org/apache/xml/security/**/*.html" />
<include name="src/org/apache/xml/security/resource/**/*" />
</patternset>
<patternset id="srcSamplesFiles">
<include name="src_samples/org/apache/xml/security/samples/**/*" />
<include name="src_samples/org/apache/xml/security/samples/**/*.html" />
</patternset>
<patternset id="srcUnitTestsFiles">
<include name="src_unitTests/org/apache/xml/security/test/**/*" />
<include name="src_unitTests/org/apache/xml/security/test/**/*.html" />
</patternset>
<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.params,
org.apache.xml.security.c14n,
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.storage,
org.apache.xml.security.signature,
org.apache.xml.security.transforms,
org.apache.xml.security.transforms.params,
org.apache.xml.security.utils,
org.apache.xml.security.utils.resolver
" />
<echo message="-------------------------------------------------------------------" />
<echo message="--------- ${product.Name} v${product.Version} [${year}] ----------------" />
<echo message="-------------------------------------------------------------------" />
</target>
<target name="usage" depends="init">
<echo message=" " />
<echo message=" " />
<echo message=" 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=" " />
<echo message=" doc --> generates the HTML documentation " />
<echo message=" use Readme.html to come to the docu " />
<echo message=" javadoc --> generates the API documentation " />
<echo message=" (needs Java > 1.2) " />
<echo message=" " />
<echo message=" test --> runs the defined JUnit tests " />
<echo message=" testjar --> runs the defined JUnit tests but runs on " />
<echo message=" compiled jar files instead of the class " />
<echo message=" files; this should be used if you have the " />
<echo message=" binary-only distribution " />
<echo message=" " />
<echo message=" clean --> cleans up all generated files and " />
<echo message=" directories " />
<echo message=" jar --> creates the JAR file " />
<echo message=" gump --> includes javadoc, compile jar and test " />
<echo message=" examples --> List the commands to run some examples " />
<echo message=" " />
<echo message=" usage --> provides help on using the build tool " />
<echo message=" (default) " />
<echo message=" " />
<echo message=" See comments inside the build.xml file for more details. " />
<echo message="-------------------------------------------------------------------" />
<echo message=" " />
</target>
<target name="clean" depends="init, clean-testdata"
description="Clean up all temporary build files">
<delete dir="${build.dir}" />
<delete dir="./bak" />
<delete file="log.txt" />
</target>
<target name="clean-testdata" depends="init"
description="Clean up all temporary test vectors">
<delete file="log.txt" />
<delete>
<fileset dir="${dir.data}/interop/c14n" includes="**/c14n-*.apache.txt" />
<fileset dir="${dir.data}/interop/c14n" includes="**/c14n-*.apache.html" />
</delete>
</target>
<target name="prepare" depends="init"
description="This target generates a first build directory and checks for some libraries">
<tstamp />
<mkdir dir="${build.dir}" />
<available property="junit.present" classname="junit.framework.TestCase">
<!-- check whether JUnit is available -->
<classpath refid="classpath.test" />
</available>
<available property="bcprov.present"
classname="org.bouncycastle.jce.provider.BouncyCastleProvider">
<!-- check whether BouncyCastle JCE is available -->
<classpath refid="classpath.library" />
</available>
<available property="xmlsec.jar.present"
file="${jar.library}" />
<available property="xmlsec.build.present"
classname="org.apache.xml.security.Init">
<classpath refid="classpath.library" />
</available>
</target>
<!-- #################################################################### -->
<!-- #################################################################### -->
<!-- #################################################################### -->
<!-- #################################################################### -->
<!-- #################################################################### -->
<target name="prepare-src" depends="prepare" description="This target copies the Java sources and brands the version information">
<!-- create directories -->
<mkdir dir="${build.src}" />
<mkdir dir="${build.classes}" />
<copy file="./LICENSE.txt"
tofile="${build.classes}/Apache-${product.shortname}-${product_version}-LICENSE.txt" />
<!-- copy src files -->
<copy todir="${build.src}">
<fileset
dir="${dir.src}"
includes="org/**,ant/**" />
</copy>
<mkdir dir="${build.manifest.dir}" />
<!-- <copy file="./src/MANIFEST.MF"
tofile="${build.classes}/META-INF/MANIFEST.MF" />
<replace file="${build.classes}/META-INF/MANIFEST.MF"
token="@@VERSION@@" value="${product.version}" /> -->
<!-- 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="javadoc"
depends="prepare-src"
description="Generates javadoc from all .java files; this is done on the 'branded' files">
<mkdir dir="${build.doc}" />
<mkdir dir="${build.doc.html}" />
<mkdir dir="${build.javadoc}" />
<javadoc destdir="${build.javadoc}"
packagenames="${javadoc.packages}"
classpathref="classpath.test">
<!-- additionalparam="-breakiterator"-->
<sourcepath>
<pathelement location="${build.src}" />
<pathelement location="${dir.src.unitTests}" />
<pathelement location="${dir.src.samples}" />
</sourcepath>
</javadoc>
</target>
<target name="doc" depends="prepare">
<!-- create directories -->
<mkdir dir="${build.doc}" />
<mkdir dir="${build.doc.xml}" />
<mkdir dir="${build.doc.html}" />
<!-- copy xml files -->
<copy todir="${build.doc.xml}">
<fileset dir="${doc.xml}" />
</copy>
<!-- unjar the stylebook software -->
<unjar src="${lib.styleApache}" dest="${build.doc.xml}" />
<!-- substitute tokens as needed -->
<replace file="${build.doc.xml}/dtd/entities.ent"
token="@@packagenamelong@@" value="${product.Name}" />
<replace file="${build.doc.xml}/dtd/entities.ent"
token="@@packagename@@" value="${product.name}" />
<replace file="${build.doc.xml}/dtd/entities.ent"
token="@@packageversion@@" value="${product.Version}" />
<replace file="${build.doc.xml}/dtd/entities.ent"
token="@@packagedistname@@" value="${product.Name}" />
<replace file="${build.doc.xml}/sources/install.xml"
token="@@jce.download@@" value="${jce.download}" />
<replace file="${build.doc.xml}/sources/install.xml"
token="@@lib.jce@@" value="${lib.jce}" />
<replace file="${build.doc.xml}/sources/install.xml"
token="@@jce.download.file@@" value="${jce.download.file}" />
<!-- create the site -->
<stylebook book="${doc.book}" skindirectory="${build.doc.xml}" targetdirectory="${build.doc.html}">
<classpath>
<pathelement path="${lib.stylebook}" />
<pathelement path="${lib.xerces.1}" />
<pathelement path="${lib.xalan.1}" />
</classpath>
</stylebook>
<!-- copy plain ASCII files -->
<copy todir="${build.doc.html}">
<fileset
dir="${doc.xml}/sources"
includes="**/*.txt" />
</copy>
<!-- remove the patched XML sources -->
<delete dir="${build.doc.xml}" />
</target>
<target name="javadoc-pdf"
description="Generates javadoc in Adobe (c) MakerInterchangeFormat (.mif) from all .java files; for Adobe FrameMaker">
<property name="lib.doclet.mif" value="${dir.tools}/mifdoclet.jar" />
<path id="classpath.doclet.mif">
<path refid="classpath.library" />
<pathelement path="${lib.doclet.mif}" />
</path>
<mkdir dir="${doc.pdf}" />
<javadoc sourcepath="${dir.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>
<!-- #################################################################### -->
<!-- #################################################################### -->
<!-- #################################################################### -->
<!-- #################################################################### -->
<!-- #################################################################### -->
<!-- Aliases -->
<target name="javadocs" depends="javadoc" />
<target name="docs" depends="doc" />
<target name="jars" depends="jar" />
<target name="distbin" depends="bindist" />
<target name="distsrc" depends="srcdist" />
<!-- Collections -->
<target name="dist" depends="srcdist,bindist" />
<target name="gump" depends="clean,javadoc,jar,test" description="Target for the gump run" />
<target name="compile" depends="compile.library, compile.samples, compile.tests" description="compile everything" />
<!-- #################################################################### -->
<!-- #################################################################### -->
<!-- #################################################################### -->
<!-- #################################################################### -->
<!-- #################################################################### -->
<target name="update"
depends="init"
description="Updates the current source tree from CVS">
<cvspass cvsroot="${cvs.cvsRoot.anonymous}"
password="anoncvs"/>
<cvs cvsRoot="${cvs.cvsRoot.anonymous}"
package="${cvs.package}"
dest=".."
command="checkout"/>
</target>
<target name="get-jce"
depends="prepare"
unless="bcprov.present">
<get src="${jce.download}"
dest="${lib.jce}"
verbose="true"
usetimestamp="true" />
</target>
<taskdef name="md5" classname="ant.Md5Task"/>
<target name="check-bc" depends="get-jce" description="This target checks that the digest values of the JCE library are valid">
<md5 Md5="${jce.download.md5}" Sha1="${jce.download.sha1}" file="${lib.jce}" />
<!-- when ant 1.5 becomes widely available, maybe the core task "checksum" can make this easier -->
<!--
<checksum file="${lib.jce}" property="${jce.download.md5}" algorithm="md5" verifyProperty="md5OK" />
<checksum file="${lib.jce}" property="${jce.download.sha1}" algorithm="sha" verifyProperty="sha1OK" />
-->
</target>
<target name="compile.library" depends="prepare-src, check-bc">
<!-- Compile the branded java code from ${build.src} into ${build.classes} -->
<javac srcdir="${build.src}" destdir="${build.classes}">
<classpath refid="classpath.library" />
</javac>
<!-- Copy Property files -->
<copy todir="${build.classes}" >
<fileset dir="${build.src}" includes="**/*.properties" />
<fileset dir="${build.src}" includes="**/*.xml" />
<fileset dir="${build.src}" includes="**/*.zip" />
</copy>
</target>
<target name="compile.tests"
depends="compile.library"
if="junit.present">
<!-- Compile the java code from ${dir.src} into ${build.classes} -->
<javac srcdir="${dir.src.unitTests}" destdir="${build.classes}">
<classpath refid="classpath.test" />
</javac>
<!-- Copy Property files -->
<copy todir="${build.classes}" >
<fileset dir="${dir.src.unitTests}" includes="**/*.properties" />
<fileset dir="${dir.src.unitTests}" includes="**/*.xml" />
<fileset dir="${dir.src.unitTests}" includes="**/*.zip" />
</copy>
</target>
<target name="compile.samples"
depends="compile.library">
<!-- Compile the java code from ${dir.src} into ${build.classes} -->
<javac srcdir="${dir.src.samples}"
destdir="${build.classes}">
<classpath refid="classpath.library" />
</javac>
</target>
<target name="test"
depends="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> -->
<java classname="org.apache.xml.security.test.AllTests"
fork="yes"
taskname="junit"
failonerror="true">
<classpath refid="classpath.test" />
</java>
</target>
<target name="test_junit"
depends="compile.tests"
if="junit.present"
description="Starts all Junit tests with optional Ant">
<delete dir="${build.junit.xml}" />
<delete dir="${build.junit.html}" />
<mkdir dir="${build.junit.xml}" />
<mkdir dir="${build.junit.html}" />
<!-- The unit tests include so-called interoperability tests against
cryptographic values generated using software from other vendors.
This package includes many of these vectors, but not the ones from
the IBM alphaWorks XML Security Suite. They are not included because
IBM even has these signatures under copyright.
If you want to test against IBM, download xss4j from
http://www.alphaworks.ibm.com/tech/xmlsecuritysuite
and put the files into the
data/com/ibm/xss4j-20011029/
directory. If the file enveloped-rsa.sig is found in that directory,
IBM is 'magically' included in the test ;-))
-->
<available property="ibm.available" file="data/com/ibm/xss4j-20011029/enveloped-rsa.sig"/>
<junit printsummary="on"
fork="true"
filtertrace="true">
<jvmarg value="-Djava.compiler=NONE"/>
<classpath refid="classpath.test" />
<formatter type="xml"/>
<batchtest fork="yes" todir="${build.junit.xml}">
<fileset dir="${dir.src.unitTests}">
<include name="**/*Test*.java" />
<include name="org/apache/xml/security/test/c14n/implementations/ExclusiveC14NInterop.java" />
<exclude name="org/apache/xml/security/test/*Test*.java" />
<exclude name="org/apache/xml/security/test/interop/InteropTest.java" />
<exclude name="**/TestVectorResolver.java" />
<exclude name="**/IBMTest.java"/>
</fileset>
</batchtest>
<test name="org.apache.xml.security.test.interop.IBMTest"
todir="${build.junit.xml}"
if="ibm.available"/>
</junit>
<junitreport todir="${build.junit.xml}">
<fileset dir="${build.junit.xml}">
<include name="TEST-*.xml"/>
</fileset>
<report format="frames" todir="${build.junit.html}"/>
</junitreport>
</target>
<target name="test_exc_c14n"
depends="compile.tests"
if="junit.present"
description="Runs exclusive c14n interop (Y1, Y2, Y3, Y4)">
<java classname="org.apache.xml.security.test.c14n.implementations.ExclusiveC14NInterop"
fork="yes"
taskname="junit"
failonerror="true">
<classpath refid="classpath.test" />
</java>
</target>
<target name="testjar"
depends="prepare,check-bc"
if="xmlsec.build.present"
description="Starts all JUnit test cases and uses the compiled JARs">
<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="jar"
depends="compile"
description="Creates the ${jar.library}, ${jar.samples} and ${jar.tests} JAR file in ${build.dir}">
<manifest file="${jar.manifest}" mode="replace">
<attribute name="Built-By" value="${user.name}"/>
<section name="${product.shortname}">
<attribute name="Implementation-Title" value="${product.Name}" />
<attribute name="Implementation-Version" value="${product.Version} ${TODAY}" />
<attribute name="Implementation-Vendor" value="Apache Software Foundation" />
</section>
</manifest>
<jar jarfile="${build.dir}/${jar.library}"
basedir="${build.classes}"
includes="org/apache/**, *.txt"
excludes="org/apache/xml/security/temp/**, org/apache/xml/security/samples/**, org/apache/xml/security/test/**"
manifest="${jar.manifest}"/>
<jar jarfile="${build.dir}/${jar.samples}"
basedir="${build.classes}"
includes="org/apache/xml/security/samples/**"
excludes="org/apache/xml/security/temp/**"
manifest="${jar.manifest}"/>
<jar jarfile="${build.dir}/${jar.tests}"
basedir="${build.classes}"
includes="org/apache/xml/security/test/**"
excludes="org/apache/xml/security/temp/**"
manifest="${jar.manifest}"/>
<!-- compress="false" -->
</target>
<target name="srcdist" depends="clean,prepare,test" description="Creates the source distribution">
<mkdir dir="${build.srcdist}" />
<copy todir="${build.srcdist}">
<fileset dir=".">
<patternset refid="distFiles" />
<patternset refid="srcFiles" />
<patternset refid="srcUnitTestsFiles" />
<patternset refid="srcSamplesFiles" />
<patternset refid="dataFiles" />
<include name="${doc.xml}/**/*" />
<include name="ant/**/*" />
<exclude name="**/CVS/**" />
</fileset>
</copy>
<mkdir dir="${build.srcdist}/libs"
description="create an empty libs so that people know where to put the 3rd party jars"/>
<zip zipfile="${build.dir}/${product.name}-src-${product_version}.zip"
basedir="${build.srcdist}" />
</target>
<target name="bindist" depends="clean,compile,test,jar,doc,javadoc" description="Creates the binary distribution">
<mkdir dir="${build.bindist}" />
<copy todir="${build.bindist}">
<fileset dir=".">
<patternset refid="distFiles" />
<patternset refid="dataFiles" />
<patternset refid="srcSamplesFiles" />
<include name="ant/**/*" />
<exclude name="**/CVS/**" />
</fileset>
</copy>
<mkdir dir="${build.bindist}/${dir.libs}" />
<copy todir="${build.bindist}/${dir.libs}" file="${lib.junit}" />
<copy todir="${build.bindist}/${dir.libs}" file="${lib.log4j}" />
<copy todir="${build.bindist}/${dir.libs}" file="${lib.styleApache}" />
<copy todir="${build.bindist}/${dir.libs}" file="${lib.stylebook}" />
<copy todir="${build.bindist}/${dir.libs}" file="${lib.xerces.1}" />
<copy todir="${build.bindist}/${dir.libs}" file="${lib.xerces.2}" />
<copy todir="${build.bindist}/${dir.libs}" file="${lib.xalan.1}" />
<copy todir="${build.bindist}/${dir.libs}" file="${lib.xalan.2}" />
<mkdir dir="${build.bindist}/${build.dir}" />
<copy todir="${build.bindist}/${build.dir}" file="${build.dir}/${jar.library}" description="copy xmlsec JARs from ./build to ./build/${build.bindist}/build/" />
<copy todir="${build.bindist}/${build.dir}" file="${build.dir}/${jar.samples}" description="copy xmlsec JARs from ./build to ./build/${build.bindist}/build/" />
<copy todir="${build.bindist}/${build.dir}" file="${build.dir}/${jar.tests}" description="copy xmlsec JARs from ./build to ./build/${build.bindist}/build/" />
<mkdir dir="${build.bindist}/${build.doc}" />
<mkdir dir="${build.bindist}/${build.doc.html}" />
<copy todir="${build.bindist}/${build.doc.html}">
<fileset dir="${build.doc.html}" />
</copy>
<zip zipfile="${build.dir}/${product.name}-bin-${product_version}.zip"
basedir="${build.bindist}" />
</target>
<!-- #################################################################### -->
<!-- #################################################################### -->
<!-- #################################################################### -->
<!-- #################################################################### -->
<!-- #################################################################### -->
<target name="examples">
<echo message=" " />
<echo message=" Running examples instructions " />
<echo message="-------------------------------------------------------------------" />
<echo message=" " />
<echo message=" available targets are: " />
<echo message=" " />
<echo message=" generate-keys --> generates new keys to be used by other " />
<echo message=" examples " />
<echo message=" sign --> runs ..samples.signature.CreateSignature " />
<echo message=" creates a signature.xml file " />
<echo message=" verify --> will verify a signature.xml file that's " />
<echo message=" in the root directory. Main use after sign " />
<echo message=" signAndVerify --> runs sign and then verify " />
<echo message=" mega-sample --> runs all big samples " />
<echo message=" " />
<echo message=" See target usage for building instructions " />
</target>
<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="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="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="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="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="Please look into log.txt, merlinsSixteenRecreated.xml and signature.xml" />
</target>
<target name="createEnvelopingSignature" depends="compile.samples">
<java classname="org.apache.xml.security.samples.signature.CreateEnvelopingSignature"
fork="yes">
<classpath refid="classpath.library" />
</java>
</target>
</project>