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

patch.xml 2.5 kB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <?xml version="1.0"?>
  2. <!--
  3. =======================================================================
  4. Use Apache Ant to generate a patch file for Apache Ant.
  5. Copyright (c) 2003 The Apache Software Foundation. All rights
  6. reserved.
  7. =======================================================================
  8. -->
  9. <project name="create-patch" default="patchpackage" basedir=".">
  10. <property environment="env"/>
  11. <property name="patch.package" value="patch.tar.gz"/>
  12. <property name="patch.file" value="patch.txt"/>
  13. <condition property="svn.found">
  14. <or>
  15. <available file="svn" filepath="${env.PATH}"/>
  16. <available file="svn.exe" filepath="${env.PATH}"/>
  17. <available file="svn.exe" filepath="${env.Path}"/>
  18. </or>
  19. </condition>
  20. <target name="createpatch">
  21. <fail unless="svn.found"
  22. message="You need a version of svn to create the patch"/>
  23. <exec executable="svn" output="${patch.file}">
  24. <arg value="diff"/>
  25. </exec>
  26. </target>
  27. <target name="newfiles" depends="createpatch">
  28. <delete file="${patch.package}"/>
  29. <exec executable="svn" output="${patch.file}.tmp">
  30. <arg value="status"/>
  31. </exec>
  32. <replace file="${patch.file}.tmp" token="? " value=""/>
  33. <tstamp>
  34. <format property="year" pattern="yyyy"/>
  35. </tstamp>
  36. <fileset dir="${basedir}"
  37. includesfile="${patch.file}.tmp"
  38. excludes="${patch.file}.tmp,${patch.file}"
  39. id="no.copyright.set">
  40. <not>
  41. <and>
  42. <contains text="Copyright"/>
  43. <contains text="Apache Software Foundation"/>
  44. <contains text="${year}"/>
  45. </and>
  46. </not>
  47. </fileset>
  48. <pathconvert pathsep="${line.separator}"
  49. setonempty="false"
  50. property="no.copyright"
  51. refid="no.copyright.set"/>
  52. <fail if="no.copyright"
  53. message="Please assign the Apache Ant Copyright (for ${year}) to these files and retry:${line.separator}${no.copyright}"/>
  54. </target>
  55. <target name="patchpackage" depends="newfiles">
  56. <tar basedir="${basedir}"
  57. tarfile="${patch.package}"
  58. compression="gzip"
  59. includesfile="${patch.file}.tmp"
  60. excludes="${patch.file}.tmp"/>
  61. <delete file="${patch.file}.tmp"/>
  62. </target>
  63. </project>