Skip to content

Commit

Permalink
Automatic update
Browse files Browse the repository at this point in the history
  • Loading branch information
xosofox committed Feb 4, 2011
1 parent 7d96c6c commit eee5065
Show file tree
Hide file tree
Showing 126 changed files with 1,730 additions and 11,247 deletions.
222 changes: 55 additions & 167 deletions generator/build-propel.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,15 @@
<pathelement dir="${propel.project.dir}/"/>
</path>

<taskdef
name="propel-data-model"
classname="task.PropelDataModelTemplateTask" classpathRef="propelclasses"/>
<taskdef
name="propel-om"
classname="task.PropelOMTask" classpathRef="propelclasses"/>
<taskdef
name="propel-data-dtd"
classname="task.PropelDataDTDTask" classpathRef="propelclasses"/>
<taskdef
name="propel-data-dump"
classname="task.PropelDataDumpTask" classpathRef="propelclasses"/>
Expand All @@ -56,21 +62,6 @@
<taskdef
name="propel-sql"
classname="task.PropelSQLTask" classpathRef="propelclasses"/>
<taskdef
name="propel-sql-diff"
classname="task.PropelSQLDiffTask" classpathRef="propelclasses"/>
<taskdef
name="propel-migration-status"
classname="task.PropelMigrationStatusTask" classpathRef="propelclasses"/>
<taskdef
name="propel-migration-up"
classname="task.PropelMigrationUpTask" classpathRef="propelclasses"/>
<taskdef
name="propel-migration-down"
classname="task.PropelMigrationDownTask" classpathRef="propelclasses"/>
<taskdef
name="propel-migration"
classname="task.PropelMigrationTask" classpathRef="propelclasses"/>
<taskdef
name="propel-sql-exec"
classname="task.PropelSQLExec" classpathRef="propelclasses"/>
Expand Down Expand Up @@ -231,6 +222,23 @@
<fail message="create-db target temporarily disabled, while we replace creole components."/>

<!--
<propel-data-model
validate="${propel.schema.validate}"
xsd="${propel.schema.xsd.file}"
xsl="${propel.schema.xsl.file}"
controlTemplate="${propel.template.sqlDbInit}"
outputDirectory="${propel.sql.dir}"
outputFile="create-db.sql"
targetDatabase="${propel.database}"
dbEncoding="${propel.database.encoding}"
templatePath="${propel.templatePath}"
packageObjectModel="${propel.packageObjectModel}">
<schemafileset dir="${propel.schema.dir}"
includes="${propel.schema.create-db.includes}"
excludes="${propel.schema.create-db.excludes}"
/>
</propel-data-model>
<echo message="Executing the create-db.sql script ..."/>
<sql
Expand Down Expand Up @@ -291,140 +299,7 @@

</target>

<!-- ================================================================ -->
<!-- M I G R A T I O N T A S K S -->
<!-- ================================================================ -->

<target
name="sql-diff"
depends="sql-check,pgsql-quoting-check,mysqli-check"
unless="propel.internal.sql.uptodate"
description="==> generates a SQL diff for your project">

<echo message="+----------------------------------------------+"/>
<echo message="| |"/>
<echo message="| Generating SQL diff between the XML schemas |"/>
<echo message="| and the current database structure. |"/>
<echo message="| |"/>
<echo message="+----------------------------------------------+"/>

<phingcall target="sql-diff-template"/>
</target>

<target name="sql-diff-template">
<propel-sql-diff
validate="${propel.schema.validate}"
xsd="${propel.schema.xsd.file}"
xsl="${propel.schema.xsl.file}"
outputDirectory="${propel.migration.dir}"
targetDatabase="${propel.database}"
packageObjectModel="${propel.packageObjectModel}"
databaseName="${propel.project}"
url="${propel.database.url}"
userId="${propel.database.user}"
password="${propel.database.password}"
editorCmd="${propel.migration.editor}"
caseInsensitive="${propel.migration.caseInsensitive}">
<mapper type="glob" from="${propel.sql.mapper.from}" to="${propel.sql.mapper.to}"/>
<schemafileset dir="${propel.schema.dir}"
includes="${propel.schema.sql.includes}"
excludes="${propel.schema.sql.excludes}"
/>
</propel-sql-diff>
</target>

<target
name="migration-status"
depends="sql-check,pgsql-quoting-check,mysqli-check"
unless="propel.internal.sql.uptodate"
description="Lists the migrations left to be executed">

<echo message="+----------------------------------------------+"/>
<echo message="| |"/>
<echo message="| Look for Migration classes and lists |"/>
<echo message="| the ones not yet executed. |"/>
<echo message="| |"/>
<echo message="+----------------------------------------------+"/>

<phingcall target="migration-status-template"/>
</target>

<target name="migration-status-template">
<propel-migration-status
migrationTable="${propel.migration.table}"
outputDirectory="${propel.migration.dir}">
</propel-migration-status>
</target>

<target
name="migration-up"
depends="sql-check,pgsql-quoting-check,mysqli-check"
unless="propel.internal.sql.uptodate"
description="Execute the next migration">

<echo message="+----------------------------------------------+"/>
<echo message="| |"/>
<echo message="| Look for next Migration class |"/>
<echo message="| and execute it |"/>
<echo message="| |"/>
<echo message="+----------------------------------------------+"/>

<phingcall target="migration-up-template"/>
</target>

<target name="migration-up-template">
<propel-migration-up
migrationTable="${propel.migration.table}"
outputDirectory="${propel.migration.dir}">
</propel-migration-up>
</target>

<target
name="migration-down"
depends="sql-check,pgsql-quoting-check,mysqli-check"
unless="propel.internal.sql.uptodate"
description="Execute the next migration">

