build.xml 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. <project name="OpenAS2" default="main" basedir=".">
  2. <description>
  3. Open source implementation of the AS2 standard for signed
  4. encrypted and compressed document transfer
  5. </description>
  6. <property name="projectName" value="OpenAS2" />
  7. <property name="subProject" value="Server" />
  8. <!-- Java sources -->
  9. <property name="src.dir" location="${basedir}/src/main/java" />
  10. <property name="ant.build.javac.source" value="1.6" />
  11. <property name="ant.build.javac.target" value="1.6" />
  12. <!-- Java classes -->
  13. <property name="outputDirectory" location="${basedir}/target" />
  14. <property name="lib.dir" location="${basedir}/lib" />
  15. <property name="lib.jar" value="openas2-server.jar" />
  16. <property name="help.filename" value="OpenAS2HowTo.pdf" />
  17. <property name="help.file.src" location="../docs/${help.filename}" />
  18. <!-- Output, package -->
  19. <property name="dist.dir" location="dist" />
  20. <property name="release.version" value="2.2.0" />
  21. <property name="manifest.file" value="${src.dir}/META-INF/MANIFEST.MF" />
  22. <target name="init">
  23. <echo message="ANT Version: ${ant.version}" />
  24. <!-- Create the time stamp -->
  25. <tstamp>
  26. <format property="time.stamp" pattern="yyyy-MM-dd_HH:mm:ss" />
  27. </tstamp>
  28. <!-- Create the build directory structure used by compile -->
  29. <mkdir dir="${outputDirectory}" />
  30. <echo
  31. message="Current version number written to MANIFEST : ${release.version}" />
  32. </target>
  33. <target name="compile" depends="init" description="compile the source ">
  34. <!-- Compile the java code from ${src.dir} into ${outputDirectory} -->
  35. <delete file="${lib.dir}/${lib.jar}" />
  36. <path id="lib.path.ref">
  37. <fileset dir="${lib.dir}" includes="*.jar" />
  38. </path>
  39. <javac compiler="modern" includeantruntime="false" srcdir="${src.dir}"
  40. destdir="${outputDirectory}">
  41. <compilerarg value="-Xbootclasspath/p:${toString:lib.path.ref}" />
  42. </javac>
  43. </target>
  44. <target name="dist" depends="compile" description="package, output to JAR">
  45. <delete file="${lib.dir}/${lib.jar}" />
  46. <tstamp>
  47. <format property="time.stamp" pattern="yyyy-MM-dd_HH:mm:ss" />
  48. </tstamp>
  49. <jar jarfile="${lib.dir}/${lib.jar}" basedir="${outputDirectory}">
  50. <manifest>
  51. <!-- create an executable Jar -->
  52. <attribute name="Main-Class" value="org.openas2.app.OpenAS2Server" />
  53. <attribute name="Built-By" value="OpenAS2 Ant Build ${time.stamp}" />
  54. <attribute name="Specification-Title" value="${projectName}" />
  55. <attribute name="Specification-Version" value="1.1" />
  56. <attribute name="Specification-Vendor" value="${projectName}" />
  57. <attribute name="Implementation-Title" value="${projectName} ${subProject}" />
  58. <!-- get the correct release version number into the MANIFEST file as "Implementation-Version" -->
  59. <attribute name="Implementation-Version" value="${release.version}" />
  60. <attribute name="Implementation-Vendor" value="${projectName} - AS2 Open Source Project" />
  61. </manifest>
  62. </jar>
  63. <delete dir="${outputDirectory}" />
  64. <!-- Create the distribution directory -->
  65. <mkdir dir="${dist.dir}" />
  66. <!-- Add the help PDF version to the distro -->
  67. <copy file="${help.file.src}" todir="${basedir}" />
  68. <!-- Put everything in ${build} into the ${projectName}${subProject}-${release.version}.zip
  69. file -->
  70. <zip destfile="${dist.dir}/${projectName}${subProject}-${release.version}.zip"
  71. basedir="." excludes="build/**,dist/**,temp/**,logs/**,data/**" />
  72. <!-- Remove the copied help file -->
  73. <delete file="${help.filename}" />
  74. </target>
  75. <target name="clean" description="clean up">
  76. <delete dir="${outputDirectory}" />
  77. <delete dir="${dist.dir}" />
  78. </target>
  79. <!-- Default, run this -->
  80. <target name="main" depends="clean, compile, dist" />
  81. </project>