"Invoke top-level Ant targets" doesn't seem to work for me

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

"Invoke top-level Ant targets" doesn't seem to work for me

Folke Lemaitre-3
Hi,

I have a Hudson project where I would like to run an ant script located at WORKSPACE/src/build/code/build.ant, but I don't seem to get this to work.

What I did:
  1. added an existing ant installation to Hudson
  2. configured the project for "Invoke top-level Ant targets"
  3. selected the added ant installation
  4. to the targets field I added: -f src/buil/code/build.ant
I would expect the current directory for starting the ant script would be WORKSPACE, but this doesn't seem to be the case. See error:
[src] $ cmd.exe /C e:\hudson\tools\apache-ant-1.7.0\bin\ant.bat -f src/build/code/build.ant && exit %%ERRORLEVEL%%
Buildfile: src\build\code\build.ant does not exist!
Build failed

finished: FAILURE

Is there any way I can refer to my buildscript without specifying an absolute path?

Thanks in advance,
Folke Lemaitre
Reply | Threaded
Open this post in threaded view
|

Re: "Invoke top-level Ant targets" doesn't seem to work for me

Kohsuke Kawaguchi
Administrator
Folke Lemaitre wrote:

> Hi,
>
> I have a Hudson project where I would like to run an ant script located at
> WORKSPACE/src/build/code/build.ant, but I don't seem to get this to work.
>
> What I did:
>
>    1. added an existing ant installation to Hudson
>    2. configured the project for "Invoke top-level Ant targets"
>    3. selected the added ant installation
>    4. to the targets field I added: -f src/buil/code/build.ant
>
> I would expect the current directory for starting the ant script would be
> WORKSPACE, but this doesn't seem to be the case. See error:
>
> [src] $ cmd.exe /C e:\hudson\tools\apache-ant-1.7.0\bin\ant.bat -f
> src/build/code/build.ant && exit %%ERRORLEVEL%%
> Buildfile: src\build\code\build.ant does not exist!
> Build failed
That [src] at the left is the current directory. Because that's the top
of the checked out module, Hudson is using that to launch Ant.

So you need to change to "-f build/code/build.ant" since it's already in
src.

>
> finished: FAILURE
>
> Is there any way I can refer to my buildscript without specifying an
> absolute path?
>
> Thanks in advance,
> Folke Lemaitre
>


--
Kohsuke Kawaguchi
Sun Microsystems                   [hidden email]

smime.p7s (4K) Download Attachment