NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

What's the best way to debug Ant?

 
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Users
View previous topic :: View next topic  
Author Message
pallak7



Joined: 30 Dec 2009
Posts: 3

PostPosted: Wed Dec 30, 2009 4:38 pm    Post subject: What's the best way to debug Ant? Reply with quote

Hi.

I have a large Java project with its own Ant script that was written for it. The build is initiated from outside the Ant script by a batch file which sets up some environment variables (needed during the build to locate libraries, special files, etc.) and then invokes the deploy target in the build script.

I know debugging of Ant scripts can be done by right-clicking on the build script and clicking debug target. The problem for me is if I debug this way, my environment variables are not carried into the debugging session. For instance, when the debugger hits this line:
Code:
<property name="SOME_VAR" value="${env.SOME_VAR}"/>

where we're essentially assigning a system environment variable to a local Ant variable, the build fails. I tried to remedy this problem by invoking the shell script as the first thing done in the build like so:
Code:
<exec dir="." executable="cmd" os="Windows NT">
        <arg line="/c build_vars.bat"/>
</exec>

which seems to call the script correctly but when it hits the above line that assigns an env variable to a local variable, the literal string "${env.SOME_VAR}" is assigned to the variable instead of the value of that variable (say "TRUE").

How can I resolve these environment variables correctly so that I can debug my Ant script? Thanks for your help.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Users All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo