ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Wayne Cannon <wcan...@turinnetworks.com>
Subject Re: filename collisions when compiling
Date Wed, 27 Jun 2007 18:44:50 GMT
Clarification, since you usually want the full class name, including 
package, for class A to remain the same:

For example:
  .../common/com/mycompany/myproject/B.java      package.class = 
com.mycompany.myproject.B
  .../common/com/mycompany/myproject/C.java      package.class = 
com.mycompany.myproject.C
  .../case1/com/mycompany/myproject/A.java      package.class = 
com.mycompany.myproject.A
  .../case2/com/mycompany/myproject/A.java      package.class = 
com.mycompany.myproject.A

Still compile using "common + case1" or "common + case2" directories, as 
desired, for your source path.

--Wayne

Wayne Cannon wrote:
> ... or simply name them both non-java, such as A.java.source, and then 
> copy the desired one to A.java in its current directory (removing any 
> pre-existing A.java copies beforehand).  That way, there is only one 
> A.java, regardless of directory.
>
> If there are two different cases that are compiled, my solution for 
> similar situations (e.g., a family of products with shared classes and 
> some classes with minor product-specific variations, but the same 
> class name in each product) has been to have separate directories for 
> the unique cases and a common directory for the shared files -- then 
> compile with the desires sourcepath or equivalent.
>
> For example:
>   .../common/B.java
>   .../common/C.java
>   .../case1/A.java
>   .../case2/A.java
>
> Then compile using either "common + case1" or "common + case2" 
> directories, as desired.  This can be extended hierarchically.
>
> --Wayne
>
>
> Burgess, Benjamin wrote:
>> You could always mange your files ahead of compiling.  For example, you
>> could copy everything from the first directory into a temp directory,
>> then copy everything from the second directory into the temp directory
>> overwriting existing files, then compile from the temp directory.
>>
>> Ben
>>
>> -----Original Message-----
>> From: David Alves [mailto:dalves@brnphoenix.com] Sent: Wednesday, 
>> June 27, 2007 2:18 PM
>> To: Ant Users List
>> Subject: filename collisions when compiling
>>
>> I have two directories of source files that I want to compile. One of
>> them has
>> A.java
>>
>> B.java
>>
>> C.java
>>
>>  
>>
>> the other one has
>>  
>>
>> A.java
>>
>>  
>>
>> The version of A in the second directory is different from the version
>> in the first directory. Is there set up my javac task so that it always
>> takes source files from the second directory if they are present there,
>> but takes them from the first directory if they are not present? Thanks
>> in advance for your help.
>>
>>  
>>
>> Regards,
>>
>> David Alves
>>
>> ********************************************************************************************

>>
>> This message, including any attachments, contains confidential 
>> information intended for a specific individual and purpose, and is 
>> protected by law. If you are not the intended recipient, please 
>> contact the sender immediately by reply e-mail and destroy all copies.
>> You are hereby notified that any disclosure, copying, or distribution 
>> of this message, or
>> the taking of any action based on it, is strictly prohibited.
>>
>> TIAA-CREF
>> ********************************************************************************************

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

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


Mime
View raw message