stephenh 2002/08/21 10:33:14
Modified: src/conf default.properties build-torque.xml
Log:
Added a torque.runOnlyOnSchemaChange property, defaulted to false, that when true
will only run the om and sql targets if the schema has changed since their last
generation.
Revision Changes Path
1.7 +1 -1 jakarta-turbine-torque/src/conf/default.properties
Index: default.properties
===================================================================
RCS file: /home/cvs/jakarta-turbine-torque/src/conf/default.properties,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- default.properties 30 Jul 2002 15:01:16 -0000 1.6
+++ default.properties 21 Aug 2002 17:33:14 -0000 1.7
@@ -31,7 +31,7 @@
torque.project = ${project}
torque.database = ${database}
torque.targetPackage = ${targetPackage}
-
+torque.runOnlyOnSchemaChange = false
# -------------------------------------------------------------------
#
1.50 +39 -3 jakarta-turbine-torque/src/conf/build-torque.xml
Index: build-torque.xml
===================================================================
RCS file: /home/cvs/jakarta-turbine-torque/src/conf/build-torque.xml,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -r1.49 -r1.50
--- build-torque.xml 16 Aug 2002 09:06:48 -0000 1.49
+++ build-torque.xml 21 Aug 2002 17:33:14 -0000 1.50
@@ -124,7 +124,6 @@
<antcall target="om"/>
</target>
-
<!-- ================================================================ -->
<!-- C H E C K U S E C L A S S P A T H -->
<!-- ================================================================ -->
@@ -139,6 +138,19 @@
</target>
<!-- ================================================================ -->
+ <!-- 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 -->
+ <!-- ================================================================ -->
+ <!-- Maps the torque.runOnlyOnSchemaChange to -->
+ <!-- torque.internal.runOnlyOnSchemaChange -->
+ <!-- ================================================================ -->
+
+ <target name="check-run-only-on-schema-change">
+ <condition property="torque.internal.runOnlyOnSchemaChange">
+ <equals arg1="${torque.runOnlyOnSchemaChange}" arg2="true"/>
+ </condition>
+ </target>
+
+ <!-- ================================================================ -->
<!-- G E N E R A T E P R O J E C T S Q L -->
<!-- ================================================================ -->
<!-- Generate the SQL for your project, These are in addition -->
@@ -146,9 +158,21 @@
<!-- project should be specified in project-schema.xml. -->
<!-- ================================================================ -->
+ <target
+ name="sql-check"
+ depends="check-run-only-on-schema-change"
+ if="torque.internal.runOnlyOnSchemaChange">
+ <uptodate
+ property="torque.internal.sql.uptodate"
+ targetfile="${torque.sql.dir}/${torque.project}-schema.sql">
+ <srcfiles dir="${torque.schema.dir}" includes="**/*-schema.xml" />
+ </uptodate>
+ </target>
+
<target
name="sql"
- depends="check-use-classpath"
+ depends="check-use-classpath, sql-check"
+ unless="torque.internal.sql.uptodate"
description="==> generates the SQL for your project">
<echo message="+------------------------------------------+"/>
@@ -455,8 +479,20 @@
<!-- ================================================================ -->
<target
+ name="om-check"
+ depends="check-run-only-on-schema-change"
+ if="torque.internal.runOnlyOnSchemaChange">
+ <uptodate
+ property="torque.internal.om.uptodate"
+ targetfile="${torque.java.dir}/report.${torque.project}.om.generation">
+ <srcfiles dir="${torque.schema.dir}" includes="**/*-schema.xml" />
+ </uptodate>
+ </target>
+
+ <target
name="om"
- depends="check-use-classpath"
+ depends="check-use-classpath, om-check"
+ unless="torque.internal.om.uptodate"
description="==> generates the Peer-based object model for your project">
<echo message="+------------------------------------------+"/>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>