How to change directory (CD) using ant script?Is there any task in ant which does: cd
Asked
Active
Viewed 8,754 times
3
-
Please, explain what is the goal behind this for more productive answers. – Vadzim Oct 01 '12 at 05:59
-
I got a script in another directory ,I need to run that script. – Monty Oct 01 '12 at 06:03
-
4Then `
`. What's the problem? – Vadzim Oct 01 '12 at 06:06 -
okay Thanks, I didnt know this can be done in one go.I was searching how to change the directory and then run the script.:P:P – Monty Oct 01 '12 at 06:11
1 Answers
1
There is no way to do this in Java.
See Changing the current working directory in Java?
So ant can't do it either.
Current dir can only be changed for nested tasks like java forked in separate process with fork="yes"
.
-
You can use `exec` to run some script that changes it's own current dir. But it would not reflect on ant's current dir. – Vadzim Oct 01 '12 at 06:04
-