xml security : Big Project Ant Script « Ant « Java






xml security


<?xml version="1.0"?>
<project name="Apache XML Security" default="help" basedir=".">
    <!-- P R O P E R T Y    F I L E S -->
    <property file="build.properties" />
    <property file="provider.properties" />
    <property file="proxy.properties" />




    <!-- G L O B A L    P R O P E R T I E S -->
  <!-- Product name and version properties -->
    <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="4"/>
    <property name="product.version.level" value="3"/>
    <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-2009"/>
    <property name="copyright" 
        value="Copyright  ${year} Apache XML Project. All Rights Reserved."/>


    <!-- directory properties -->
    <property name="dir.src"            value="${basedir}/src" />
    <property name="dir.src.test"       value="${basedir}/src_unitTests" />
    <property name="dir.src.samples"    value="${basedir}/src_samples" />
    <property name="dir.libs"           value="${basedir}/libs" />
    <property name="dir.data"           value="${basedir}/data" />
    <property name="dir.docs"           value="${basedir}/doc/site" />
    <property name="dir.build"          value="${basedir}/build" />
    <property name="dir.build.bin"      value="${dir.build}/classes" />
    <property name="dir.build.libs"     value="${dir.build}/libs" />
    <property name="dir.build.libs2"    value="${dir.build}/libs/endorsed" />
    <property name="dir.build.test"     value="${dir.build}/test" />
    <property name="dir.build.samples"  value="${dir.build}/samples" />
    <property name="dir.build.docs"     value="${dir.build}/docs" />
    <property name="dir.build.docs.xml" value="${dir.build.docs}/xml" />
    <property name="dir.build.docs.html" value="${dir.build.docs}/html" />
    <property name="dir.build.src"      value="${dir.build}/src" />
    <property name="dir.build.dist"     value="${dir.build}/dist" />
    <property name="dir.build.srcdist"  value="${dir.build.dist}/src/${product.name}-${product_version}"/>
    <property name="dir.build.bindist"  value="${dir.build.dist}/bin/${product.name}-${product_version}"/>
    <property name="dir.build.junit.xml"  value="${dir.build.docs.xml}/junit" />
    <property name="dir.build.junit.html" value="${dir.build.docs.html}/junit" />
    <property name="dir.build.javadoc"  value="${dir.build.docs.html}/javadoc" />
    <property name="dir.build.coverage" value="${dir.build.docs.html}/coverage" />
    <property name="dir.manifest"       value="${dir.build.bin}/META-INF"/>

    <!-- library properties -->
    <property name="lib.logging"        value="${dir.libs}/commons-logging.jar" />
    <property name="lib.logging.api"    value="${dir.libs}/commons-logging-api.jar" />
    <property name="lib.log4j"          value="${dir.libs}/log4j-1.2.8.jar" />
    <property name="lib.xalan.1"        value="${dir.libs}/xalan.jar" />
    <property name="lib.xalan.2"        value="${dir.libs}/serializer.jar" />
    <property name="lib.xalan.3"        value="${dir.libs}/xml-apis.jar" />
    <property name="lib.xerces.1"       value="${dir.libs}/xercesImpl.jar" />
    <property name="lib.jce"            value="${dir.libs}/${jce.provider.prefix}-${jce.provider.jar}" />
    <property name="lib.junit"    value="${dir.libs}/junit-3.8.1.jar" />
    <property name="lib.clover"    value="${dir.libs}/clover.jar" />

    <!-- XML Security libraries (for bin distribution) -->
    <property name="lib.xmlsec"         value="${dir.libs}/xmlsec-${product.version}.jar" />
    <property name="lib.xmlsec.samples" value="${dir.libs}/xmlsecSamples-${product.version}.jar"/>
    <property name="lib.xmlsec.tests"   value="${dir.libs}/xmlsecTests-${product.version}.jar" />

    <!-- JAR properties -->
    <property name="jar.library"        value="${dir.build}/xmlsec-${product.version}.jar" />
    <property name="jar.samples"        value="${dir.build}/xmlsecSamples-${product.version}.jar" />
    <property name="jar.tests"          value="${dir.build}/xmlsecTests-${product.version}.jar" />
    <property name="jar.manifest"       value="${dir.manifest}/MANIFEST.MF"/>
    

    <!-- build variable properties -->


    <!-- T A S K D E F S -->
    <taskdef resource="clovertasks"/>
  
  

    <!-- C O N D I T I O N A L    P R O P E R T I E S -->
    <target name="do.build.src" >
        <!-- global properties applies here -->
    </target >




    <!-- P A T H S -->
    <path id="id.classpath.xalan" >
        <pathelement location="${lib.xalan.1}" />
        <pathelement location="${lib.xalan.2}" />
    </path >
    <path id="id.classpath.xerces" >
        <pathelement location="${lib.xerces.1}" />
    </path >
    <path id="id.classpath.logging" >
        <pathelement location="${lib.logging}" />
        <pathelement location="${lib.logging.api}" />
        <pathelement location="${lib.log4j}" />
    </path >
    <path id="id.classpath.common" >
        <path refid="id.classpath.xalan" />
        <path refid="id.classpath.xerces" />
        <path refid="id.classpath.logging" />
    </path >
    <path id="id.classpath.crypt" >
        <pathelement location="${lib.jce}" />
    </path >
    <path id="id.classpath.coverage" >
      <pathelement location="${lib.clover}" />
    </path >
    <path id="id.classpath.sig" >
    </path >
    <path id="id.classpath" >
        <path refid="id.classpath.common" />
        <path refid="id.classpath.crypt" />
        <path refid="id.classpath.sig" />
        <!--path refid="id.classpath.coverage" /-->
    </path >
    <path id="id.classpath.test" >
        <path refid="id.classpath" />
  <pathelement path="${lib.junit}"/>
        <pathelement location="${dir.build.bin}" />
        <pathelement location="${dir.build.test}" />
        <path refid="id.classpath.coverage" />
        <pathelement location="${lib.xmlsec}" />
        <pathelement location="${lib.xmlsec.samples}" />
        <pathelement location="${lib.xmlsec.tests}" />
    </path>
    <path id="id.classpath.samples" >
        <path refid="id.classpath" />
        <pathelement location="${dir.build.bin}" />
      <pathelement location="${dir.build.test}" />      
        <pathelement location="${dir.build.samples}" />
        <pathelement location="${lib.xmlsec}" />
        <pathelement location="${lib.xmlsec.samples}" />
        <pathelement location="${lib.xmlsec.tests}" />
    </path>


    <!-- P A T T E R N S E T S -->
    <patternset id="id.patternset.distFiles">
  <include name="build.xml"/>
  <include name="INSTALL"/>
  <include name="KEYS"/>
  <include name="LICENSE"/>
  <include name="NOTICE"/>
  <include name="Readme.html"/>
  <include name="TODO"/>
  <include name="provider.properties"/>
  <include name="proxy.properties"/>
    </patternset>

    <patternset id="id.patternset.dataFiles">
  <include name="data/**"/>
  <exclude name="data/de/uni-siegen/**"/>
  <exclude name="data/com/ibm/xss4j-20030127/**/*"/>
    </patternset>

    <patternset id="id.patternset.srcFiles">
  <include name="src/**/*"/>
    </patternset>
  
    <patternset id="id.patternset.srcSamplesFiles">
  <include name="src_samples/**/*"/>
    </patternset>
  
    <patternset id="id.patternset.srcUnitTestsFiles">
  <include name="src_unitTests/**/*"/>
    </patternset>

    <!-- T A R G E T S -->

    <!-- Welcome screen -->

    <target name="init">
  <echo message=""/>
  <echo message="-------------------------------------------------------------------"/>
  <echo message="--------- ${product.Name} v${product.version} [${year}] -----------"/>
  <echo message="-------------------------------------------------------------------"/>
  <echo message="Building with ${ant.version}"/>
  <echo message="Java ${java.version} located at ${java.home} "/>
  <echo message="-------------------------------------------------------------------"/>
  <echo message=""/>
    </target>

    <!-- environment targets -->
    <!-- set up -->
    <target name="env.mk.dirs" depends="init" unless="has.dirs" >
        <mkdir dir="${dir.build}" />
        <mkdir dir="${dir.build.bin}" />
        <mkdir dir="${dir.build.docs}" />
        <mkdir dir="${dir.build.test}" />
        <mkdir dir="${dir.build.libs}" />
        <mkdir dir="${dir.build.libs2}" />
        <mkdir dir="${dir.build.dist}" />
        <mkdir dir="${dir.build.samples}" />
        <property name="has.dirs" value="true" />
    </target >

    <!-- tear down -->
    <target depends="init" name="env.rm.dirs" >
        <delete dir="${dir.build}" />
    </target >
    
    <target depends="init" name="env.rm.files" >
  <delete file="signature.xml"/>
  <delete file="axisSignature.xml"/>
  <delete file="encryptedInfo.xml"/>
  <delete file="decryptedInfo.xml"/>
  <delete file="kek"/>
  <delete>
    <fileset dir="." includes="merlin16*.html,merlins*.xml" />
  </delete>
    </target >

    <target depends="init" name="with.clover" >
      <clover-setup initstring="clover-db/coverage.db" >
        <fileset dir="${dir.src}" >
        <include name="**/*.java" />
        <exclude name="**/*Exception.java" />
    </fileset >
       </clover-setup >
    </target >

    <!-- check targets -->

    <target name="do.check.forrest">
  <property environment="env"/>
  <condition property="has.forrest">
    <or>
      <available filepath="${env.PATH}" file="forrest" />
      <available filepath="${env.PATH}" file="forrest.bat" />
    </or>
  </condition>
    </target>

    <target name="do.check.bindist">
  <condition property="is.bin.dist">
      <and>
    <available file="${lib.xmlsec}" />
    <available file="${lib.xmlsec.samples}" />
    <available file="${lib.xmlsec.tests}" />
    <not>
        <available type="dir" file="src" />
    </not>
      </and>
  </condition>
    </target>


    <!-- B U I L D  T A R G E T S -->
    <!-- Forrest new -->
    <property environment="env"/>
    <property name="forrest.home" value="${env.FORREST_HOME}"/>
    <property name="project.home" value="${dir.docs}"/>  
    <!-- 'site' is a target imported from forrest.build.xml -->
    <import file="${env.FORREST_HOME}/forrest.build.xml" optional="true"/>
    <target name="raul-forrest"  if="env.FORREST_HOME">
  <antcall target="site"></antcall>
  <echo>something here</echo>
    </target>
    <!-- source -->
    <target name="build.src"
            depends="do.build.src,env.mk.dirs,do.check.bindist"
      unless="is.bin.dist">
        <javac target="1.4" source="1.4" srcdir="${dir.src}"
               destdir="${dir.build.bin}"
               debug="${build.compile.debug}">
            <classpath refid="id.classpath" />
            <include name="**/org/apache/xml/security/**/*.java" />
            <include name="**/javax/xml/crypto/**/*.java" />
            <include name="**/org/jcp/xml/dsig/internal/**/*.java" />
        </javac >

        <copy todir="${dir.build.bin}" >
            <fileset dir="${dir.src}"
                     includes="**/org/apache/xml/security/resource/*,
                               **/org/apache/xml/security/resource/schema/*"/>
        </copy >
    </target >
    
    <!-- tests -->
    <target name="build.test"
        depends="build.src"
    unless="is.bin.dist">
      <javac srcdir="${dir.src.test}"
               destdir="${dir.build.test}"
               debug="${build.compile.debug}">
          <classpath refid="id.classpath.test" />
          <include name="**/org/apache/xml/security/**/*.java" />
          <include name="**/javax/xml/crypto/**/*.java" />
        </javac>
        <copy todir="${dir.build.test}">
          <fileset dir="${dir.src.test}" includes="**/*.properties"/>
          <fileset dir="${dir.src.test}" includes="**/*.xml"/>
          <fileset dir="${dir.src.test}" includes="**/*.zip"/>
      </copy>
    </target>

    <!-- samples -->
    <target name="build.samples"
    depends="build.src"
    unless="is.bin.dist">
  <javac srcdir="${dir.src.samples}"
    destdir="${dir.build.samples}"
    debug="${build.compile.debug}">
    <classpath refid="id.classpath.samples"/>
  </javac>
    </target>



  <!-- T E S T  T A R G E T S -->  
  <!-- big test -->
  <target name="test" depends="build.test"
    description="Starts all Junit tests">
      <delete dir="${dir.build.junit.xml}"/>
      <delete dir="${dir.build.junit.html}"/>
      <mkdir dir="${dir.build.junit.xml}"/>
      <mkdir dir="${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-20030127/
  
           directory. If the file enveloped-rsa.sig is found in that directory,
           IBM is 'magically' included in the test ;-))
      -->
      <available file="data/com/ibm/xss4j-20030127/enveloped-rsa.sig" property="ibm.available"/>
            <copy file="${lib.xalan.1}" todir="${dir.build.libs2}"/>
            <copy file="${lib.xalan.2}" todir="${dir.build.libs2}"/>
            <copy file="${lib.xalan.3}" todir="${dir.build.libs2}"/>
            <copy file="${lib.xerces.1}" todir="${dir.build.libs2}"/>
      <junit filtertrace="true" fork="true" printsummary="on" 
       failureproperty="build.test.failed">
          <jvmarg value="-Djava.compiler=NONE"/>
          <sysproperty key="basedir" value="${basedir}"/>
                <sysproperty key="java.endorsed.dirs" value="${dir.build.libs2}"/>
                <sysproperty key="proxyHost" value="${proxy.host}"/>
                <sysproperty key="proxyPort" value="${proxy.port}"/>
                <sysproperty key="java.util.logging.config.file" 
           value="${basedir}/logging.properties"/>
          <classpath refid="id.classpath.test"/>
          <formatter type="xml"/>
          <!-- Also put output to screen -->
          <formatter type="plain" usefile="false"/>
          <batchtest fork="yes" todir="${dir.build.junit.xml}">
              <fileset dir="${dir.src.test}">
                  <include name="org/apache/xml/security/test/AllTests.java"/>
               </fileset>
          </batchtest>
          <test if="ibm.available" name="org.apache.xml.security.test.interop.IBMTest" todir="${dir.build.junit.xml}"/>
      </junit>
      <junitreport todir="${dir.build.junit.xml}">
          <fileset dir="${dir.build.junit.xml}">
              <include name="TEST-*.xml"/>
          </fileset>
          <report format="frames" todir="${dir.build.junit.html}"/>
      </junitreport>
      <fail if="build.test.failed" message="Unit Tests Failed"/>
  </target>

    <!-- Test JSR 105/XML DSig API -->
    <target name="test_jsr105" depends="build.test"
      description="Runs JSR 105 interop and unit tests">
        <delete dir="${dir.build.junit.xml}"/>
        <delete dir="${dir.build.junit.html}"/>
        <mkdir dir="${dir.build.junit.xml}"/>
        <mkdir dir="${dir.build.junit.html}"/>
        <junit filtertrace="true" fork="true" printsummary="on" 
         failureproperty="build.test.failed">
            <sysproperty key="basedir" value="${basedir}"/>
            <sysproperty key="proxyHost" value="${proxy.host}"/>
      <sysproperty key="proxyPort" value="${proxy.port}"/>
      <sysproperty key="java.util.logging.config.file" value="${basedir}/logging.properties"/>
            <sysproperty key="java.endorsed.dirs" value="${dir.build.libs2}"/>
            <classpath refid="id.classpath.test"/>
      <formatter type="xml"/>
      <!-- Also put output to screen -->
      <formatter type="plain" usefile="false"/>
      <batchtest fork="yes" todir="${dir.build.junit.xml}">
          <fileset dir="${dir.src.test}">
              <include name="javax/xml/crypto/**/*Test.java"/>
                <exclude name="javax/xml/crypto/test/dsig/InteropC14nTest.java"/>
            </fileset>
            </batchtest>
        </junit>
        <junitreport todir="${dir.build.junit.xml}">
            <fileset dir="${dir.build.junit.xml}">
          <include name="TEST-*.xml"/>
            </fileset>
      <report format="frames" todir="${dir.build.junit.html}"/>
        </junitreport>
        <fail if="build.test.failed" message="Unit Tests Failed"/>
    </target>
    
    <!-- Run all the tests -->
    <target name="all-tests" depends="test,test_jsr105"
      description="Runs all the test targets">
    </target>
  
    <!-- XML Encryption Samples -->
    <target name="encrypt"
      depends="build.samples"
      description="encrypts xml data">
  <delete file="encryptedInfo.xml"/>
  <delete file="kek"/>
  <java classname="org.apache.xml.security.samples.encryption.Encrypter" 
      failonerror="true" 
      fork="yes" 
      taskname="Encrypter">
    <classpath refid="id.classpath.samples"/>
  </java>
    </target>

    <target name="decrypt"
      depends="build.samples" 
      description="decrypts xml data">
  <delete file="decryptedInfo.xml"/>
  <java classname="org.apache.xml.security.samples.encryption.Decrypter" 
      failonerror="true" 
      fork="yes" 
      taskname="Decrypter">
    <classpath refid="id.classpath.samples"/>
  </java>
    </target>

    <target name="encryptAndDecrypt"
      depends="encrypt, decrypt" 
      description="encrypts and decrypts an element's contents" />

    <!-- Signature Samples -->

    <target name="sign"
      depends="build.samples" 
      description="creates a signature" >
  <delete file="signature.xml"/>
  <java classname="org.apache.xml.security.samples.signature.CreateSignature" 
      failonerror="true" 
      fork="yes" 
      taskname="CreateSignature">
    <classpath refid="id.classpath.samples"/>
  </java>
    </target>

    <target name="verify" 
      depends="build.samples" 
      description="verifies a signature">
  <java classname="org.apache.xml.security.samples.signature.VerifySignature" 
      failonerror="true" 
      fork="yes" 
      taskname="VerifySignature">
    <classpath refid="id.classpath.samples"/>
  </java>
    </target>
  
    <target name="signAndVerify"
      depends="sign, verify" 
      description="creates and verifies a signature" />

    <!-- Axis Signature Samples -->

    <target name="axis-sign"
      depends="build.samples" 
      description="axis sign sample">
  <echo message="Running org.apache.xml.security.samples.AxisSigner"/>
  <java classname="org.apache.xml.security.samples.AxisSigner" 
      failonerror="true" fork="yes" taskname="SignAxis">
    <classpath refid="id.classpath.samples"/>
  </java>
    </target>

    <target name="axis-verify"
      depends="build.samples" 
      description="axis verify sample">
  <echo message="Running org.apache.xml.security.samples.AxisVerifier"/>
  <java classname="org.apache.xml.security.samples.AxisVerifier" 
      failonerror="true" 
      fork="yes" 
      taskname="VerifyAxis">
    <classpath refid="id.classpath.samples"/>
  </java>
    </target>

    <target depends="axis-sign, axis-verify" name="AxisSignAndVerify"/>

    <!-- Mega Samples -->
    <target name="mega-sample" 
      depends="build.samples">
  <echo message="Now I&apos;ll try to verify merlins example fifteen-HMAC"/>
  <java classname="org.apache.xml.security.samples.signature.VerifyMerlinsExamplesFifteen" 
      fork="yes">
    <classpath refid="id.classpath.samples"/>
  </java>

  <echo message=""/>
  <echo message="Now I&apos;ll try to verify merlins example sixteen"/>
  <java classname="org.apache.xml.security.samples.signature.VerifyMerlinsExamplesSixteen" 
      fork="yes">
                <sysproperty key="java.endorsed.dirs" value="${dir.build.libs2}"/>
    <classpath refid="id.classpath.samples"/>
  </java>

  <echo message=""/>
  <echo message="Now I&apos;ll try to verify merlins example twenty three"/>
  <java classname="org.apache.xml.security.samples.signature.VerifyMerlinsExamplesTwentyThree" 
      fork="yes">
                <sysproperty key="java.endorsed.dirs" value="${dir.build.libs2}"/>
    <classpath refid="id.classpath.samples"/>
  </java>

  <echo message=""/>
  <echo message="Now I&apos;ll create a signature in signature.xml and verify it"/>
  <java classname="org.apache.xml.security.samples.signature.CreateSignature" 
      fork="yes">
    <classpath refid="id.classpath.samples"/>
  </java>
  <java classname="org.apache.xml.security.samples.signature.VerifySignature" 
      fork="yes">
    <classpath refid="id.classpath.samples"/>
  </java>
    
  <echo message=""/>
  <echo message="Now I&apos;ll create a signature like merlin-16 but without XSLT"/>
  <java classname="org.apache.xml.security.samples.signature.CreateMerlinsExampleSixteen" 
      fork="yes">
    <classpath refid="id.classpath.samples"/>
  </java>

  <echo message=""/>
  <echo message="Please look into log.txt, merlinsSixteenRecreated.xml and signature.xml"/>


  <echo message=""/>
  <echo message="Now I&apos;ll create a signature like merlin-23 but without XSLT"/>
  <java classname="org.apache.xml.security.samples.signature.CreateMerlinsExampleTwentyThree" 
      fork="yes">
    <classpath refid="id.classpath.samples"/>
  </java>

  <echo message=""/>
  <echo message="Please look into log.txt, merlinsTwentyThreeRecreated.xml and signature.xml"/>
    </target>

    <target name="createEnvelope" 
      depends="build.samples">
  <java classname="org.apache.xml.security.samples.signature.CreateEnvelopingSignature" 
      fork="yes">
    <classpath refid="id.classpath.samples"/>
  </java>
    </target>

    <!-- JSR 105 Samples -->
    <target name="jsr105-samples" 
      depends="build.samples">
        <echo message="Generating a detached signature"/>
        <java classname="javax.xml.crypto.dsig.samples.GenDetached"
      fork="yes">
      <classpath refid="id.classpath.samples"/>
      <sysproperty key="proxyHost" value="${proxy.host}"/>
      <sysproperty key="proxyPort" value="${proxy.port}"/>
  </java>
  <echo message="Generating an enveloped signature"/>
  <java classname="javax.xml.crypto.dsig.samples.GenEnveloped"
      fork="yes">
      <arg value="${dir.src.samples}/javax/xml/crypto/dsig/samples/envelope.xml"/>
      <classpath refid="id.classpath.samples"/>
  </java>
  <echo message="Generating an enveloping signature"/>
  <java classname="javax.xml.crypto.dsig.samples.GenEnveloping"
      fork="yes">
      <classpath refid="id.classpath.samples"/>
  </java>
  <echo message="Validating a signature"/>
  <java classname="javax.xml.crypto.dsig.samples.Validate"
      fork="yes">
      <arg value="${dir.src.samples}/javax/xml/crypto/dsig/samples/envelopedSignature.xml"/>
      <classpath refid="id.classpath.samples"/>
  </java>
    </target>
  
    <!-- D I S T R I B U T I O N  T A R G E T S -->
    <!-- distribution targets -->

    <target name="build.dist"       
      depends="build.srcdist,build.bindist" />

    <target name="build.srcdist" 
      depends="clean"
  description="Creates the source distribution" >
    
  <mkdir dir="${dir.build.srcdist}"/>

  <copy todir="${dir.build.srcdist}">
      <fileset dir=".">
    <patternset refid="id.patternset.distFiles"/>
    <patternset refid="id.patternset.srcFiles"/>
    <patternset refid="id.patternset.srcUnitTestsFiles"/>
    <patternset refid="id.patternset.srcSamplesFiles"/>
    <patternset refid="id.patternset.dataFiles"/>
        
    <include name="ant/**/*"/>
      </fileset>
  </copy>

  <mkdir description="create an empty libs dir"
         dir="${dir.build.srcdist}/libs"/>
    
  <zip basedir="${dir.build.dist}/src" 
       zipfile="${dir.build}/${product.name}-src-${product_version}.zip"/>
    </target>

    <target name="build.bindist"
      depends="clean,build.src,build.jar,build.docs,build.xdocs" 
      description="Creates the binary distribution">

  <mkdir dir="${dir.build.bindist}"/>

  <copy todir="${dir.build.bindist}">
      <fileset dir=".">
    <patternset refid="id.patternset.distFiles"/>
    <patternset refid="id.patternset.dataFiles"/>
    <patternset refid="id.patternset.srcUnitTestsFiles"/>
    <patternset refid="id.patternset.srcSamplesFiles"/>
        
    <include name="ant/**/*"/>
      </fileset>
  </copy>

  <mkdir dir="${dir.build.bindist}/libs"/>

  <copy file="${lib.xerces.1}" 
        todir="${dir.build.bindist}/libs"/>
  <copy file="${lib.xalan.1}" 
        todir="${dir.build.bindist}/libs"/>
  <copy file="${lib.xalan.2}" 
        todir="${dir.build.bindist}/libs"/>
  <copy file="${lib.xalan.3}" 
        todir="${dir.build.bindist}/libs"/>
  <copy file="${lib.logging}" 
        todir="${dir.build.bindist}/libs"/>
  <copy file="${lib.logging.api}" 
        todir="${dir.build.bindist}/libs"/>
  
  <copy description="copy xmlsec JAR" 
        file="${jar.library}" 
        todir="${dir.build.bindist}/libs"/>
  <copy description="copy xmlsec sample JAR" 
        file="${jar.samples}" 
        todir="${dir.build.bindist}/libs"/>
  <copy description="copy xmlsec test JAR" 
        file="${jar.tests}" 
        todir="${dir.build.bindist}/libs"/>

  <mkdir dir="${dir.build.bindist}/doc"/>
  <copy todir="${dir.build.bindist}/doc">
      <fileset dir="${dir.docs}/build/site"/>
  </copy>
  <mkdir dir="${dir.build.bindist}/doc/Java/api" />
  <copy todir="${dir.build.bindist}/doc/Java/api">
      <fileset dir="${dir.build.docs.html}/javadoc"/>
  </copy>

  <zip basedir="${dir.build.dist}/bin" 
       zipfile="${dir.build}/${product.name}-bin-${product_version}.zip"/>
    </target>

  
    <!-- M I S C E L A N E O U S  T A R G E T S -->

    <!-- documentation -->
    <target name="build.docs">
  <mkdir dir="${dir.build.javadoc}"/>
  <javadoc classpathref="id.classpath"
     destdir="${dir.build.javadoc}">
      <packageset dir="${dir.src}">
          <include name="org/apache/xml/security/**"/>
          <include name="javax/xml/crypto/**"/>
            </packageset>
            <group title="JSR 105 Packages" packages="javax.xml.crypto*"/>
            <group title="XMLSec Packages" packages="org.apache.xml.security*"/>
      </javadoc>
    </target>

    <target name="build.xdocs"
            depends="do.check.forrest"
      if="has.forrest">
  <!-- Call Forrest externally -->
  <exec executable="forrest"
        os="Linux SunOS"
        dir="${dir.docs}" />
  <exec executable="forrest.bat"
        os="Windows"
        dir="${dir.docs}" />
    </target>
    
    <target name="clover.report.html" depends="with.clover">
  <clover-report>
          <current outfile="${dir.build.coverage}"
               title="Apache XML-Security coverage">
            <fileset dir="${dir.src}">
          <include name="**/*.java"/>
          <exclude name="**/*Exception.java" />
      </fileset>
             <format type="html"/> 
          </current>   
     </clover-report>
    </target>

    <!-- jars -->
    <target name="manifest">
  <tstamp/>
  <mkdir dir="${dir.manifest}"/>
  <copy file="${basedir}/LICENSE" tofile="${dir.manifest}/LICENSE.txt"/>
  <copy file="${basedir}/NOTICE" tofile="${dir.manifest}/NOTICE.txt"/>
  <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>
    </target>

    <target name="build.jar"
      depends="manifest,build.src,build.test,build.samples">

  <!-- Main Library -->
  <jar basedir="${dir.build.bin}"
       excludes="org/apache/xml/security/temp/**"
       includes="org/apache/**, org/jcp/**, javax/xml/crypto/**"
       destfile="${jar.library}" 
       manifest="${jar.manifest}">
    <metainf file="${dir.manifest}/*.txt"/>
  </jar>

  <!-- Samples -->
  <jar basedir="${dir.build.samples}" 
       excludes="org/apache/xml/security/temp/**" 
       includes="org/apache/**, javax/xml/crypto/**"
       destfile="${jar.samples}" 
       manifest="${jar.manifest}">
    <metainf file="${dir.manifest}/*.txt"/>
  </jar>
    
  <!-- Tests -->
  <jar basedir="${dir.build.test}" 
       excludes="org/apache/xml/security/temp/**" 
       includes="org/apache/**, javax/xml/crypto/**"
       destfile="${jar.tests}" 
       manifest="${jar.manifest}">
    <metainf file="${dir.manifest}/*.txt"/>
  </jar>
    </target>

    <target name="build.src.jar"
      depends="manifest,build.src">

  <jar basedir="${dir.build.bin}" 
       excludes="org/apache/xml/security/temp/**"
       includes="**/LICENSE, **/NOTICE, org/apache/**, org/jcp/**, javax/xml/crypto/**, *.txt" 
       jarfile="${jar.library}" 
       manifest="${jar.manifest}"/>
    </target>

    <!-- archive targets -->
    <target name="build.arch"
            depends="env.mk.dirs" >
    </target >

    <!-- aliases -->
    <target name="build.all"        depends="env.mk.dirs,build.src,build.docs,build.test,build.samples,build.jar,build.arch" />

    <target name="compile"          depends="build.src" />
    <target name="docs"             depends="build.docs" />
    <target name="xdocs"            depends="build.xdocs" />
    <target name="javadoc"          depends="build.docs" />
    <target name="jar"              depends="build.jar" />
    <target name="dist"             depends="build.dist" />
    <target name="clean"            depends="env.rm.dirs,env.rm.files"/>
    <target name="gump"        depends="clean, docs, jar, test"/>
    <target name="clover"      depends="clean, with.clover, test, clover.report.html" />

    <!-- maintenance targets -->

    <!-- help targets -->
    <target depends="init" name="help" >
        <echo message="synopsis: ant [target]" />
        <echo message="targets:" />
        <echo message="compile  - builds xml-security source" />
        <echo message="docs     - creates java documentation" />
        <echo message="xdocs    - creates website" />
        <echo message="jar      - creates a jar file, containing the built source" />
        <echo message="dist     - creates a distribution" />
        <echo message="           (see ant help.dist for more information)" />
        <echo message="clean    - resets the build environment" />
        <echo message="test     - performs a series of tests" />
        <echo message="           (see ant help.test for more information)" />
        <echo message="help     - displays this help message (default)" />
        <echo message="config   - optional configuration information" />
        <echo message="           (see ant help.config for more information)" />
        <echo message=""/>
        <echo message="See also help.samples for help on building samples"/>
    </target >
    <target depends="init" name="help.dist" >
        <echo message="dist:" />
        <echo message="this target will:" />
        <echo message="1.  build the source files," />
        <echo message="2.  create the appropriate java documentation," />
        <echo message="3.  create distribution jars," />
        <echo message="4.  copy the license, copies source and" />
        <echo message="5.  creates distribution archives" />
    </target >

    <target depends="init" name="help.test" >
        <echo message="test      - runs all unit and interop tests" />
        <echo message="test_exc_c14n - runs the exclusive c14n tests" />
        <echo message="test_xenc  - does all encryption related tests" />
        <echo message="clover    - generates clover coverage reports" />
    </target >

    <target depends="init" name="help.samples" >
  <echo message=""/>
  <echo message="------------- Signature Samples ----------------"/>
  <echo message=""/>
  <echo message="generate-keys      - generates new keys to be used by other"/>
  <echo message="                     examples"/>
  <echo message="sign               - runs CreateSignature sample"/>
  <echo message="verify             - runs signature verification sample"/>
  <echo message="signAndVerify      - runs sign and then verify"/>
  <echo message="axis-sign          - runs axis signing sample"/>
  <echo message="axis-verify        - runs axis verification sample"/>
  <echo message="AxisSignAndVerify  - runs axis sign and verify"/>
  <echo message="createEnvelope     - runs enveloping signature sample"/>
  <echo message="mega-sample        - runs all big signature samples"/>
  <echo message=""/>
  <echo message="------------- Encryption Samples ----------------"/>
  <echo message=""/>
  <echo message="encrypt            - run encryption sample" />
  <echo message="decrypt            - run decryption sample" />
  <echo message="encryptAndDecrypt  - run encryption sample" />
    </target>
    
    <target depends="init" name="help.config" >
        <echo message="1.  to configure the provider setings," />
        <echo message="    see the contents of provider.properties" />
        <echo message="2.  to configure the proxy setings," />
        <echo message="    see the contents of proxy.properties" />
    </target >
