[ Index ] |
|
Code source de Symfony 1.0.0 |
1 <project name="propel" default="main" basedir="."> 2 3 <!-- 4 Note - You should not have to edit this file. 5 6 Instead, if calling build-propel.xml directly, edit the build.properties 7 that is in the same directory. If calling build-propel.xml via another 8 build file, you can also use the build.properties in the same directory, 9 or set the property propel.contextProperties to the file 10 to use in place of build.properties (e.g. project.properties). 11 --> 12 13 <property name="build.properties" value="build.properties"/> 14 <property name="propel.contextProperties" value="./$build.properties}"/> 15 <property name="propel.home" value="."/> 16 <property file="$propel.home}/build.properties"/> 17 18 <!-- 19 The default.properties file will map old properties to the new ones along 20 with setting the corret defaults. 21 --> 22 <property file="$propel.home}/default.properties"/> 23 24 <!-- 25 Do forward declarations of all of our tasks to 26 centralize them and clean up the targets. 27 --> 28 29 <path id="propelclasses"> 30 <pathelement dir="$propel.home}/classes/"/> 31 </path> 32 33 <taskdef 34 name="propel-data-model" 35 classname="propel.phing.PropelDataModelTask" classpathRef="propelclasses"/> 36 <taskdef 37 name="propel-old-om" 38 classname="propel.phing.PropelOldOMTask" classpathRef="propelclasses"/> 39 <taskdef 40 name="propel-om" 41 classname="propel.phing.PropelOMTask" classpathRef="propelclasses"/> 42 <taskdef 43 name="propel-data-dtd" 44 classname="propel.phing.PropelDataDTDTask" classpathRef="propelclasses"/> 45 <taskdef 46 name="propel-data-dump" 47 classname="propel.phing.PropelDataDumpTask" classpathRef="propelclasses"/> 48 <taskdef 49 name="propel-data-sql" 50 classname="propel.phing.PropelDataSQLTask" classpathRef="propelclasses"/> 51 <taskdef 52 name="propel-creole-transform" 53 classname="propel.phing.PropelCreoleTransformTask" classpathRef="propelclasses"/> 54 <taskdef 55 name="propel-sql" 56 classname="propel.phing.PropelSQLTask" classpathRef="propelclasses"/> 57 <taskdef 58 name="propel-old-sql" 59 classname="propel.phing.PropelOldSQLTask" classpathRef="propelclasses"/> 60 <taskdef 61 name="propel-sql-exec" 62 classname="propel.phing.PropelSQLExec" classpathRef="propelclasses"/> 63 <taskdef 64 name="propel-graphviz" 65 classname="propel.phing.PropelGraphvizTask" classpathRef="propelclasses"/> 66 67 68 <!-- ================================================================ --> 69 <!-- M A I N T A R G E T --> 70 <!-- ================================================================ --> 71 <!-- This default target will run all the targets that generate --> 72 <!-- source. You will probably only run this target once then --> 73 <!-- call individual targets as necessary to update your sources --> 74 <!-- when you change your XML schema. --> 75 <!-- ================================================================ --> 76 77 <target 78 name="main" 79 description="==> generates sql + om classes"> 80 81 <phingcall target="sql"/> 82 <phingcall target="om"/> 83 <phingcall target="convert-props"/> 84 </target> 85 86 <target 87 name="old-build" 88 description="==> generates sql + [new] om classes"> 89 90 <phingcall target="sql"/> 91 <phingcall target="old-om"/> 92 <phingcall target="convert-props"/> 93 </target> 94 95 <!-- ================================================================ --> 96 <!-- C H E C K R U N O N L Y O N S C H E M A C H A N G E --> 97 <!-- ================================================================ --> 98 <!-- Maps the propel.runOnlyOnSchemaChange to --> 99 <!-- propel.internal.runOnlyOnSchemaChange --> 100 <!-- ================================================================ --> 101 102 <target name="check-run-only-on-schema-change"> 103 <condition property="propel.internal.runOnlyOnSchemaChange"> 104 <equals arg1="$propel.runOnlyOnSchemaChange}" arg2="true"/> 105 </condition> 106 </target> 107 108 <!-- ================================================================ --> 109 <!-- G E N E R A T E P R O J E C T S Q L --> 110 <!-- ================================================================ --> 111 <!-- Generate the SQL for your project, These are in addition --> 112 <!-- to the base Turbine tables! The tables you require for your --> 113 <!-- project should be specified in project-schema.xml. --> 114 <!-- ================================================================ --> 115 116 <target 117 name="sql-check" 118 depends="check-run-only-on-schema-change" 119 if="propel.internal.runOnlyOnSchemaChange"> 120 <uptodate 121 property="propel.internal.sql.uptodate" 122 targetfile="$propel.sql.dir}/$propel.schema.default.basename}.sql"> 123 <srcfiles dir="$propel.schema.dir}" includes="**/$propel.schema.default.basename}.xml" /> 124 </uptodate> 125 </target> 126 127 <target 128 name="sql" 129 depends="sql-check" 130 unless="propel.internal.sql.uptodate" 131 description="==> generates the SQL for your project"> 132 133 <echo message="+------------------------------------------+"/> 134 <echo message="| |"/> 135 <echo message="| Generating SQL for YOUR Propel project! |"/> 136 <echo message="| |"/> 137 <echo message="+------------------------------------------+"/> 138 139 <phingcall target="sql-template"/> 140 141 </target> 142 143 <target name="sql-template"> 144 <propel-sql 145 validate="$propel.schema.validate}" 146 xsd="$propel.schema.xsd.file}" 147 xsl="$propel.schema.xsl.file}" 148 outputDirectory="$propel.sql.dir}" 149 sqldbmap="$propel.sql.dir}/sqldb.map" 150 targetDatabase="$propel.database}" 151 templatePath="$propel.templatePath}" 152 packageObjectModel="$propel.packageObjectModel}" 153 > 154 <mapper type="glob" from="$propel.sql.mapper.from}" to="$propel.sql.mapper.to}"/> 155 <schemafileset dir="$propel.schema.dir}" 156 includes="$propel.schema.sql.includes}" 157 excludes="$propel.schema.sql.excludes}" 158 /> 159 </propel-sql> 160 </target> 161 162 163 <target 164 name="old-sql" 165 depends="sql-check" 166 unless="propel.internal.sql.uptodate" 167 description="==> generates the SQL for your project"> 168 169 <echo message="+------------------------------------------+"/> 170 <echo message="| |"/> 171 <echo message="| Generating SQL for YOUR Propel project! |"/> 172 <echo message="| (using deprecated legacy SQL template) |"/> 173 <echo message="| |"/> 174 <echo message="+------------------------------------------+"/> 175 176 <phingcall target="old-sql-template"/> 177 178 </target> 179 180 <target name="old-sql-template"> 181 <propel-old-sql 182 validate="$propel.schema.validate}" 183 xsd="$propel.schema.xsd.file}" 184 xsl="$propel.schema.xsl.file}" 185 outputDirectory="$propel.sql.dir}" 186 sqldbmap="$propel.sql.dir}/sqldb.map" 187 targetDatabase="$propel.database}" 188 templatePath="$propel.templatePath}" 189 packageObjectModel="$propel.packageObjectModel}" 190 > 191 <mapper type="glob" from="$propel.sql.mapper.from}" to="$propel.sql.mapper.to}"/> 192 <schemafileset dir="$propel.schema.dir}" 193 includes="$propel.schema.sql.includes}" 194 excludes="$propel.schema.sql.excludes}" 195 /> 196 </propel-old-sql> 197 </target> 198 199 <!-- ================================================================ --> 200 <!-- C R E A T E T A R G E T D A T A B A S E --> 201 <!-- ================================================================ --> 202 <!-- Create the target database by executing a generated script --> 203 <!-- that is capable of performing the task. --> 204 <!-- ================================================================ --> 205 206 <target name="create-db-check"> 207 <condition property="propel.internal.manualCreation"> 208 <equals arg1="$propel.database.manualCreation}" arg2="true"/> 209 </condition> 210 </target> 211 212 <target 213 name="create-db" 214 unless="propel.internal.manualCreation" 215 depends="create-db-check" 216 description="==> generates the target database"> 217 218 <propel-data-model 219 validate="$propel.schema.validate}" 220 xsd="$propel.schema.xsd.file}" 221 xsl="$propel.schema.xsl.file}" 222 controlTemplate="$propel.template.sqlDbInit}" 223 outputDirectory="$propel.sql.dir}" 224 outputFile="create-db.sql" 225 targetDatabase="$propel.database}" 226 dbEncoding="$propel.database.encoding}" 227 templatePath="$propel.templatePath}" 228 packageObjectModel="$propel.packageObjectModel}" 229 > 230 <schemafileset dir="$propel.schema.dir}" 231 includes="$propel.schema.create-db.includes}" 232 excludes="$propel.schema.create-db.excludes}" 233 /> 234 </propel-data-model> 235 236 <echo message="Executing the create-db.sql script ..."/> 237 238 <sql 239 autocommit="true" 240 driver="$propel.database.driver}" 241 onerror="continue" 242 src="$propel.sql.dir}/create-db.sql" 243 url="$propel.database.createUrl}" 244 /> 245 </target> 246 247 <!-- ================================================================ --> 248 <!-- I N S E R T S I N G L E S Q L F I L E S --> 249 <!-- ================================================================ --> 250 251 <target 252 name="insert-sql" 253 description="==> inserts the generated sql "> 254 255 <propel-sql-exec 256 autocommit="true" 257 driver="$propel.database.driver}" 258 onerror="continue" 259 sqldbmap="$propel.sql.dir}/sqldb.map" 260 srcDir="$propel.sql.dir}" 261 url="$propel.database.buildUrl}" 262 /> 263 </target> 264 265 <!-- ================================================================ --> 266 <!-- C R E O L E TO X M L --> 267 <!-- ================================================================ --> 268 269 <target 270 name="creole" 271 description="==> generate xml schema from Creole metadata"> 272 273 <echo message="+-----------------------------------------------+"/> 274 <echo message="| |"/> 275 <echo message="| Generating XML from Creole connection ! |"/> 276 <echo message="| |"/> 277 <echo message="+-----------------------------------------------+"/> 278 279 <propel-creole-transform 280 dbDriver="$propel.database.driver}" 281 dbSchema="$propel.database.schema}" 282 dbEncoding="$propel.database.encoding}" 283 dbUrl="$propel.database.url}" 284 outputFile="$propel.schema.dir}/$propel.default.schema.basename}.xml" 285 samePhpName="$propel.samePhpName}" 286 addVendorInfo="$propel.addVendorInfo}" 287 addValidators="$propel.addValidators}" 288 /> 289 </target> 290 291 <!-- ================================================================ --> 292 <!-- Generate SQL from XML data file --> 293 <!-- ================================================================ --> 294 295 <target 296 name="datasql" 297 description="==> generates sql from data xml"> 298 299 <echo message="+-----------------------------------------------+"/> 300 <echo message="| |"/> 301 <echo message="| Generating SQL from data XML ! |"/> 302 <echo message="| |"/> 303 <echo message="+-----------------------------------------------+"/> 304 305 <propel-data-sql 306 validate="$propel.schema.validate}" 307 xsd="$propel.schema.xsd.file}" 308 xsl="$propel.schema.xsl.file}" 309 outputDirectory="$propel.sql.dir}" 310 sqldbmap="$propel.sql.dir}/sqldb.map" 311 dbEncoding="$propel.database.encoding}" 312 targetDatabase="$propel.database}" 313 templatePath="$propel.templatePath}" 314 datadbmap="$propel.schema.dir}/datadb.map" 315 srcDir="$propel.schema.dir}" 316 > 317 <mapper type="glob" from="$propel.datasql.mapper.from}" to="$propel.datasql.mapper.to}"/> 318 <schemafileset dir="$propel.schema.dir}" 319 includes="$propel.schema.datadtd.includes}" 320 excludes="$propel.schema.datadtd.excludes}" 321 /> 322 </propel-data-sql> 323 </target> 324 325 <!-- ================================================================ --> 326 <!-- Dump data from database into xml file --> 327 <!-- ================================================================ --> 328 329 <target 330 name="datadump" 331 description="==> dump data from database into xml file"> 332 333 <echo message="+-----------------------------------------------+"/> 334 <echo message="| |"/> 335 <echo message="| Dumping the data from database into XML |"/> 336 <echo message="| |"/> 337 <echo message="+-----------------------------------------------+"/> 338 339 <propel-data-dump 340 validate="$propel.schema.validate}" 341 xsd="$propel.schema.xsd.file}" 342 xsl="$propel.schema.xsl.file}" 343 targetDatabase="$propel.database}" 344 datadbmap="$propel.schema.dir}/datadb.map" 345 databaseDriver="$propel.database.driver}" 346 dbEncoding="$propel.database.encoding}" 347 databaseUrl="$propel.database.url}" 348 outputDirectory="$propel.schema.dir}" 349 templatePath="$propel.templatePath}"> 350 <mapper type="glob" from="$propel.datadump.mapper.from}" to="$propel.datadump.mapper.to}"/> 351 <schemafileset dir="$propel.schema.dir}" 352 includes="$propel.schema.datadtd.includes}" 353 excludes="$propel.schema.datadtd.excludes}" 354 /> 355 </propel-data-dump> 356 </target> 357 358 <!-- ================================================================ --> 359 <!-- G E N E R A T E P R O J E C T D A T A D T D --> 360 <!-- ================================================================ --> 361 <!-- Generate the DATA DTD for your project --> 362 <!-- ================================================================ --> 363 364 <target 365 name="datadtd" 366 description="==> generates the DATA DTD for your project"> 367 368 <echo message="+-----------------------------------------------+"/> 369 <echo message="| |"/> 370 <echo message="| Generating Data DTD for YOUR Propel project! |"/> 371 <echo message="| |"/> 372 <echo message="+-----------------------------------------------+"/> 373 374 <propel-data-dtd 375 validate="$propel.schema.validate}" 376 xsd="$propel.schema.xsd.file}" 377 xsl="$propel.schema.xsl.file}" 378 targetDatabase="$propel.database}" 379 outputDirectory="$propel.output.dir}" 380 templatePath="$propel.templatePath}"> 381 <!-- TODO: add properties for the mapper type, from, and to --> 382 <mapper type="glob" from="$propel.datadtd.mapper.from}" to="$propel.datadtd.mapper.to}"/> 383 <schemafileset dir="$propel.schema.dir}" 384 includes="$propel.schema.datadtd.includes}" 385 excludes="$propel.schema.datadtd.excludes}" 386 /> 387 </propel-data-dtd> 388 </target> 389 390 <!-- ================================================================ --> 391 <!-- G E N E R A T E P R O J E C T P E E R B A S E D O M --> 392 <!-- ================================================================ --> 393 <!-- Generate the Peer-based object model for your project. --> 394 <!-- These are in addition to the base Propel OM! --> 395 <!-- ================================================================ --> 396 397 <target 398 name="om-check" 399 depends="check-run-only-on-schema-change" 400 if="propel.internal.runOnlyOnSchemaChange"> 401 <uptodate 402 property="propel.internal.om.uptodate" 403 targetfile="$propel.php.dir}/report.$propel.project}.om.generation"> 404 <srcfiles dir="$propel.schema.dir}" includes="**/$propel.schema.om.includes}.xml" /> 405 </uptodate> 406 </target> 407 408 <target 409 name="om" 410 depends="om-check" 411 unless="propel.internal.om.uptodate" 412 description="==> generates the Peer-based object model for your project"> 413 414 <echo message="+------------------------------------------+"/> 415 <echo message="| |"/> 416 <echo message="| Generating Peer-based Object Model for |"/> 417 <echo message="| YOUR Propel project! (NEW OM BUILDERS)! |"/> 418 <echo message="| |"/> 419 <echo message="+------------------------------------------+"/> 420 421 <phingcall target="om-template"/> 422 <!--<phingcall target="om-tar"/>--> 423 </target> 424 425 <target name="om-template"> 426 <propel-om 427 validate="$propel.schema.validate}" 428 xsd="$propel.schema.xsd.file}" 429 xsl="$propel.schema.xsl.file}" 430 outputDirectory="$propel.php.dir}" 431 targetDatabase="$propel.database}" 432 targetPackage="$propel.targetPackage}" 433 templatePath="$propel.templatePath}" 434 targetPlatform="$propel.targetPlatform}" 435 packageObjectModel="$propel.packageObjectModel}" 436 > 437 <schemafileset dir="$propel.schema.dir}" 438 includes="$propel.schema.om.includes}" 439 excludes="$propel.schema.om.excludes}" 440 /> 441 </propel-om> 442 </target> 443 444 <!-- the new OM tasks --> 445 446 <target 447 name="old-om" 448 depends="om-check" 449 unless="propel.internal.om.uptodate" 450 description="==> generates the OLD Peer-based object model for your project"> 451 452 <echo message="+------------------------------------------+"/> 453 <echo message="| |"/> 454 <echo message="| Generating Peer-based Object Model for |"/> 455 <echo message="| YOUR Propel project (OLD OM TEMPLATES). |"/> 456 <echo message="| |"/> 457 <echo message="+------------------------------------------+"/> 458 459 <phingcall target="old-om-template"/> 460 <!--<phingcall target="om-tar"/>--> 461 </target> 462 463 <target name="old-om-template"> 464 <propel-old-om 465 validate="$propel.schema.validate}" 466 xsd="$propel.schema.xsd.file}" 467 xsl="$propel.schema.xsl.file}" 468 outputDirectory="$propel.php.dir}" 469 targetDatabase="$propel.database}" 470 targetPackage="$propel.targetPackage}" 471 templatePath="$propel.templatePath}" 472 targetPlatform="$propel.targetPlatform}"> 473 <schemafileset dir="$propel.schema.dir}" 474 includes="$propel.schema.om.includes}" 475 excludes="$propel.schema.om.excludes}" 476 /> 477 </propel-old-om> 478 </target> 479 480 481 <!-- ================================================================== --> 482 <!-- P R O P S T O P H P A R R A Y --> 483 <!-- ================================================================== --> 484 485 <target 486 name="convert-props" 487 description="==> converts properties file to PHP array"> 488 489 <echo message="+------------------------------------------+"/> 490 <echo message="| |"/> 491 <echo message="| Converting project properties file to an |"/> 492 <echo message="| array dump for run-time performance. |"/> 493 <echo message="| |"/> 494 <echo message="+------------------------------------------+"/> 495 496 <capsule 497 templatePath="$propel.templatePath}" 498 controlTemplate="$propel.template.conf}" 499 outputDirectory="$propel.phpconf.dir}" 500 outputFile="$propel.runtime.phpconf.file}"> 501 <assign name="propertiesFile" value="$propel.conf.dir}/$propel.runtime.conf.file}"/> 502 </capsule> 503 504 </target> 505 506 <target 507 name="graphviz" 508 depends="sql-check" 509 description="==> generates Graphviz file for your project"> 510 511 <echo message="+------------------------------------------+"/> 512 <echo message="| |"/> 513 <echo message="| Generating Graphiz for YOUR Propel |"/> 514 <echo message="| project! |"/> 515 <echo message="| |"/> 516 <echo message="+------------------------------------------+"/> 517 518 <propel-graphviz 519 outputDirectory="$propel.graph.dir}" 520 targetDatabase="$propel.database}" 521 sqldbmap="$propel.sql.dir}/sqldb.map" 522 packageObjectModel="$propel.packageObjectModel}"> 523 <mapper type="glob" from="$propel.sql.mapper.from}" to="$propel.sql.mapper.to}"/> 524 <schemafileset dir="$propel.schema.dir}" 525 includes="$propel.schema.sql.includes}" 526 excludes="$propel.schema.sql.excludes}" 527 /> 528 </propel-graphviz> 529 </target> 530 531 532 </project>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Fri Mar 16 22:42:14 2007 | par Balluche grâce à PHPXref 0.7 |