It's all about the answers!

Ask a question

buildResultPublisher in Ant - warning icon available?


Rob Calendino (3675) | asked Jan 19 '09, 2:58 p.m.
JAZZ DEVELOPER
Hi, I'm using the Ant build in RTC.

I'm curious if there is a way to produce a 'warning' state in the build
result instead of just success or fail.

I'm currently using the failOnError attribute in my build activities,
but I'd really like a way to indicate 'warning'.

Is there any way to do this in Ant?

Thanks
Rob

3 answers



permanent link
Don Weinand (7851) | answered Jan 19 '09, 6:08 p.m.
JAZZ DEVELOPER
I believe we used to support that in the BuildResultPublisherTask but took
it out because it had no tracibility to what actually caused the warning
state causing confusion. We switched to a model where the various
publishers would support it so that the state could be tied to the actual
contribution causing the problem. If you look at any of the tasks that
extend from AbstractContentPublisherTask(ArtifactFilePublisherTask,
FilePublisherTask, LogPublisherTask, etc) they all support a "status"
attribute in the task where you can pass in one of "ERROR, WARNING, INFO,
OK" so that a connection is made between the offending contribution and the
status. Other tasks like JdtCompileLogPublisherTask or
JUnitLogPublisherTask do that automatically based on the output they find.
What's the particular case you are looking to set the warning status for?

Don Weinand
Jazz Team Build

"Rob Calendino" <robca> wrote in message
news:gl2lli$err$1@localhost.localdomain...
Hi, I'm using the Ant build in RTC.

I'm curious if there is a way to produce a 'warning' state in the build
result instead of just success or fail.

I'm currently using the failOnError attribute in my build activities, but
I'd really like a way to indicate 'warning'.

Is there any way to do this in Ant?

Thanks
Rob

permanent link
Rob Calendino (3675) | answered Jan 20 '09, 8:58 a.m.
JAZZ DEVELOPER
Donald Weinand wrote:
I believe we used to support that in the BuildResultPublisherTask but took
it out because it had no tracibility to what actually caused the warning
state causing confusion. We switched to a model where the various
publishers would support it so that the state could be tied to the actual
contribution causing the problem. If you look at any of the tasks that
extend from AbstractContentPublisherTask(ArtifactFilePublisherTask,
FilePublisherTask, LogPublisherTask, etc) they all support a "status"
attribute in the task where you can pass in one of "ERROR, WARNING, INFO,
OK" so that a connection is made between the offending contribution and the
status. Other tasks like JdtCompileLogPublisherTask or
JUnitLogPublisherTask do that automatically based on the output they find.
What's the particular case you are looking to set the warning status for?

Don Weinand
Jazz Team Build

"Rob Calendino" <robca> wrote in message
news:gl2lli$err$1@localhost.localdomain...
Hi, I'm using the Ant build in RTC.

I'm curious if there is a way to produce a 'warning' state in the build
result instead of just success or fail.

I'm currently using the failOnError attribute in my build activities, but
I'd really like a way to indicate 'warning'.

Is there any way to do this in Ant?

Thanks
Rob



Hi Don, we are using a set of command line calls (we are building a
..net application) I'd like to be able to return a status of warning
instead of just error. here's an example from my build.xml

<Post>
<startBuildActivity>
<exec>
<arg>
<arg>
<arg>
<arg>
<arg>
<arg>
</exec>

notice the failonerror="true" attribute. Essentially i would like to be
able to tell users that warnings exist in the build without failing the
entire build.

Does that make sense?

permanent link
Ryan Manwiller (1.3k1) | answered Jan 20 '09, 11:08 a.m.
JAZZ DEVELOPER
The simplest thing is to publish a log using the logPublisher and set the
status to WARNING. The log content should indicate what the warnings are.
This could be a compile log or a manufactured log. This way, the consumer of
the build result will have an idea what the warning is for.

In order for the build to show up as a warning overall, you need to change
the default setting on the General page of the build definition: uncheck
"Ignore warnings when computing overall status"

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.