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

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