SSISO Community

시소당

ant build.xml 예제

<?xml version="1.0" encoding="UTF-8"?>
<project name="AMO_FCST_Evaluation_System" default="compile" basedir=".">

  <!-- set global properties for this build -->
  <property name="install.dir" value="/home/web"/>
  <property name="application.name" value="evaluation"/>
  <property name="src.dir" value="JavaSource"/>
  <property name="build.dir" value="WebContent/WEB-INF/classes"/>
  <property name="lib.dir" value="WebContent/WEB-INF/lib"/>
  <property name="lib.servlet.dir" value="lib"/>
  <property name="src.web.dir" value="WebContent"/>
  
  <!-- Classpath -->
  <path id="classpath">
    <fileset dir="${lib.dir}" casesensitive="yes">
      <include name="*.jar"/>
    </fileset>
    <fileset dir="${lib.servlet.dir}" casesensitive="yes">
      <include name="*.jar"/>
    </fileset>
  </path>
  
  <target name="init">
    <!-- Create the time stamp -->
    <tstamp/>
  </target>

  <target name="compile">
    <!-- Compile the java code from ${src.dir} into ${build} -->
    <mkdir dir="${build.dir}"/>
    <javac srcdir="${src.dir}" destdir="${build.dir}">
      <classpath refid="classpath"/>
    </javac>
  </target>

  <target name="clean" description="Delete the ${build} and ${dist.dir} and ${defaultUploadFielDirPath} directory trees">
    <delete dir="${build.dir}"/>
  </target>
  
  <target name="install-web"
    description="Copy web files to ${install.dir}/${application.name}">
    <echo message="Copy web files to ${install.dir}/${application.name}"/>
    <mkdir dir="${install.dir}/${application.name}"/>
    <copy todir="${install.dir}/${application.name}">
      <fileset dir="${src.web.dir}" excludes="WEB-INF/lib/*.jar,WEB-INF/classes/**/*"/>
    </copy>
  </target>

        <target name="install-web-devel"
          description="No pre-task is executed before Copy web files to ${install.dir}/${application.name}">
          <echo message="Copy web files to ${install.dir}/${application.name}"/>
          <mkdir dir="${install.dir}/${application.name}"/>
          <copy todir="${install.dir}/${application.name}">
            <fileset dir="${src.web.dir}"/>
          </copy>
        </target>
  
  <target name="install-lib" description="Copies library files to${install.dir}/${application.name}/WEB-INF/lib">
    <copy todir="${install.dir}/${application.name}/WEB-INF/lib">
      <fileset dir="${lib.dir}"/>
    </copy>
  </target>

  <target name="install-classes" depends="compile" description="Copies class files to${install.dir}/${application.name}/WEB-INF/classes">
    <copy todir="${install.dir}/${application.name}/WEB-INF/classes">
      <fileset dir="${build.dir}"/>
    </copy>
  </target>

  <target name="install" depends="init, install-web, install-lib, install-classes" description="Install whole web application..."/>
  
</project>

1563 view

4.0 stars