multiple ant build files for a project

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

multiple ant build files for a project

Prabhat Jha-3
Hi,

I am using hudson version 1.85 and I am impressed with what I have seen.

I have a project which build requires running two ant build files
located in separate directories. It's my understanding that this version
does not have a way to specify two build files with "Invoke top-level
Ant targets". I tried playing with modifying generated config file
directly but that does not seem to solve the purpose. I have also tried
following:

A. Under Execute Windows batch command, I added following:
   ant -f build1.xml
   ant -f build2.xml
It only runs first build and ignores the second.

B. Under Execute Windows batch command, I provided a .bat file name that
has above two commands and even in this case it only executes the first
build.

Am I doing something incorrectly here or is this how these options are
supposed to work? I know there is a solution because I think it's pretty
common scenario.


Regards,
prabhat

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: multiple ant build files for a project

Jesse Glick
Prabhat Jha wrote:
> A. Under Execute Windows batch command, I added following:
>   ant -f build1.xml
>   ant -f build2.xml
> It only runs first build and ignores the second.

FWIW, I have projects set up to run under Linux and it works fine to run
Ant multiple times like this. No idea why it wouldn't work for you. Try
just running two simple commands, e.g. echo some message.

-J.

--
[hidden email]  x22801  netbeans.org  ant.apache.org
       http://google.com/search?q=e%5E%28pi*i%29%2B1

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: multiple ant build files for a project

Prabhat Jha-3
Hi Jesse,

Thanks for your response. I tried putting two echo statements and they
get printed. Then I tried putting these:

ant -f trunk/build/build.xml
echo Prabhat

which correctly translates to this in config.xml that gets generated.

<hudson.tasks.BatchFile>
      <command>ant -f trunk/build/build.xml&#x0D;
echo Print this as well</command>
    </hudson.tasks.BatchFile>

But after ant is execued, I don't see "Print this as well" getting
printed. The first command's exit code is successful because I see
following in log:

BUILD SUCCESSFUL

Total time: 2 minutes 23 seconds

Recording test results


As you see the echo statement is not getting printed before going for
test results.

Regards,
Prabhat
Jesse Glick wrote:

> Prabhat Jha wrote:
>> A. Under Execute Windows batch command, I added following:
>>   ant -f build1.xml
>>   ant -f build2.xml
>> It only runs first build and ignores the second.
>
> FWIW, I have projects set up to run under Linux and it works fine to
> run Ant multiple times like this. No idea why it wouldn't work for
> you. Try just running two simple commands, e.g. echo some message.
>
> -J.
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: multiple ant build files for a project

Jesse Glick
Prabhat Jha wrote:
> But after ant is execued, I don't see "Print this as well" getting
> printed. The first command's exit code is successful

Sorry, no idea what could be wrong. I guess you'll need to dig deeper,
putting print statements into the Ant launcher script, etc.

-J.

--
[hidden email]  x22801  netbeans.org  ant.apache.org
       http://google.com/search?q=e%5E%28pi*i%29%2B1

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: multiple ant build files for a project

Kohsuke Kawaguchi-2
In reply to this post by Prabhat Jha-3

Ah, I know why. You are using Windows batch file.

When you call one batch file from another, you have to do:

  call ant.bat

If you do just "ant.bat", and ant.bat exits, it exits the all the
calling batch files as well. For more, run "call /?" from Windows
command line.

Prabhat Jha wrote:

> Hi Jesse,
>
> Thanks for your response. I tried putting two echo statements and they
> get printed. Then I tried putting these:
>
> ant -f trunk/build/build.xml
> echo Prabhat
>
> which correctly translates to this in config.xml that gets generated.
>
> <hudson.tasks.BatchFile>
>       <command>ant -f trunk/build/build.xml&#x0D;
> echo Print this as well</command>
>     </hudson.tasks.BatchFile>
>
> But after ant is execued, I don't see "Print this as well" getting
> printed. The first command's exit code is successful because I see
> following in log:
>
> BUILD SUCCESSFUL
>
> Total time: 2 minutes 23 seconds
>
> Recording test results
>
>
> As you see the echo statement is not getting printed before going for
> test results.
>
> Regards,
> Prabhat
> Jesse Glick wrote:
>> Prabhat Jha wrote:
>>> A. Under Execute Windows batch command, I added following:
>>>   ant -f build1.xml
>>>   ant -f build2.xml
>>> It only runs first build and ignores the second.
>>
>> FWIW, I have projects set up to run under Linux and it works fine to
>> run Ant multiple times like this. No idea why it wouldn't work for
>> you. Try just running two simple commands, e.g. echo some message.
>>
>> -J.
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

--
Kohsuke Kawaguchi
Sun Microsystems                   [hidden email]

smime.p7s (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: multiple ant build files for a project

Prabhat Jha-3
Thanks a bunch Koshuke. Replacing "ant -f build.xml" with "call ant.bat
-f build.xml' did the the trick.

Thanks,
prabhat

Kohsuke Kawaguchi wrote:

>
> Ah, I know why. You are using Windows batch file.
>
> When you call one batch file from another, you have to do:
>
>  call ant.bat
>
> If you do just "ant.bat", and ant.bat exits, it exits the all the
> calling batch files as well. For more, run "call /?" from Windows
> command line.
>
> Prabhat Jha wrote:
>> Hi Jesse,
>>
>> Thanks for your response. I tried putting two echo statements and
>> they get printed. Then I tried putting these:
>>
>> ant -f trunk/build/build.xml
>> echo Prabhat
>>
>> which correctly translates to this in config.xml that gets generated.
>>
>> <hudson.tasks.BatchFile>
>>       <command>ant -f trunk/build/build.xml&#x0D;
>> echo Print this as well</command>
>>     </hudson.tasks.BatchFile>
>>
>> But after ant is execued, I don't see "Print this as well" getting
>> printed. The first command's exit code is successful because I see
>> following in log:
>>
>> BUILD SUCCESSFUL
>>
>> Total time: 2 minutes 23 seconds
>>
>> Recording test results
>>
>>
>> As you see the echo statement is not getting printed before going for
>> test results.
>>
>> Regards,
>> Prabhat
>> Jesse Glick wrote:
>>> Prabhat Jha wrote:
>>>> A. Under Execute Windows batch command, I added following:
>>>>   ant -f build1.xml
>>>>   ant -f build2.xml
>>>> It only runs first build and ignores the second.
>>>
>>> FWIW, I have projects set up to run under Linux and it works fine to
>>> run Ant multiple times like this. No idea why it wouldn't work for
>>> you. Try just running two simple commands, e.g. echo some message.
>>>
>>> -J.
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]