build.xml 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <project name="epayment" default="jar" basedir=".">
  3. <property name="root.dir" location=".."/>
  4. <property name="target.dir" location="../target"/>
  5. <property name="src" location="src"/>
  6. <property name="lib" location="lib"/>
  7. <property name="bin" location="bin"/>
  8. <path id="compile.class.path">
  9. <fileset dir="${lib}">
  10. <include name="*.jar"/>
  11. </fileset>
  12. <fileset dir="${root.dir}/Apps/EPAYMENT/WEB-INF/lib" erroronmissingdir="false">
  13. <include name="*.jar"/>
  14. </fileset>
  15. </path>
  16. <target name="init">
  17. <mkdir dir="${bin}"/>
  18. <mkdir dir="${lib}"/>
  19. </target>
  20. <target name="jar" depends="init">
  21. <javac debug="true" srcdir="${src}" destdir="${bin}" includeantruntime="true">
  22. <classpath refid="compile.class.path"/>
  23. </javac>
  24. <jar jarfile="${lib}/${ant.project.name}.jar" basedir="${bin}"/>
  25. </target>
  26. <target name="war" depends="jar" description="Generate Web Application">
  27. <delete file="epayment.war"/>
  28. <!-- 1. Copy UI assets dari Apps/EPAYMENT ke staging directory -->
  29. <copy todir="${target.dir}/webapps/EPAYMENT" overwrite="true">
  30. <fileset dir="${root.dir}/Apps/EPAYMENT"/>
  31. </copy>
  32. <!-- 2. Copy hasil kompilasi epayment.jar terbaru ke WEB-INF/lib -->
  33. <copy todir="${target.dir}/webapps/EPAYMENT/WEB-INF/lib" file="${lib}/${ant.project.name}.jar" overwrite="true"/>
  34. <!-- 3. Copy hibernate configs dari MWDAO/src ke WEB-INF/classes -->
  35. <copy todir="${target.dir}/webapps/EPAYMENT/WEB-INF/classes" overwrite="true" failonerror="false">
  36. <fileset dir="${root.dir}/MWDAO/src">
  37. <include name="hibernate-*.cfg.xml"/>
  38. </fileset>
  39. </copy>
  40. <!-- 4. Package menjadi WAR -->
  41. <war destfile="epayment.war" webxml="${target.dir}/webapps/EPAYMENT/WEB-INF/web.xml">
  42. <fileset dir="${target.dir}/webapps/EPAYMENT"/>
  43. </war>
  44. </target>
  45. </project>