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.4 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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="cvs.found">
  14. <or>
  15. <available file="cvs" filepath="${env.PATH}"/>
  16. <available file="cvs.exe" filepath="${env.PATH}"/>
  17. <available file="cvs.exe" filepath="${env.Path}"/>
  18. </or>
  19. </condition>
  20. <target name="createpatch">
  21. <fail unless="cvs.found"
  22. message="You need a version of cvs to create the patch"/>
  23. <cvs command="-q diff -u" output="${patch.file}"/>
  24. </target>
  25. <target name="newfiles" depends="createpatch">
  26. <delete file="${patch.package}"/>
  27. <cvs command="-q diff -N" output="${patch.file}.tmp"/>
  28. <replace file="${patch.file}.tmp" token="? " value=""/>
  29. <tstamp>
  30. <format property="year" pattern="yyyy"/>
  31. </tstamp>
  32. <fileset dir="${basedir}"
  33. includesfile="${patch.file}.tmp"
  34. excludes="${patch.file}.tmp,${patch.file}"
  35. id="no.copyright.set">
  36. <not>
  37. <and>
  38. <contains text="Copyright"/>
  39. <contains text="Apache Software Foundation"/>
  40. <contains text="${year}"/>
  41. </and>
  42. </not>
  43. </fileset>
  44. <pathconvert pathsep="${line.separator}"
  45. setonempty="false"
  46. property="no.copyright"
  47. refid="no.copyright.set"/>
  48. <fail if="no.copyright"
  49. message="Please assign the Apache Ant Copyright (for ${year}) to these files and retry:${line.separator}${no.copyright}"/>
  50. </target>
  51. <target name="patchpackage" depends="newfiles">
  52. <tar basedir="${basedir}"
  53. tarfile="${patch.package}"
  54. compression="gzip"
  55. includesfile="${patch.file}.tmp"
  56. excludes="${patch.file}.tmp"/>
  57. <delete file="${patch.file}.tmp"/>
  58. </target>
  59. </project>