Blob Blame History Raw
<?xml version="1.0" encoding="UTF-8"?>

<!--build.xml generated by maven from project.xml version 5.2
  on date June 26 2007, time 1708-->
<project default="jar" name="bcel" basedir=".">
  <!--Load local and user build preferences-->
  <property file="build.properties"></property>
  <!--Build properties-->
  <property name="defaulttargetdir" value="${basedir}/target"></property>
  <property name="libdir" value="${basedir}/lib"></property>
  <property name="classesdir" value="${basedir}/target/classes"></property>
  <property name="distdir" value="${basedir}/dist"></property>
  <property name="javadocdir" value="${basedir}/dist/docs/api"></property>
  <property name="final.name" value="bcel-5.2"></property>
  <property name="proxy.host" value=""></property>
  <property name="proxy.port" value=""></property>
  <property name="proxy.username" value=""></property>
  <property name="proxy.password" value=""></property>
  <property name="source.encoding" value="ISO-8859-1"></property>
  <path id="build.classpath">
    <pathelement location="${libdir}/regexp.jar"></pathelement>
  </path>
  <target name="init" description="o Initializes some properties">
    <mkdir dir="${libdir}"></mkdir>
    <condition property="noget">
      <equals arg2="only" arg1="${build.sysclasspath}"></equals>
    </condition>
    <!--Test if JUNIT is present in ANT classpath-->
    <available property="Junit.present" classname="junit.framework.Test"></available>
    <!--Test if user defined a proxy-->
    <condition property="useProxy">
      <and>
        <isset property="proxy.host"></isset>
        <not>
          <equals trim="true" arg2="" arg1="${proxy.host}"></equals>
        </not>
      </and>
    </condition>
  </target>
  <target name="compile" description="o Compile the code" depends="get-deps">
    <mkdir dir="${classesdir}"></mkdir>
    <javac destdir="${classesdir}" deprecation="true" debug="true" optimize="false" excludes="**/package.html" encoding="${source.encoding}">
      <src>
        <pathelement location="${basedir}/src/java"></pathelement>
      </src>
      <classpath refid="build.classpath"></classpath>
    </javac>
    <mkdir dir="${classesdir}/META-INF"></mkdir>
    <copy todir="${classesdir}/META-INF">
      <fileset dir="${basedir}/.">
        <include name="NOTICE.txt"></include>
      </fileset>
    </copy>
  </target>
  <target name="jar" description="o Create the jar" depends="compile,test">
    <jar jarfile="${defaulttargetdir}/${final.name}.jar" excludes="**/package.html" basedir="${classesdir}"></jar>
  </target>
  <target name="clean" description="o Clean up the generated directories">
    <delete dir="${defaulttargetdir}"></delete>
    <delete dir="${distdir}"></delete>
  </target>
  <target name="dist" description="o Create a distribution" depends="jar, javadoc">
    <mkdir dir="dist"></mkdir>
    <copy todir="dist">
      <fileset dir="${defaulttargetdir}" includes="*.jar"></fileset>
      <fileset dir="${basedir}" includes="LICENSE*, README*"></fileset>
    </copy>
  </target>
  <target name="test" description="o Run the test cases" if="test.failure" depends="internal-test">
    <fail message="There were test failures."></fail>
  </target>
  <target name="internal-test" if="Junit.present" depends="junit-present,compile-tests"></target>
  <target name="junit-present" unless="Junit.present" depends="init">
    <echo>================================= WARNING ================================</echo>
    <echo>Junit isn't present in your ${ANT_HOME}/lib directory. Tests not executed.</echo>
    <echo>==========================================================================</echo>
  </target>
  <target name="compile-tests" if="Junit.present" depends="junit-present,compile"></target>
  <target name="javadoc" description="o Generate javadoc" depends="get-deps">
    <mkdir dir="${javadocdir}"></mkdir>
    <tstamp>
      <format pattern="2002-yyyy" property="year"></format>
    </tstamp>
    <property name="copyright" value="Copyright &amp;copy;  Apache Software Foundation. All Rights Reserved."></property>
    <property name="title" value="jakarta-bcel 5.2 API"></property>
    <javadoc use="true" private="true" destdir="${javadocdir}" author="true" version="true" sourcepath="${basedir}/src/java" packagenames="org.apache.bcel.*" encoding="${source.encoding}">
      <classpath>
        <path refid="build.classpath"></path>
      </classpath>
      <link href="/usr/share/javadoc/java"/>
    </javadoc>
  </target>
  <target name="get-dep-regexp.jar" description="o Download the dependency : regexp.jar" unless="regexp.jar" depends="init,setProxy,noProxy,get-custom-dep-regexp.jar">
    <mkdir dir="${libdir}/JPP/jars/"></mkdir>
    <get dest="${libdir}/JPP/jars/regexp.jar" usetimestamp="true" ignoreerrors="true" src="file:/usr/share/maven/repository/JPP/jars/regexp.jar"></get>
  </target>
  <target name="get-custom-dep-regexp.jar" if="regexp.jar" depends="init,setProxy,noProxy">
    <mkdir dir="${libdir}/JPP/jars/"></mkdir>
    <get dest="${libdir}/JPP/jars/regexp.jar" usetimestamp="true" ignoreerrors="true" src="${regexp.jar}"></get>
  </target>
  <target name="get-deps" unless="noget" depends="get-dep-regexp.jar"></target>
  <target name="setProxy" if="useProxy" depends="init">
    <!--Proxy settings works only with a JDK 1.2 and higher.-->
    <echo>Proxy used :</echo>
    <echo>Proxy host [${proxy.host}]</echo>
    <echo>Proxy port [${proxy.port}]</echo>
    <echo>Proxy user [${proxy.username}]</echo>
    <setproxy proxyuser="${proxy.username}" proxyport="${proxy.port}" proxypassword="${proxy.password}" proxyhost="${proxy.host}"></setproxy>
  </target>
  <target name="noProxy" unless="useProxy" depends="init">
    <echo>Proxy not used.</echo>
  </target>
  <target name="install-maven">
    <get dest="${user.home}/maven-install-latest.jar" usetimestamp="true" src="${repo}/maven/maven-install-latest.jar"></get>
    <unjar dest="${maven.home}" src="${user.home}/maven-install-latest.jar"></unjar>
  </target>
  <!-- can rename this target when we get the docs sorted out -->

  <!-- ================================================================== -->
  <!-- D O C S                                                            -->
  <!-- ================================================================== -->
  
  <target 
    name="check_for_jdom">
    
    <available 
      property="jdom.present"
      classname="org.jdom.JDOMException">
      <classpath>
        <pathelement location="${jakarta.site2}/lib/${jdom.jar}"/>
      </classpath>
    </available>
  </target>
    
  <target 
    depends="check_for_jdom" 
    name="docs-prepare-error" 
    unless="jdom.present">
    
    <echo>
      The Jakarta-Site2 module is not present! Please check
      to make sure that you have checked it out from CVS.

      &lt;http://jakarta.apache.org/site/jakarta-site2.html&gt;
    </echo>
  </target>

  <target 
    name="xdocs"
    depends="docs-prepare-error"
    description="--> generates the HTML documentation"
    if="jdom.present">

    <taskdef 
      name="anakia"
      classname="org.apache.velocity.anakia.AnakiaTask">
      <classpath>
        <fileset dir="${jakarta.site2}/lib">
          <include name="*.jar"/>
        </fileset>
      </classpath>
    </taskdef>
        
    <anakia 
      basedir="${docs.src}" 
      destdir="${docs.dest}/"
      extension=".html" 
      style="./site.vsl"
      projectFile="stylesheets/project.xml"
      excludes="**/stylesheets/** empty.xml"
      includes="**/*.xml"
      lastModifiedCheck="true"
      templatePath="${jakarta.site2}/xdocs/stylesheets">
    </anakia>

    <copy 
      todir="${docs.dest}/images" 
      filtering="no">
      
      <fileset dir="${docs.src}/images">
        <include name="**/*.gif"/>
        <include name="**/*.jpeg"/>
        <include name="**/*.jpg"/>
      </fileset>
    </copy>
  </target>

</project>