選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

build.xml 4.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!-- You may freely edit this file. See commented blocks below for -->
  3. <!-- some examples of how to customize the build. -->
  4. <!-- (If you delete it and reopen the project it will be recreated.) -->
  5. <project name="DMDirc" default="default" basedir=".">
  6. <description>Builds, tests, and runs the project DMDirc.</description>
  7. <import file="nbproject/build-impl.xml"/>
  8. <import file="BuildPlugins.xml"/>
  9. <!--
  10. There exist several targets which are by default empty and which can be
  11. used for execution of your tasks. These targets are usually executed
  12. before and after some main targets. They are:
  13. -pre-init: called before initialization of project properties
  14. -post-init: called after initialization of project properties
  15. -pre-compile: called before javac compilation
  16. -post-compile: called after javac compilation
  17. -pre-compile-single: called before javac compilation of single file
  18. -post-compile-single: called after javac compilation of single file
  19. -pre-compile-test: called before javac compilation of JUnit tests
  20. -post-compile-test: called after javac compilation of JUnit tests
  21. -pre-compile-test-single: called before javac compilation of single JUnit test
  22. -post-compile-test-single: called after javac compilation of single JUunit test
  23. -pre-jar: called before JAR building
  24. -post-jar: called after JAR building
  25. -post-clean: called after cleaning build products
  26. (Targets beginning with '-' are not intended to be called on their own.)
  27. Example of inserting an obfuscator after compilation could look like this:
  28. <target name="-post-compile">
  29. <obfuscate>
  30. <fileset dir="${build.classes.dir}"/>
  31. </obfuscate>
  32. </target>
  33. For list of available properties check the imported
  34. nbproject/build-impl.xml file.
  35. Another way to customize the build is by overriding existing main targets.
  36. The targets of interest are:
  37. -init-macrodef-javac: defines macro for javac compilation
  38. -init-macrodef-junit: defines macro for junit execution
  39. -init-macrodef-debug: defines macro for class debugging
  40. -init-macrodef-java: defines macro for class execution
  41. -do-jar-with-manifest: JAR building (if you are using a manifest)
  42. -do-jar-without-manifest: JAR building (if you are not using a manifest)
  43. run: execution of project
  44. -javadoc-build: Javadoc generation
  45. test-report: JUnit report generation
  46. An example of overriding the target for project execution could look like this:
  47. <target name="run" depends="DMDirc-impl.jar">
  48. <exec dir="bin" executable="launcher.exe">
  49. <arg file="${dist.jar}"/>
  50. </exec>
  51. </target>
  52. Notice that the overridden target depends on the jar target and not only on
  53. the compile target as the regular run target does. Again, for a list of available
  54. properties which you can use, check the target you are overriding in the
  55. nbproject/build-impl.xml file.
  56. <jar compress="${jar.compress}" jarfile="${build.classes.dir}/plugins/">
  57. <fileset dir="${build.classes.dir}"/>
  58. </jar>
  59. -->
  60. <target name="-post-compile" depends="build-plugins"/>
  61. <available file="/bin/bash" property="has.bash"/>
  62. <target name="installer" depends="installer-nobuild, installer-build"/>
  63. <target name="installer-build" if="has.bash">
  64. <exec executable="/bin/bash" dir="installer" resultproperty="installer.result">
  65. <arg value="release.sh"/>
  66. <arg value="this"/>
  67. </exec>
  68. <condition property="installer.success">
  69. <equals arg1="${installer.result}" arg2="0" />
  70. </condition>
  71. <echo message="Installer build finished."/>
  72. <echo message="Completed build files can be found in:"/>
  73. <echo message=" ${installer.output.dir}"/>
  74. <echo message=""/>
  75. </target>
  76. <target name="installer-nobuild" unless="has.bash">
  77. <echo message="This task only works on linux"/>
  78. </target>
  79. </project>