<echo message="+----------------------------------------------+"/>
<echo message="| |"/>
<echo message="| Look for previous Migration class |"/>
<echo message="| and execute it |"/>
<echo message="| |"/>
<echo message="+----------------------------------------------+"/>

<phingcall target="migration-down-template"/>
</target>

<target name="migration-down-template">
<propel-migration-down
migrationTable="${propel.migration.table}"
outputDirectory="${propel.migration.dir}">
</propel-migration-down>
</target>

<target
name="migration"
depends="sql-check,pgsql-quoting-check,mysqli-check"
unless="propel.internal.sql.uptodate"
description="Execute the next migration">

<echo message="+----------------------------------------------+"/>
<echo message="| |"/>
<echo message="| Look for next Migration class |"/>
<echo message="| and execute it |"/>
<echo message="| |"/>
<echo message="+----------------------------------------------+"/>

<phingcall target="migration-template"/>
</target>

<target name="migration-template">
<propel-migration
migrationTable="${propel.migration.table}"
outputDirectory="${propel.migration.dir}">
</propel-migration>
</target>

<!-- ================================================================ -->
<!-- Generate SQL from XML data file -->
<!-- ================================================================ -->
Expand Down Expand Up @@ -491,6 +366,38 @@
</propel-data-dump>
</target>

<!-- ================================================================ -->
<!-- G E N E R A T E P R O J E C T D A T A D T D -->
<!-- ================================================================ -->
<!-- Generate the DATA DTD for your project -->
<!-- ================================================================ -->

<target
name="datadtd"
description="==> generates the DATA DTD for your project">

<echo message="+-----------------------------------------------+"/>
<echo message="| |"/>
<echo message="| Generating Data DTD for YOUR Propel project! |"/>
<echo message="| |"/>
<echo message="+-----------------------------------------------+"/>

<propel-data-dtd
validate="${propel.schema.validate}"
xsd="${propel.schema.xsd.file}"
xsl="${propel.schema.xsl.file}"
targetDatabase="${propel.database}"
outputDirectory="${propel.output.dir}"
templatePath="${propel.templatePath}">
<!-- TODO: add properties for the mapper type, from, and to -->
<mapper type="glob" from="${propel.datadtd.mapper.from}" to="${propel.datadtd.mapper.to}"/>
<schemafileset dir="${propel.schema.dir}"
includes="${propel.schema.datadtd.includes}"
excludes="${propel.schema.datadtd.excludes}"
/>
</propel-data-dtd>
</target>

<!-- ================================================================ -->
<!-- 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 -->
<!-- ================================================================ -->
Expand Down Expand Up @@ -577,25 +484,6 @@

</target>

<target
name="dbd2propel"
description="==> generates a Propel XML schema from a DBDesigner 4 XML schema">

<echo message="+------------------------------------------+"/>
<echo message="| |"/>
<echo message="| Generating Propel XML Schema |"/>
<echo message="| Based on DB4Designer export |"/>
<echo message="| |"/>
<echo message="+------------------------------------------+"/>

<xslt todir="${propel.schema.dir}" style="${propel.dbd2propel.xsl.file}" >
<fileset dir="${propel.dbd2propel.dir}">
<include name="${propel.dbd2propel.includes}" />
</fileset>
<mapper type="regexp" from="^(.*)\.xml$" to="\1.schema.xml"/>
</xslt>
</target>

<target
name="graphviz"
depends="sql-check"
Expand Down
42 changes: 4 additions & 38 deletions generator/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,10 @@
<phing phingfile="build-propel.xml" target="reverse"/>
</target>

<target name="datadtd" depends="configure">
<phing phingfile="build-propel.xml" target="datadtd"/>
</target>

<target name="datadump" depends="configure">
<phing phingfile="build-propel.xml" target="datadump"/>
</target>
Expand All @@ -168,48 +172,10 @@
<phing phingfile="build-propel.xml" target="sql"/>
</target>

<target name="sql-diff" depends="configure">
<phing phingfile="build-propel.xml" target="sql-diff"/>
</target>

<target name="diff" depends="sql-diff" />

<target name="migration-status" depends="configure">
<phing phingfile="build-propel.xml" target="migration-status"/>
</target>

<target name="status" depends="migration-status" />

<target name="migration-up" depends="configure">
<phing phingfile="build-propel.xml" target="migration-up"/>
</target>

<target name="migrate-up" depends="migration-up" />

<target name="up" depends="migration-up" />

<target name="migration-down" depends="configure">
<phing phingfile="build-propel.xml" target="migration-down"/>
</target>

<target name="migrate-down" depends="migration-down" />

<target name="down" depends="migration-down" />

<target name="migration" depends="configure">
<phing phingfile="build-propel.xml" target="migration"/>
</target>

<target name="migrate" depends="migration" />

<target name="old-sql" depends="configure">
<phing phingfile="build-propel.xml" target="old-sql"/>
</target>

<target name="dbd2propel" depends="configure">
<phing phingfile="build-propel.xml" target="dbd2propel"/>
</target>

<target name="graphviz" depends="configure">
<phing phingfile="build-propel.xml" target="graphviz"/>
</target>
Expand Down
4 changes: 4 additions & 0 deletions generator/build.xml-local
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@
<phing phingfile="${propel.home}/build-propel.xml" target="creole"/>
</target>

<target name="datadtd" depends="configure">
<phing phingfile="${propel.home}/build-propel.xml" target="datadtd"/>
</target>

<target name="datadump" depends="configure">
<phing phingfile="${propel.home}/build-propel.xml" target="datadump"/>
</target>
Expand Down
Loading

0 comments on commit eee5065

Please sign in to comment.