Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

batch scripting + ant - stop cmd prompt from auto exiting

Tags:

batch-file

ant

i have an ant build.xml that does some building stuff. Before i execute this though, i need some variables/environment to be set. i am using .bat script to do that, and also trying to call ant directly from there, so that i dont have to do 2 steps.

Although the script calls the ant target alright, the command prompt window auto exits as soon as the ant build is complete(irrespective of build failure/success)

i have tried pause and also cmd /k neither of them have seemed to work.

the .bat file looks something like this:

@echo off
call C:/somefile.bat
ant targetName
pause
cmd /k
like image 485
user1856732 Avatar asked Feb 05 '13 06:02

user1856732


1 Answers

If the ant script is a console app then you will need to call that also, otherwise control will be transferred to it and never return to the batch

@echo off
call C:/somefile.bat
call ant targetName
pause
like image 102
Bali C Avatar answered Oct 18 '22 00:10

Bali C