build.xml 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <project name="jai" default="war">
  2. <!-- on suppose que JEELIB est initialisée en paramètre de l'application -->
  3. <property file="project.properties" />
  4. <property name="project.java.version" value="1.8" />
  5. <property name="encoding" value="UTF-8" />
  6. <property name="build" value="build" />
  7. <property name="testreports" value="testreports" />
  8. <property name="src" value="src" />
  9. <target name="prepare" description="Cree les repertoires et initialise certaines valeurs">
  10. <!-- Create the time stamp -->
  11. <tstamp />
  12. <mkdir dir="${build}" />
  13. <mkdir dir="${testreports}" />
  14. </target>
  15. <path id="webapp-path">
  16. <pathelement location="${build}" />
  17. <fileset dir="${JEELIB}">
  18. <include name="*.jar" />
  19. </fileset>
  20. <fileset dir="WebContent/WEB-INF/lib">
  21. <include name="*.jar" />
  22. </fileset>
  23. </path>
  24. <target name="clean" description="Efface tous les fichiers generes">
  25. <!-- Delete directory trees -->
  26. <delete dir="${build}" />
  27. <delete dir="${testreports}" />
  28. <delete dir="${target}" />
  29. </target>
  30. <target name="war" description="construction d'un war à partir d'un projet web eclipse" depends="clean,prepare">
  31. <javac includeantruntime="true" srcdir="src" destdir="${build}" source="${project.java.version}" debug="true" encoding="${encoding}">
  32. <classpath refid="webapp-path" />
  33. </javac>
  34. <mkdir dir="currentwar" />
  35. <copy todir="currentwar">
  36. <fileset dir="WebContent">
  37. </fileset>
  38. </copy>
  39. <mkdir dir="currentwar/WEB-INF/classes" />
  40. <copy todir="currentwar/WEB-INF/classes">
  41. <fileset dir="${build}" />
  42. <fileset dir="${src}">
  43. <include name="**/*.properties" />
  44. <include name="**/*.xml" />
  45. </fileset>
  46. </copy>
  47. <jar destfile="microfolielens.war" basedir="currentwar" />
  48. <delete dir="currentwar" />
  49. </target>
  50. </project>