db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew McIntyre <mcintyr...@gmail.com>
Subject Re: JSR169 status update & build/ant question
Date Thu, 02 Jun 2005 17:41:17 GMT

On Jun 2, 2005, at 10:18 AM, Daniel John Debrunner wrote:

> 2) Make the optional engine_169_opt target also modify the
> modules.properties to add just
> derby.module.jdbcJ2ME=org.apache.derby.jdbc.Driver169

The easiest way is to do something similar to how splitmessages  
targets are handled, or ClassSizeCatalog generation. You have one  
target that performs the necessary action - in this case, a  
<replace>, <replaceregexp>, or <concat> task which performs the  
necessary edit on modules.properties in the output dir - and then  
<touch>s a file, usually in the same location preferably with a  
similar name, e.g. modules.done. This target depends on a target that  
checks for the existence of that file and sets a property if it  
exists, and the execution of the original argument is dependent on  
that new property not being set. You could also set a property - in  
my example below called jsr169.available - if there is a particular  
resource (jar file) or classname that should be available for your  
jsr169 support to compile.

<target name="jsr169_module_edit"  
depends="checkmoduleprops,checkjsr169" unless="modules.uptodate"  

   <!-- tasks for modifying modules.properties go here -->

<touch file="${out.dir}/${derby.dir}/modules.done"/>


<target name="checkmoduleprops">
   <condition property="modules.uptodate">
     <available file="${out.dir}/${derby.dir}/modules.done"/>

<target name="checkjsr169">
   <condition property="jsr169.available">
     <!-- check Ant docs for <available> for the appropriate entry  
here -->

Obviously, this should come in the build some time after  
modules.properties has been copied to ${out.dir}. When running clean  
or clobber, the .done file and the .properties file are both removed,  
which will cause the copy and edit to be performed at the time of the  
next build.


View raw message