build.xml 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <project default="compile" basedir=".">
  2. <property name="src" location="src/main"/>
  3. <property name="data" location="src/main"/>
  4. <property name="lib" location="lib"/>
  5. <property name="build" location="build"/>
  6. <property name="jar" location="OpenRSC.jar"/>
  7. <property name="javac.source" value="1.8"/>
  8. <property name="javac.target" value="1.8"/>
  9. <tstamp>
  10. <format property="calculatedVersion"
  11. pattern="yyyyMMdd.HHmmss"
  12. timezone="GMT" />
  13. </tstamp>
  14. <target name="clean">
  15. <delete dir="${build}" />
  16. <delete file="${jar}" />
  17. </target>
  18. <target name="compile">
  19. <delete file="${jar}"/>
  20. <delete dir="${build}"/>
  21. <mkdir dir="${build}"/>
  22. <copy todir="${build}/data">
  23. <fileset dir="src/main/resources"/>
  24. </copy>
  25. <javac srcdir="${src}" destdir="${build}" debug="on" target="${javac.source}" source="${javac.target}"
  26. includeantruntime="false">
  27. <compilerarg line="-Xlint:deprecation"/>
  28. </javac>
  29. <jar basedir="${build}" destfile="${jar}">
  30. <manifest>
  31. <attribute name="Main-Class" value="launcher.Main"/>
  32. </manifest>
  33. </jar>
  34. </target>
  35. <target name="setversion">
  36. <replaceregexp
  37. file="${src}/java/launcher/Utils/Defaults.java"
  38. match="_CURRENT_VERSION = (.*)"
  39. replace="_CURRENT_VERSION = ${calculatedVersion};"
  40. byline="true"
  41. />
  42. <echo message="Replaced version number in Defaults.java with ${calculatedVersion}" />
  43. <echo message="Run ant dist now to compile." />
  44. </target>
  45. <target name="runclient">
  46. <java classname="launcher.Main" fork="true">
  47. <jvmarg line="-Xms312m -Dsun.java2d.opengl=true"/>
  48. <classpath>
  49. <pathelement path="${jar}/"/>
  50. </classpath>
  51. </java>
  52. </target>
  53. <target name="compile-and-run">
  54. <antcall target="compile"/>
  55. <antcall target="runclient"/>
  56. </target>
  57. </project>