2
0

build.xml 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <project name="BeanShell Engine" default="build" basedir=".">
  3. <description>
  4. This script will build the BeanShell Engine lib.
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 3, or (at your option)
  8. any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program; if not, write to the Free Software
  15. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  16. 02111-1307, USA.
  17. http://www.gnu.org/copyleft/gpl.html
  18. </description>
  19. <property name="src" location="src" />
  20. <property name="lib" location="lib" />
  21. <property name="build" location="build" />
  22. <property name="build.classes" location="${build}/classes" />
  23. <property name="build.dist" location="${build}/dist" />
  24. <path id="classpath">
  25. <fileset dir="${lib}">
  26. <include name="*.jar" />
  27. </fileset>
  28. </path>
  29. <pathconvert property="manifest.libs" pathsep=" ">
  30. <path refid="classpath" />
  31. <mapper>
  32. <chainedmapper>
  33. <flattenmapper />
  34. <globmapper from="*.jar" to="*.jar" />
  35. </chainedmapper>
  36. </mapper>
  37. </pathconvert>
  38. <target name="init" depends="clean,checkRequirements,getChangelogDateVersion" description="Create the output directories.">
  39. <mkdir dir="${build}" />
  40. <mkdir dir="${build.classes}" />
  41. </target>
  42. <target name="compile" depends="init" description="Compile the source.">
  43. <javac srcdir="${src}" classpathref="classpath" destdir="${build.classes}" compiler="javac1.7" createMissingPackageInfoClass="false" debug="true" debuglevel="lines,vars,source" includeantruntime="false" source="1.7" target="1.7" />
  44. <copy todir="${build.classes}/META-INF/services">
  45. <fileset dir="${src}/META-INF/services" />
  46. </copy>
  47. </target>
  48. <target name="jar" depends="compile" description="Create the jar file.">
  49. <jar destfile="${build.dist}/bsh-engine-2.0b5.jar" level="9">
  50. <fileset dir="${build.classes}" />
  51. <manifest>
  52. <attribute name="Built-By" value="${user.name}" />
  53. <attribute name="Built-Date" value="${build.tstamp}" />
  54. <attribute name="Class-Path" value="${manifest.libs}" />
  55. <attribute name="Implementation-URL" value="http://www.l2jserver.com/" />
  56. <attribute name="Implementation-Version" value="${l2j.version}" />
  57. </manifest>
  58. </jar>
  59. </target>
  60. <target name="dist" depends="jar">
  61. <concat destfile="${build.dist}/bsh-engine_CHANGELOG.txt">${l2j.changelog}</concat>
  62. </target>
  63. <target name="build" depends="dist" description="Generates a zip with the BeanShell Engine.">
  64. <zip destfile="${build}/bsh-engine.zip" basedir="${build.dist}" level="9" />
  65. </target>
  66. <target name="clean" description="Remove the output directories.">
  67. <delete dir="${build}" />
  68. </target>
  69. <target name="checkRequirements" description="Check Requirements">
  70. <fail message="Ant 1.8.3 is required. But your version is ${ant.version} and if you are using Eclipse probably is outdated.">
  71. <condition>
  72. <not>
  73. <antversion atleast="1.8.3" />
  74. </not>
  75. </condition>
  76. </fail>
  77. <available classname="java.lang.AutoCloseable" property="JDK7.present" />
  78. <fail unless="JDK7.present" message="Java 1.7 is required. But your version is Java ${ant.java.version} and probably JDK is not installed." />
  79. </target>
  80. <target name="getChangelogDateVersion" description="Get Changelog, Date, Version">
  81. <exec dir="${basedir}" executable="svn" outputproperty="l2j.changelog">
  82. <arg value="log" />
  83. <arg value="--stop-on-copy" />
  84. </exec>
  85. <tstamp>
  86. <format property="build.tstamp" pattern="dd/MM/yyyy HH:mm" />
  87. </tstamp>
  88. <exec dir="${basedir}" executable="svnversion" outputproperty="l2j.version" />
  89. </target>
  90. </project>