build.xml 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <project name="mwui" default="jar" basedir=".">
  3. <property name="src" location="src"/>
  4. <property name="lib" location="lib"/>
  5. <property name="bin" location="bin"/>
  6. <path id="compile.class.path">
  7. <fileset dir="${lib}">
  8. <include name="*.*"/>
  9. </fileset>
  10. </path >
  11. <target name="jar">
  12. <javac debug="true" srcdir="${src}" destdir="${bin}" includeantruntime="true">
  13. <classpath>
  14. <path refid="compile.class.path"/>
  15. </classpath>
  16. </javac>
  17. <!--copy todir="${bin}\hbm" >
  18. <fileset dir="${src}\hbm">
  19. </fileset>
  20. </copy-->
  21. <jar jarfile="${lib}\${ant.project.name}.jar" basedir="${bin}"/>
  22. <copy todir="C:\AppServer\apache-tomcat-9.0.56\webapps\MWUI\WEB-INF\lib" file="${lib}\${ant.project.name}.jar"/>
  23. </target>
  24. <target name="hibernate-java" >
  25. <taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask">
  26. <classpath>
  27. <fileset dir="${lib}">
  28. <include name="*.jar"/>
  29. <exclude name="${ant.project.name}.jar"/>
  30. </fileset>
  31. </classpath>
  32. </taskdef>
  33. <hibernatetool destdir="${src}">
  34. <classpath>
  35. <path location="${src}"/>
  36. </classpath>
  37. <configuration configurationfile="${src}/hibernate-mwapp.cfg.xml" />
  38. <!--hbmtemplate
  39. templateprefix="pojo/"
  40. template="pojo Pojo.ftl"
  41. filepattern="{package-name}/{class-name}.java">
  42. <property key="jdk5" value="true" />
  43. <property key="ejb3" value="true" />
  44. </hbmtemplate-->
  45. <hbm2java/>
  46. <hbm2dao/>
  47. </hibernatetool>
  48. <hibernatetool destdir="${src}">
  49. <classpath>
  50. <path location="${src}"/>
  51. </classpath>
  52. <configuration configurationfile="${src}/hibernate-mwconfig.cfg.xml" />
  53. <hbm2java/>
  54. </hibernatetool>
  55. <hibernatetool destdir="${src}">
  56. <classpath>
  57. <path location="${src}"/>
  58. </classpath>
  59. <configuration configurationfile="${src}/hibernate-mwlog.cfg.xml" />
  60. <hbm2java/>
  61. </hibernatetool>
  62. <hibernatetool destdir="${src}">
  63. <classpath>
  64. <path location="${src}"/>
  65. </classpath>
  66. <configuration configurationfile="${src}/hibernate-mwtemp.cfg.xml" />
  67. <hbm2java/>
  68. </hibernatetool>
  69. </target>
  70. <target name="war" description="Generate Web Application">
  71. <delete file="mwui.war"/>
  72. <delete file="C:\AppServer\apache-tomcat-9.0.56\webapps\MWUI\WEB-INF\classes\hibernate-mwapp.cfg.xml"/>
  73. <delete file="C:\AppServer\apache-tomcat-9.0.56\webapps\MWUI\WEB-INF\classes\hibernate-mwapp-config.cfg.xml"/>
  74. <delete file="C:\AppServer\apache-tomcat-9.0.56\webapps\MWUI\WEB-INF\classes\hibernate-mwconfig.cfg.xml"/>
  75. <delete file="C:\AppServer\apache-tomcat-9.0.56\webapps\MWUI\WEB-INF\classes\hibernate-mwlog.cfg.xml"/>
  76. <delete file="C:\AppServer\apache-tomcat-9.0.56\webapps\MWUI\WEB-INF\classes\hibernate-mwtemp.cfg.xml"/>
  77. <copy todir="C:\AppServer\apache-tomcat-9.0.56\webapps\MWUI\WEB-INF\classes" file="C:\Projects\MWDAO\hbm_ds\hibernate-mwapp.cfg.xml"/>
  78. <copy todir="C:\AppServer\apache-tomcat-9.0.56\webapps\MWUI\WEB-INF\classes" file="C:\Projects\MWDAO\hbm_ds\hibernate-mwapp-config.cfg.xml"/>
  79. <copy todir="C:\AppServer\apache-tomcat-9.0.56\webapps\MWUI\WEB-INF\classes" file="C:\Projects\MWDAO\hbm_ds\hibernate-mwlog.cfg.xml"/>
  80. <copy todir="C:\AppServer\apache-tomcat-9.0.56\webapps\MWUI\WEB-INF\classes" file="C:\Projects\MWDAO\hbm_ds\hibernate-mwtemp.cfg.xml"/>
  81. <copy todir="C:\AppServer\apache-tomcat-9.0.56\webapps\MWUI\WEB-INF\classes" file="C:\Projects\MWDAO\hbm_ds\hibernate-mwconfig.cfg.xml"/>
  82. <war destfile="mwui.war" webxml="C:\AppServer\apache-tomcat-9.0.56\webapps\MWUI\WEB-INF\web.xml">
  83. <fileset dir="C:\AppServer\apache-tomcat-9.0.56\webapps\MWUI"/>
  84. </war>
  85. <delete file="C:\AppServer\apache-tomcat-9.0.56\webapps\MWUI\WEB-INF\classes\hibernate-mwapp.cfg.xml"/>
  86. <delete file="C:\AppServer\apache-tomcat-9.0.56\webapps\MWUI\WEB-INF\classes\hibernate-mwapp-config.cfg.xml"/>
  87. <delete file="C:\AppServer\apache-tomcat-9.0.56\webapps\MWUI\WEB-INF\classes\hibernate-mwconfig.cfg.xml"/>
  88. <delete file="C:\AppServer\apache-tomcat-9.0.56\webapps\MWUI\WEB-INF\classes\hibernate-mwlog.cfg.xml"/>
  89. <delete file="C:\AppServer\apache-tomcat-9.0.56\webapps\MWUI\WEB-INF\classes\hibernate-mwtemp.cfg.xml"/>
  90. <copy todir="C:\AppServer\apache-tomcat-9.0.56\webapps\MWUI\WEB-INF\classes" file="C:\Projects\MWDAO\src\hibernate-mwapp.cfg.xml"/>
  91. <copy todir="C:\AppServer\apache-tomcat-9.0.56\webapps\MWUI\WEB-INF\classes" file="C:\Projects\MWDAO\src\hibernate-mwapp-config.cfg.xml"/>
  92. <copy todir="C:\AppServer\apache-tomcat-9.0.56\webapps\MWUI\WEB-INF\classes" file="C:\Projects\MWDAO\src\hibernate-mwlog.cfg.xml"/>
  93. <copy todir="C:\AppServer\apache-tomcat-9.0.56\webapps\MWUI\WEB-INF\classes" file="C:\Projects\MWDAO\src\hibernate-mwtemp.cfg.xml"/>
  94. <copy todir="C:\AppServer\apache-tomcat-9.0.56\webapps\MWUI\WEB-INF\classes" file="C:\Projects\MWDAO\src\hibernate-mwconfig.cfg.xml"/>
  95. <copy todir="C:\Projects\MWDAO\release" file="mwui.war"/>
  96. </target>
  97. </project>