build-pear-package.xml 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. <?xml version="1.0"?>
  2. <!--
  3. This build file creates a minimal package of propel-runtime files,
  4. builds a package.xml for installation using PEAR and creates the necessary TGZ file.
  5. -->
  6. <project name="propel_runtime" default="main">
  7. <property name="propel.home" value=".."/>
  8. <property name="build.base.dir" value="build"/>
  9. <property name="pkgname" value="${phing.project.name}-${version}"/>
  10. <property name="build.src.dir" value="${build.base.dir}/${pkgname}"/>
  11. <!-- some default properties -->
  12. <property name="notes"><![CDATA[
  13. This is a release of the 1.5 branch of the Propel Generator.
  14. See http://bit.ly/dskpCk for CHANGELOG.
  15. ]]></property>
  16. <property name="state" value="stable"/>
  17. <taskdef
  18. name="pear-package"
  19. classname="BuildPropelPEARPackageTask" classpath="."/>
  20. <fileset dir="${propel.home}/lib" id="classes">
  21. <include name="**"/>
  22. </fileset>
  23. <!--
  24. ==============================================
  25. Main entry point
  26. ==============================================
  27. -->
  28. <target name="main" if="version" depends="versioncheck">
  29. <phingcall target="build"/>
  30. <phingcall target="pear-package"/>
  31. <phingcall target="tar"/>
  32. </target>
  33. <!--
  34. ===================================================================
  35. Target: checks if language was given, otherwise fail
  36. ===================================================================
  37. -->
  38. <target name="versioncheck" unless="version">
  39. <echo message="====================================================="/>
  40. <echo message="Version not specified. You must enter a version. In"/>
  41. <echo message="the future you can add this to build.properties or"/>
  42. <echo message="enter it on the command line: "/>
  43. <echo message=" "/>
  44. <echo message="-Dversion=1.0.0"/>
  45. <echo message="====================================================="/>
  46. <input propertyname="version" promptChar=":">Propel version for package</input>
  47. <property name="pkgname" value="${phing.project.name}-${version}" override="true"/>
  48. <property name="build.src.dir" value="${build.base.dir}/${pkgname}" override="true"/>
  49. </target>
  50. <!--
  51. ==============================================
  52. Copy the desired files into the build/ dir
  53. making sure to put them in the directory
  54. structure that will be needed for PEAR install
  55. ==============================================
  56. -->
  57. <target name="build">
  58. <echo>-----------------------------</echo>
  59. <echo>| Creating directory layout |</echo>
  60. <echo>-----------------------------</echo>
  61. <delete dir="${build.base.dir}"/>
  62. <mkdir dir="${build.base.dir}"/>
  63. <copy todir="${build.src.dir}">
  64. <fileset refid="classes"/>
  65. </copy>
  66. </target>
  67. <!--
  68. ==============================================
  69. Create a PEAR package.xml which will guide the
  70. installation.
  71. ==============================================
  72. -->
  73. <target name="pear-package">
  74. <echo>-----------------------------</echo>
  75. <echo>| Creating PEAR package.xml |</echo>
  76. <echo>-----------------------------</echo>
  77. <echo></echo>
  78. <pear-package dir="${build.src.dir}" destFile="${build.base.dir}/package.xml" version="${version}" state="${state}" notes="${notes}">
  79. <fileset dir="${build.src.dir}">
  80. <include name="**"/>
  81. </fileset>
  82. </pear-package>
  83. </target>
  84. <!--
  85. ==============================================
  86. Create a tar.gz of the files, which will be
  87. installed by pear package manager.
  88. ==============================================
  89. -->
  90. <target name="tar">
  91. <echo>-----------------------------</echo>
  92. <echo>| Creating tar.gz package |</echo>
  93. <echo>-----------------------------</echo>
  94. <property name="tarfile" value="${build.base.dir}/${pkgname}.tgz"/>
  95. <delete file="${tarfile}"/>
  96. <tar destFile="${tarfile}" basedir="${build.base.dir}" />
  97. </target>
  98. </project>