You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

build-properties.xml 3.0KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <project name="DMDirc-properties" default="default" basedir=".">
  3. <description>Automatically initialises build properties</description>
  4. <condition property="private.properties.exists">
  5. <available file="nbproject/private/private.properties"/>
  6. </condition>
  7. <target name="-init-properties">
  8. <taskdef resource="net/sf/fikin/ant/ant.properties" classpathref="build-classpath"/>
  9. <taskdef resource="net/sf/antcontrib/antlib.xml" classpathref="build-classpath"/>
  10. </target>
  11. <target name="-create-private-properties" unless="private.properties.exists">
  12. <mkdir dir="nbproject/private"/>
  13. <echo file="nbproject/private/private.properties"/>
  14. </target>
  15. <target name="-check-private-classpath">
  16. <loadfile property="private.properties.old" srcFile="nbproject/private/private.properties"/>
  17. <condition property="private.properties.needs.javac">
  18. <not>
  19. <matches string="${private.properties.old}" pattern="^javac.classpath=(.*)$" multiline="true" casesensitive="true"/>
  20. </not>
  21. </condition>
  22. <condition property="private.properties.needs.javac.test">
  23. <not>
  24. <matches string="${private.properties.old}" pattern="^javac.test.classpath=(.*)$" multiline="true" casesensitive="true"/>
  25. </not>
  26. </condition>
  27. </target>
  28. <target name="-create-private-classpath" if="private.properties.needs.javac">
  29. <echo append="true" file="nbproject/private/private.properties">${line.separator}javac.classpath=${line.separator}</echo>
  30. </target>
  31. <target name="-create-private-test-classpath" if="private.properties.needs.javac.test">
  32. <echo append="true" file="nbproject/private/private.properties">${line.separator}javac.test.classpath=${line.separator}</echo>
  33. </target>
  34. <target name="-init-private-properties" depends="-init-properties,-create-private-properties,-check-private-classpath,-create-private-classpath,-create-private-test-classpath">
  35. <path id="main-libs">
  36. <fileset dir="modules" includes="*/lib/*.jar"/>
  37. <fileset dir="lib/main" includes="*.jar"/>
  38. </path>
  39. <path id="test-libs">
  40. <fileset dir="lib/test" includes="*.jar"/>
  41. </path>
  42. <propertyregex property="javac.classpath.value" input="${toString:all.libs}" regexp="\\" replace="/" global="true" defaultValue="${toString:main-libs}"/>
  43. <propertyregex property="javac.test.classpath.value" input="${toString:test.libs}" regexp="\\" replace="/" global="true" defaultValue="${toString:test-libs}"/>
  44. <replaceregexp file="nbproject/private/private.properties" match="^javac.classpath=(.*)$" flags="im" replace="javac.classpath=${javac.classpath.value}"/>
  45. <replaceregexp file="nbproject/private/private.properties" match="^javac.test.classpath=(.*)$" flags="im" replace="javac.test.classpath=${javac.test.classpath.value}:$${javac.classpath}:build/classes:modules/plugins/build/classes"/>
  46. </target>
  47. </project>