Running Cygwin bash from Ant script

Igor Peshansky pechtcha@cs.nyu.edu
Thu Nov 22 18:27:00 GMT 2007


On Wed, 14 Nov 2007, Nicolai Kamenzky wrote:

> Hi folks!
>
> In my Ant script I have a target which should
> 1. Start the Cygwin bash,
> 2. Change the current directory, and
> 3. Execute a command.
>
> I have done this previously using the windows console,
> but now I want to do the same with the Cygwin bash.
>
> My Ant target looked like this:
> <project name="xyz" basedir=".">
> 	<target name="build">
> 		<exec dir="." executable="cmd.exe">
> 			<arg line="/c make"/>
> 		</exec>
> 	</target>
> </project>
>
> I tried this, but it didn't work:
> <project name="xyz" basedir=".">
> 	<target name="build">
> 		<exec dir="." executable="C:\Program Files\cygwin\bin\bash">
> 			<arg line=" --login -i -c cd /cygdrive/c/someFolderToBeTheCurrentDir/; make"/>
> 		</exec>
> 	</target>
> </project>
>
> Any ideas?

This isn't really Cygwin-specific -- you'd have the same problem with ant
and bash on Linux.  Don't use "arg line", use something like

		<exec dir="." executable="C:\Program Files\cygwin\bin\bash">
			<arg value="--login"/>
			<arg value="-i"/>
			<arg value="-c"/>
			<arg value="cd /cygdrive/c/someFolderToBeTheCurrentDir/; make"/>
		</exec>

HTH,
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_	    pechtcha@cs.nyu.edu | igor@watson.ibm.com
ZZZzz /,`.-'`'    -.  ;-;;,_		Igor Peshansky, Ph.D. (name changed!)
     |,4-  ) )-,_. ,\ (  `'-'		old name: Igor Pechtchanski
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

Belief can be manipulated.  Only knowledge is dangerous.  -- Frank Herbert

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/



More information about the Cygwin mailing list