ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Arind...@NIIT.COM
Subject RE: How do i do this?
Date Thu, 08 Nov 2001 12:13:09 GMT
Before I answer the question a bit of background of SQLJ.

SQLJ allows you to SQL statements in Java files as normal SQL statements as
against sending the SQL statements as a string parameter to JDBC calls. This
keeps the Code clean. The SQLJ Pre-Compiler processes the .sqlj files and
generates a .java file with appropriate JDBC calls and a .ser file which
contains information about the SQL statements, input parameters and output

The .java file gets saved in the same directory as that of .sqlj files,
while the .ser files gets saved in a directory passed to the SQLJ
precompiler command. In my case the build directory, which contains all the
class files.

Here is how I execute the SQL command with ANT:
	<target description="Pre-Compile SQLJ Files" name="sqlj">
		<apply executable="sqlj" dest="${}"
skipemptyfilesets="true" parallel="true" type="file" failonerror="false"
			<!-- Set the Environment Classpath -->
			<env key="classpath"
			<!-- SQLJ Arguments -->
			<arg value="-d=${}"/>
			<arg value="-compile=no"/>
			<arg value="-checkfilename=yes"/>
			<arg value="-status=yes"/>
			<arg value="-compiler-executable=jikes"/>
			<!-- SQLJ Files -->
			<fileset dir="${dir.src}">
					<include name="**/*.sqlj"/>
			<!-- Mapping to OutputFiles -->
			<mapper type="glob" from="*.sqlj"

After the above target executes on a file in my source directory
${dir.src}/com/niit/objs/ABC.sqj, the following files are generated:
1. ${dir.src}/com/niit/objs/
2. ${}/com/niit/objs/ABC_SJProfile0.ser

After this target execute, I compile all the .java files in my source
directory. After the java compilation ${dir.src}/com/niit/objs/ is a
redundant file in my source directory. I want to remove this file as I don't
want any developer to accidently edit this file.

I hope I was able to represent my problem.


-----Original Message-----
From: 	Alan Pearlman Spencer [] 
Sent:	Thursday, November 08, 2001 3:17 PM
To:	Ant Users List
Subject:	RE: How do i do this?

Is this so you can recreate them?
Maybe you should use <apply> to have the compiler (sqlj?) run
on the changed files only?

<apply executable="sqlj?" dest="src/JAVA" parallel="false">
  <arg value="-c"/>
  <arg value="-o"/>
  <fileset dir="src/SQL" includes="*.sqlj"/>
  <mapper type="glob" from="*.sqlj" to="*.java"/>

-----Original Message-----
From: ArindamR@NIIT.COM [mailto:ArindamR@NIIT.COM]
Sent: 08 November 2001 05:28
Subject: How do i do this?


I want to achieve the following functionality:

Remove all *.java files for which there is a corresponding .sqlj file.
e.g. if I have a.sqlj and b.sqlj in my source file directory, delete the
corresponding and Although I can achieve this
using <script> task, is there any other way of doing this?



To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message