Ok I am trying some elementary stuff here and still I can't figure out how to do anything but move files and dirs around in this build tool.
I want to kick off a python script using ant:
I get the:
Cannot run program "python.exe" (in directory "C:\Python25"): CreateProcess error=2, The system cannot find the file specified
Obviously that file is most defenitely there.
What am I doing wrong here?
This actually echos some DOS header stuff:
<exec dir="C:\Windows\System32" executable="cmd.exe">
</exec>
so I doubt my settings are off.
I suppose I could run python by making ant open a cmd.exe and cd my way into Python25 and then issue a command python -filename.py
But so far any attempts to pass commands to cmd.exe failed. Is this tool even meant to do any of this?
When executing applications in Ant scripts - and from Java programs in general, it doesn't pay to assume that the PATH is what you think it is. It is always good practice to explicitly specify exactly which copy of a program is to be run and from where. So instead of executable="python.exe", a better approach would be executable="C:/python2.5/python.exe".
Note that I used the forward-slash filename syntax. As a general rule, I recommend this form when working with Java. First, because it makes it possible to make scripts and code more portable. Secondly - and more importantly - the backslash character has another usage in Java and unless you're very careful it can bite you.
Customer surveys are for companies who didn't pay proper attention to begin with.