All pastes #827390 Raw Edit

Stuff

public text v1 · immutable
#827390 ·published 2007-12-21 19:04 UTC
rendered paste body
<?xml version="1.0" encoding="UTF-8"?>
<project name="MerchBuilder" default="compile" basedir=".">
  <!-- Properties -->
  <property name="app.name" value="MerchBuilder" />
  <property name="app.jar" value="${app.name}.jar" />
  <property name="app.xml" location="xml" />
  <property name="pkg.name" value="edu.fsu.src02.merchbuilder" />

  <property name="src.dir" location="src" />
  <property name="lib.dir" location="lib" />
  <property name="doc.dir" location="doc" />
  <property name="xml.dir" location="xml" />
  <property name="doc.api.dir" location="${doc.dir}/api" />
  <property name="build.dir" location="build" />
  <property name="build.lib.dir" location="${build.dir}/lib" />
  <property name="build.xml.dir" location="${build.dir}/xml" />
  <property name="dist.dir" location="dist" />

  <property name="compile.debug" value="true" />
  <property name="compile.deprecation" value="false" />
  <property name="compile.optimize" value="true" />

  <property name="main.class" value="edu.fsu.src02.merchbuilder.MerchBuilder" />

  <!-- Classpath -->
  <path id="lib.classpath">
    <fileset dir="${lib.dir}">
      <include name="**/*.jar" />
    </fileset>
  </path>

  <path id="run.classpath">
    <fileset dir="${dist.dir}">
      <include name="**/*.jar" />
    </fileset>
  </path>

  <path id="xml.classpath">
    <fileset dir="${xml.dir}">
      <include name="**/*.xml" />
    </fileset>
  </path>

  <!-- INIT -->
  <target name="init">
    <mkdir dir="${build.dir}" />
    <mkdir dir="${build.xml.dir}" />
    <mkdir dir="${build.lib.dir}" />
    <mkdir dir="${src.dir}" />
    <mkdir dir="${lib.dir}" />
    <mkdir dir="${doc.dir}" />
    <mkdir dir="${doc.api.dir}" />
    <mkdir dir="${dist.dir}" />
  </target>

  <!-- Compile -->
  <target name="compile" depends="init">
    <javac srcdir="${src.dir}"
           destdir="${build.dir}"
           debug="${compile.debug}" 
           deprecation="${compile.deprecation}"
           optimize="${compile.optimization}" >
      <classpath refid="lib.classpath" />
    </javac>
  </target>
  
  <!-- Jar -->
  <target name="jar" depends="compile">
    <copy todir="${build.dir}">
      <fileset dir="${lib.dir}">
        <include name="**/*.jar" />
      </fileset>
      <fileset dir="${xml.dir}">
        <include name="**/*.xml" />
      </fileset>
    </copy>

    <jar jarfile="${dist.dir}/${app.jar}" basedir="${build.dir}">
      <manifest>
        <attribute name="Main-Class" value="${main.class}" />
      </manifest>
      <!--fileset dir="${lib.dir}">
        <include name="**/*.jar" />
      </fileset>
      <fileset dir="${xml.dir}">
        <include name="**/*.xml" />
      </fileset-->
    </jar>
  </target>

  <!-- Run -->
  <target name="run" depends="jar">
    <java classname="${main.class}" fork="true">
      <classpath refid="run.classpath" />
      <classpath refid="lib.classpath" />
      <classpath refid="xml.classpath" />
    </java>
  </target>

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