</project>
<!-- Keep this comment at the end of the file
Local variables:
mode: xml
sgml-omittag:nil
sgml-shorttag:nil
sgml-namecase-general:nil
sgml-general-insert-case:lower
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:4
sgml-indent-data:t
sgml-parent-document:nil
sgml-exposed-tags:nil
sgml-local-catalogs:("/usr/lib/sgml/catalog" "/usr/share/xemacs21/xemacs-packages/etc/psgml-dtds/CATALOG")
sgml-local-ecat-files:("ECAT" "~/sgml/ECAT" "/usr/lib/sgml/ECAT" "/usr/local/lib/sgml/ECAT")
End:
-->

File: provider.properties

# The XML Security Project uses a third party cryptographic provider
# because the JCE does not supply all the relevant algorithms.
#
# Use this file to specify the provider information. The XML Security
# implementation uses The Legion of the Bouncy Castle's provider.

# Specify your preferred provider, together with the download location
# of the provider file in this section.
jce.provider.source     = http://www.bouncycastle.org/download
jce.provider.prefix     = bc
jce.provider.jar        = jce-jdk13-129.jar

# Specify a checksum algoritm and a checksum value for JCE provider
# in this section. The checksum is used to ensure that no data
# corruption occured during the download of the provider.
checksum.algorithm      = md5
checksum.value          = 3d48aef8338ca75d1f0f0eb527c3d545





File: proxy.properties

# Set these values if you are behind a firewall
proxy.host = your.proxy.goes.here
proxy.port = 8080

 








Related examples in the same category

1.Ant script for xmlgraphics-commons
2.nutch ant script
3.rhino ant build script
4.apache solr ant script
5.Tomcat ant build script
6.OFBiz ant build script
7.Apache Lenya Build System
8.Apache pivot ant build script
9.XmlSchema ant script
10.velocity tools ant script
11.weka build script
12.xml bean ant script
13.xml graphics common ant script
14.uPortal ant script
15.SmartGWT ant script
16.Build file to fetch maven2 tasks; extracted from (Ant's) fetch.xml
17.Build file to fetch optional libraries for Apache Ant
18.Ant build script
19.Build script for apache-cassandra-0.5.1-src
20.apache-log4j-site\build.xml
21.apache-roller-src-4.0.1
22.Build script from apache dbutils
23.Fop build script
24.Google guice ant script
25.GWT ant script
26.hadoop ant build script
27.jakarta jmeter ant script
28.jakarta oro ant script
29.jakarta regexp ant script
30.jedit build script
31.jibx ant build script
32.lucene ant build script