ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <jakarta-...@ehatchersolutions.com>
Subject Re: Building a source reference
Date Wed, 02 Oct 2002 01:48:03 GMT
I missed your first post on this issue, but what was the issue with the 
conditional patternset at the bottom of your e-mail?  Did that not work 
for you?  Our book covers that in Chapter 3 (Datatypes).

But as for your actual end result of compiling tests and production code 
into the same resultant directory tree, I personally do not do that.  In 
my current project I set up a "compile-module" target that compiles both 
the source and tests with two separate <javac> tasks into two different 
directory trees, and <antcall> that target passing in some parameters 
for each of the modules we have (common, ejb, web, etc).  Using that 
idea and taking it a step further, I could refactor to have a separate 
compile-test target that was made conditional on an Ant property.  But I 
actually am taking the compilation of tests as a mandatory litmus test 
for all builds to ensure that at the very least the test cases compile, 
which actually has had the effect of catching things!

But, provide some more details of what isn't working for you with 
conditional patternsets as you show further below, and lets work through it.

	Erik


Jeffrey Jensen wrote:
> I am still struggling with this and hope someone will shed the light.
> 
> I want to do something like this (this is obviously not correct
> syntax!):
> 
>   <path id="src.java">
>     <pathelement location="csourceweb/source"/>
>     <pathelement location="csourceweb/test" if="compile.tests"/>
>   </path>
> 
>   <javac ...>
>     <src refid="src.java">
> 
> What works and is the best practice for this (adding additional source
> directories for <javac> and <javadoc> source dirs based on a property)? 
> Can someone please point me to the info in either the ant manual or Erik
> & Steve's book (or some other URL)?  I just cannot find the details (and
> have been trying a variety of things)...
> 
> 
> 
>>>>JJENSEN@agribank.com 10/01/02 12:57PM >>>
>>>
> Hi,
> 
> In the snippet below, what is the solution to get "src.java"
> shared/accessible in each target (<pathconvert> has to run only in a
> target, right?!)?
> 
> And perhaps there is a better approach all around for javac & javadoc
> to access the same source info with the "test" dir included only when
> specified to...?
> 
> 
>   <fileset id="src.java.files" dir="csourceweb">
>     <include name="source/**/*.java"/>
>     <include name="test/**/*.java" if="compile.tests"/>
>   </fileset>
>     <pathconvert property="src.java" pathsep=","
> refid="src.java.files"/>
> 
> <target ...
>   <javac ...>
>     <src refid="src.java">
> 
> <target ...
>   <javadoc ...>
>     <sourcepath refid="src.java">
> 
> 
> --
> To unsubscribe, e-mail:  
> <mailto:ant-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
> <mailto:ant-user-help@jakarta.apache.org>
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>
> 
> 
> 


--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


Mime
View raw message