ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Allegar Robert" <>
Subject RE: EJB compilation
Date Mon, 03 Jul 2000 17:55:59 GMT
	What we currently have is a directory structure that facilitates both
source control and the twice daily builds we do. It's set up like this:

	|   |-source
	|   |	|-EJB1
	|   |	|-EJB2
	|   |	|-EJBn
	|   |
	|   |-bin
	|   |	|-EJB1
	|   |	|-EJB2
	|   |	|-EJBn
      |   |
      |   |-jar
	|     |-EJB1.jar
	|	|-EJB2.jar
	|	|-EJBn.jar
	|  |-source
	|  |-bin
	|  |-jar

	So what it amounts to is the three sections of the site -- pretty much all
three tiers -- have their own directory. The 'source' directories are for
our change control software, and the bin directories are for our publishing
software. I have ant set up to compile the 'packages' directory correctly
and place the completed packages jar file in the correct jar directory.

	The EJBs are a bit different, however, because both the deployment
descriptor and the container generated classes need to be put in the jar
file. Also, we want to have our EJBs in separate JAR files for component
reasons. So I wrote an NT batch file which enumerates the directory list
under the EJB directory, and calls the appropriate programs as necessary.
The names of the sub directories under the /EJB/source/ directory end up
being the names of the jar files. So here's the catch: I don't mind the
external call to the WL container to generate the EJB stubs as necessary.
However, the dynamic directory enumeration is really key.

	Currently, when we add an EJB, all we do is add a directory under the
/EJB/source/ directory and the next time the build script is run, it'll pick
it up automatically, create the appropriate bin directory, the appropriate
jar directory, and everything works fine. Perhaps there's a way to coax ant
to do this, but I haven't found out how yet.

	So here's what I'm looking for: Ant begins to run, and enumerates the list
of sub directories under a specific directory. A javac task is run for each
directory, then an external call is made to generate the container classes
for that javac call. After this, a jar task is run and everything is put in
the appropriate directory. It's pretty much a basic looping structure.
Something like:

	<target name="ejb" index="currDir" loopType="directory" dir="${ejbDir}">
		<javac srcdir="${currDir} ... />
		<exec ... />
		<jar ... />

Or the looping structure could be a target based on other targets:

	<target name="ejb" index="currDir" loopType="target" dir="${ejbDir}"
targetLoop="ejbCompile,containerCompile,ejbJar" />

	<target name="ejbCompile>
		<javac srcdir="${currDir} ... />

	<target name="containerCompile">
		<exec ... />

	<target name="ejbJar">
		<jar ... />

Dunno, just throwing out ideas. I've only done a cursory parse of the source
code, but my gut feeling is that while the enumeration and looping would be
easy, the plugging in of the index variable and the dynamic dependency on
other tasks might be the most challenging. As I said, I've only looked
briefly at the source.

	The other thing I'm currently using a batch file for is the pre-compilation
of my JSP files. While the initial delay of an uncompiled page is rather
small, we'd like to mitigate the delay as much as possible. I think I can
coax ant to do this one, because it's just a call to exec, however I'd
really like to do the looping structure (directory recursion) inside ant and
not inside the program that I'm calling. This will let me add my own syntax
checkers, etc and not force me to build/integrate directory recursion
functionality every time.



-----Original Message-----
From: Conor MacNeill []
Sent: Monday, July 03, 2000 12:23 PM
Subject: RE: EJB compilation


There are a number of Application servers around which provide EJB
Containers. I have provided some EJB tasks for weblogic but I have not tried
to come up with a generic EJB task in the same way that Javac operates. Can
you give us more information on what your target environment is, etc?


Conor MacNeill

View raw message