Subversion Repositories display

Rev

Rev 560 | Blame | Compare with Previous | Last modification | View Log | RSS feed

<?xml version="1.0"?>
<!--
   File: build.xml
   
   Copyright (C) 2006 Steve Ratcliffe
   
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License version 2 as
    published by the Free Software Foundation.
   
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
   
   
   Author: Steve Ratcliffe
   Create date: 26 Nov 2006
-->
<project name="display" default="dist" basedir="."
        xmlns:ivy="antlib:org.apache.ivy.ant">

        <!-- Init -->
  <property name="top" value="."/>

        <property file="${top}/external.properties"/>
        <property name="mkgmap.dir" value="../mkgmap"/>

        <!-- ivy dependency support -->
        <property name="ivy.version" value="2.5.0"/>
        <property name="ivy.lib.dir" value="${basedir}/lib" />
        <property name="ivy.jar.dir" value="${ivy.lib.dir}/build" />
        <property name="ivy.retrieve.pattern"
                value="${ivy.lib.dir}/[conf]/[artifact]-[revision].[ext]" />
        <property name="ivy.distrib.dir" value="ivy-distrib" />

  <property name="build" value="build"/>
  <property name="dist" value="dist"/>
  <property name="build.classes" value="${build}/classes"/>
  <property name="src" value="src"/>
  <property name="doc" value="doc"/>
  <property name="javadoc" value="${doc}/api"/>
  <property name="resources" value="resources"/>

  <path id="main">
                <!-- you can place a mkgmap.jar in the current directory or you
                can have a built source tree at the same level -->
                <pathelement location="mkgmap.jar" />
                <pathelement location="${mkgmap.dir}/build/classes" />
    <pathelement location="${build.classes}" />
                <fileset dir="${ivy.lib.dir}/compile" />
  </path>

        <!-- Prepare - make all the directories -->
        <target name="prepare">
                <mkdir dir="${build.classes}" />
        </target>

  <target name="compile" depends="prepare, resolve-compile" description="main compilation">

    <javac srcdir="${src}" destdir="${build.classes}" debug="true" encoding="utf-8" includeantruntime="false">
      <include name="**/*.java" />
      <classpath refid="main"/>
      <compilerarg value="-Xlint:all"/>
      <compilerarg value="-Xlint:-serial"/>
      <compilerarg value="-Xlint:-path"/>
     </javac>
  </target>

  <target name="javadoc" description="Create the javadoc">
    <mkdir dir="doc"/>
    <javadoc destdir="${javadoc}">

      <fileset dir="${src}" includes="**/*.java"/>
      <classpath refid="main"/>
    </javadoc>
  </target>


  <target name="dist" depends="build"
         description="Make the distribution area">

    <mkdir dir="${dist}"/>

    <!-- Make the jar -->
    <jar basedir="${build.classes}" jarfile="${dist}/display.jar">
      <include name="**/*.class"/>
                        <include name="*.csv"/>
                        <include name="*.properties"/>
                        <include name="**/*.trans"/>
                        <include name="styles/**"/>
                        <include name="help/**"/>
    </jar>

  </target>

  <!-- targets for downloading and registering ivy -->
  <target name="ivy-availability" description="Checks if the ivy library is available">
    <property name="ivy.jar.file" value="${ivy.jar.dir}/ivy-${ivy.version}.jar" />
    <available property="ivy.available" file="${ivy.jar.file}" />
  </target>

  <target name="download-ivy" unless="ivy.available" description="Downloads the ivy library from public repositories.">
    <delete dir="${ivy.jar.dir}"/>
    <mkdir dir="${ivy.jar.dir}" />
    <get src="https://repo1.maven.org/maven2/org/apache/ivy/ivy/${ivy.version}/ivy-${ivy.version}.jar"
        dest="${ivy.jar.file}" usetimestamp="true"/>
  </target>

  <target name="init-ivy" depends="ivy-availability, download-ivy" description="Registers ivy with ant and initializes it." unless="ivy.initialized">
    <path id="ivy.lib.path">
      <fileset dir="${ivy.jar.dir}" includes="*.jar" />
    </path>
    <taskdef resource="org/apache/ivy/ant/antlib.xml"
      uri="antlib:org.apache.ivy.ant"
      classpathref="ivy.lib.path" />
    <ivy:configure />
    <ivy:info />
    <property name="ivy.initialized" value="true"/>
  </target>

 <!-- targets for fetching dependencies via ivy -->
  <target name="resolve-compile" depends="init-ivy" description="Downloads compile dependencies using ivy.">
    <ivy:retrieve conf="compile" log="download-only" />
  </target>

  <!-- Clean everything -->
        <target name="clean">
                <delete dir="${build}" />
        </target>

        <!-- Clobber all generated and built files -->
        <target name="clobber" depends="clean">
                <delete dir="${dist}" />
  </target>

        <!-- Main -->
  <target name="build" depends="compile" >
  </target>

        <target name="rebuild" depends="clean, build" />

</project>