ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian.Kon...@deltalloyd.de
Subject Antwort: Re: Calling Ant using different JDKs
Date Wed, 15 Nov 2006 10:25:05 GMT
Thanks everybody for your hints!

Finally I used the good old "exec"... The project's build-file (build.xml -
doing the main job) is called by a masterbuild-file which is called by a
buildfile doing the scheduling - what needs to be build when. And this very
first call is an exec. I passed the nested env-element to it and the
problem was solved! The build result does not matter at that point in time
since the file does just the scheduling of the various project-builds.

But Prashant's idea sounds interessting to me... Thanks anyway!




                                                                                         
                                     
                                                                                         
                                     
                                                 An:     Ant Users List <user@ant.apache.org>
                                 
                      Prashant                   Kopie:                                  
                                     
                      <prashant@pramati         Thema:   Re: Calling Ant using different
JDKs                                  
                      .com>                                                           
                                        
                                                                                         
                                     
                      14.11.2006 05:11                                                   
                                     
                      Bitte antworten                                                    
                                     
                      an "Ant Users                                                      
                                     
                      List"                                                              
                                     
                                                                                         
                                     
                                                                                         
                                     




Christian.Konrad@deltalloyd.de wrote:
> Hi everybody,
>
> is there a way to call an Ant Build-File (<ant  antfile="...">) and pass
it
> the JAVA_HOME environment variable?
> Exec accepts just that using the nested env-Argument (<env
key="JAVA_HOME"
> path="..." />).
>
> Basically I'm looking for a way to call a Build-File (build.xml) with
> different JDKs. I cannot fix the javac call to use the different JDKs. I
> need to specify it when calling the build-file.
>

Could't you try something like this :

You could define a macrodef wrapper over javac in a common-build.xml.
This can be imported by the other build files and they would use the
macrodef wrapper instead of javac directly.

Since you can control the javac version from the common-build.xml, you
can pick whatever JAVA_HOME version you want.

-Prashant
> Actually I would use "exec" instead of "ant" but it doesn't get the build
> result. So the builds never fail.
>
> Any suggestions?
>
>
> Regards,
> Christian
>
>
> ---------------------------------------------------------------------
> 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