pear-build.xml 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. <!--
  2. Use this file to faciliate easy per-project building using
  3. PEAR-installed Propel-generator.
  4. This Phing script is invoked via the shell script propel-gen (.bat
  5. for Windows). Normally you should not need to edit this script or
  6. be aware of it in any way.
  7. Normal use:
  8. $> propel-gen insert-sql
  9. Specific target:
  10. $> propel-gen /path/to/my/project insert-sql
  11. -->
  12. <project name="propel-project-builder" default="main">
  13. <!-- set a default target if none provided -->
  14. <property name="target" value="main"/>
  15. <resolvepath propertyName="propel.project.dir" file="${project.dir}" dir="${application.startdir}"/>
  16. <target name="projdircheckExists">
  17. <condition property="projDirExists">
  18. <and>
  19. <not>
  20. <equals arg1="${propel.project.dir}" arg2="" trim="true"/>
  21. </not>
  22. <available file="${propel.project.dir}/build.properties"/>
  23. </and>
  24. </condition>
  25. </target>
  26. <target name="projdircheck" depends="projdircheckExists" unless="projDirExists">
  27. <echo message="====================================================="/>
  28. <echo message="Project directory not specified or invalid. You must "/>
  29. <echo message="specify the path to your project directory and your "/>
  30. <echo message="project directory must contain your build.properties "/>
  31. <echo message="and schema.xml files. "/>
  32. <echo message=" "/>
  33. <echo message="Usage: "/>
  34. <echo message=" "/>
  35. <echo message="$&gt; propel-gen /path/to/projectdir [target]"/>
  36. <echo message=" "/>
  37. <echo message="====================================================="/>
  38. <fail message="No project directory specified."/>
  39. </target>
  40. <target name="configure" depends="projdircheck">
  41. <if>
  42. <isset property="additional.properties"/>
  43. <then>
  44. <echo>Processing additional properties file: ${additional.properties}</echo>
  45. <resolvepath propertyName="additional.properties.resolved" file="${additional.properties}" dir="${application.startdir}"/>
  46. <property file="${additional.properties.resolved}"/>
  47. </then>
  48. </if>
  49. <echo msg="Loading project-specific props from ${project.dir}/build.properties"/>
  50. <property file="${propel.project.dir}/build.properties"/>
  51. </target>
  52. <target name="main" depends="configure"
  53. description="The main target. Includes project-specific build.properties and calls the build-propel.xml script">
  54. <!--<property file="${project.dir}/build.properties"/>-->
  55. <phing phingfile="build-propel.xml" target="${target}"/>
  56. </target>
  57. <!--
  58. Convenience mappings to build-propel.xml main targets
  59. This makes it possible to use this buildfile w/o needing to specify
  60. target as a property, e.g.:
  61. $> phing -Dproject=bookstore insert-sql
  62. The main reason for this is just consistency w/ old build-propel.xml file
  63. (primarily for documentation & user confusion avoidance reasons). There are relatively
  64. few & infrequently changing main targets of build-propel.xml, so it's a non-
  65. issue as far as maintenance is concerned.
  66. -->
  67. <target name="convert-conf" depends="configure">
  68. <phing phingfile="build-propel.xml" target="convert-conf"/>
  69. </target>
  70. <target name="create-db" depends="configure">
  71. <phing phingfile="build-propel.xml" target="create-db"/>
  72. </target>
  73. <target name="reverse" depends="configure">
  74. <phing phingfile="build-propel.xml" target="reverse"/>
  75. </target>
  76. <target name="datadtd" depends="configure">
  77. <phing phingfile="build-propel.xml" target="datadtd"/>
  78. </target>
  79. <target name="datadump" depends="configure">
  80. <phing phingfile="build-propel.xml" target="datadump"/>
  81. </target>
  82. <target name="datasql" depends="configure">
  83. <phing phingfile="build-propel.xml" target="datasql"/>
  84. </target>
  85. <target name="insert-sql" depends="configure">
  86. <phing phingfile="build-propel.xml" target="insert-sql"/>
  87. </target>
  88. <target name="om" depends="configure">
  89. <phing phingfile="build-propel.xml" target="om"/>
  90. </target>
  91. <target name="sql" depends="configure">
  92. <phing phingfile="build-propel.xml" target="sql"/>
  93. </target>
  94. </project>