How about instead of going back to separate targets, change the torque
jar to include the templates in:

/templates/sql/base/Control.vm

instead of just:

/sql/base/Control.vm

So that templatePath stays the same regardless of whether they're on the
file system or in the jar.

Another thing I'd push for is that while changing where the templates
are in the jar, assuming it's done, put them in:

/org/apache/torque/templates

Then some conditional logic could be done in an init target to decide
whether the templatePath should be prepended with the /org/apache/torque
bit.

Granted, it's fairly unlikely some other jar would have a:

/templates/sql/base/Control.vm

that would conflict with torque's but I think putting resources in the
torque package, even if they aren't class files, is a good idea.

- Stephen

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, June 27, 2002 12:39 PM
> To: [EMAIL PROTECTED]
> Subject: cvs commit: jakarta-turbine-torque/src/conf build-torque.xml
> 
> mpoeschl    2002/06/27 10:38:58
> 
>   Modified:    src/conf build-torque.xml
>   Log:
>   fix om generation (useClasspath = true)
>   maybe we have to handle the other targets the same way .. at least
all targets
> where the properties files are loaded from the classpath :-(
> 
>   Revision  Changes    Path
>   1.36      +36 -1
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.35
>   retrieving revision 1.36
>   diff -u -r1.35 -r1.36
>   --- build-torque.xml        26 Jun 2002 07:23:11 -0000      1.35
>   +++ build-torque.xml        27 Jun 2002 17:38:58 -0000      1.36
>   @@ -51,7 +51,6 @@
> 
>        <antcall target="project-sql-classpath"/>
>        <antcall target="project-sql-template"/>
>   -
>      </target>
> 
>      <target
>   @@ -415,6 +414,16 @@
>        <echo message="|                                          |"/>
>        <echo message="+------------------------------------------+"/>
> 
>   +    <antcall target="project-om-classpath"/>
>   +    <antcall target="project-om-template"/>
>   +  </target>
>   +
>   +  <target
>   +    name="project-om-classpath"
>   +    if="useClasspath">
>   +
>   +    <echo message="using classpath"/>
>   +
>        <taskdef
>          name="torque-om"
>          classname="org.apache.torque.task.TorqueDataModelTask">
>   @@ -426,6 +435,32 @@
>          controlTemplate="${OMControlTemplate}"
>          outputDirectory="${torque.home}/${outputDirectory}/java"
>          useClasspath="${useClasspath}"
>   +      outputFile="report.${project}.om.generation"
>   +      targetPackage="${targetPackage}"
>   +      targetDatabase="${database}">
>   +      <fileset dir="${torque.home}/${schemaDirectory}">
>   +        <include name="*-schema.xml"/>
>   +        <exclude name="id-table-schema.xml"/>
>   +      </fileset>
>   +    </torque-om>
>   +  </target>
>   +
>   +  <target
>   +    name="project-om-template"
>   +    unless="useClasspath">
>   +
>   +    <echo message="using template path ${templatePath}"/>
>   +
>   +    <taskdef
>   +      name="torque-om"
>   +      classname="org.apache.torque.task.TorqueDataModelTask">
>   +      <classpath refid="torque-classpath"/>
>   +    </taskdef>
>   +
>   +    <torque-om
>   +      contextProperties="${build.properties}"
>   +      controlTemplate="${OMControlTemplate}"
>   +      outputDirectory="${torque.home}/${outputDirectory}/java"
>          templatePath="${templatePath}"
>          outputFile="report.${project}.om.generation"
>          targetPackage="${targetPackage}"
> 
> 
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:turbine-torque-dev-
> [EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:turbine-torque-dev-
> [EMAIL PROTECTED]>




--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to