This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Ant, Maven and Other Build Tools and the fly likes ant script not working Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "ant script not working" Watch "ant script not working" New topic
Author

ant script not working

Pradeep Kumar
Ranch Hand

Joined: Sep 11, 2007
Posts: 77
Hi,
I have a batch file in the current base directory. I tried running the batch file using the following command.

<?xml version="1.0" encoding="UTF-8"?>
<project name="batchFile" default="exec" basedir=".">
<target name="exec">
<echo>start execution</echo>
<exec dir="${basedir}" executable="batch" os="Windows NT">
<arg line="stop_copy_start"/>
</exec>

</target>
</project>

The echo is getting executed but there is no warning error or any intimation but the Build successfull message is getting displayed.
Can someone tell me how to run the batch file. THe os is windows xp service pack 2.

Thanks and regards,
Pradeep Kumar


SCJP 1.6
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
Did you check the value of the "os.name" property?


The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Pradeep Kumar
Ranch Hand

Joined: Sep 11, 2007
Posts: 77
How and where to test the os.name property.
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
Just add a

<echo>${os.name}</echo>

to your script. The shown value is the one you should use for the os attribute of the exec task. Or perhaps you should use the osfamily attribute instead.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ant script not working
 
Similar Threads
ant executable problem
Problem with catalina.sh
target getting called more than once.
build failed due to restriction of target matching instruction
Cruise control giving wrong status in email.