build.xml 1.61 KB
Newer Older
IBM Bluemix's avatar
IBM Bluemix committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
<?xml version="1.0" encoding="UTF-8"?>
<project basedir="." default="build" name="Goweb">
    
  <property name="debuglevel" value="source,lines,vars" />
  <property name="target" value="1.5" />
  <property name="source" value="1.5" />
  <property name="warname" value="${ant.project.name}.war" />
  <property name="artifact_dir" value="${ARCHIVE_DIR}"/>
  
  <path id="classpathDir">
    <pathelement location="bin" />
  </path>
  
  <target name="init">
    <mkdir dir="bin" />
    <copy includeemptydirs="false" todir="bin">
      <fileset dir="src">
        <exclude name="**/*.java" />
      </fileset>
    </copy>
    <copy includeemptydirs="false" todir="bin">
      <fileset dir="WebContent" />
    </copy>
	<echo message="Copy files to ${artifact_dir} for deployment"/>
	<copy todir="${artifact_dir}">
      <fileset file="manifest.yml" />
    </copy>
  </target>
  
  <target name="clean">
    <delete dir="bin" />
  </target>
  
  <target name="build" depends="build-project,build-war" />
  
  <target name="cleanall" depends="clean" />
  
  <target name="build-project" depends="init">
    <echo message="${ant.project.name}: ${ant.file}" />
    <javac debug="true" debuglevel="${debuglevel}" destdir="bin" source="${source}" target="${target}" includeantruntime="false">
      <src path="src" />
    	<classpath>
	      	<pathelement path="${classpathDir}"/>
	      	<fileset dir="lib">
	      	  <include name="**/*.jar"/>
	      	</fileset>
	   </classpath>
    </javac>
  </target>
  
  <target name="build-war" depends="build-project">
    <war destfile="${artifact_dir}/${warname}" basedir="bin" />
  </target>

  
</project>