Grokbase Groups Ant user April 2010
FAQ
hi,

I need my ant build to sent mails based on success or failure of build.

In brief, after the build, i want to capture the status of the build as a
property, so that based on the property, different emails could be send.

Could any one guide me how to acheive this?

Note: i don't want Maillogger :)

-Pooja
--
View this message in context: http://old.nabble.com/To-set-property-on-any-build-status-tp28177664p28177664.html
Sent from the Ant - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org

Search Discussions

  • Martin Gainty at Apr 8, 2010 at 1:06 pm
    setup a log for output parameter for all tasks
    concatenate (append) results for each task onto log(.properties)



    if your output is in properties file format e.g. key=value

    any build.xml will be able to read those property attributes later on e.g.

    <property file="log.properties"/>



    http://ant.apache.org/manual/CoreTasks/property.html



    hth
    Martin Gainty
    ______________________________________________
    Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité


    Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
    Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.




    Date: Thu, 8 Apr 2010 05:14:49 -0700
    From: pooja.ganapathi@gmail.com
    To: user@ant.apache.org
    Subject: To set property on any build status


    hi,

    I need my ant build to sent mails based on success or failure of build.

    In brief, after the build, i want to capture the status of the build as a
    property, so that based on the property, different emails could be send.

    Could any one guide me how to acheive this?

    Note: i don't want Maillogger :)

    -Pooja
    --
    View this message in context: http://old.nabble.com/To-set-property-on-any-build-status-tp28177664p28177664.html
    Sent from the Ant - Users mailing list archive at Nabble.com.


    ---------------------------------------------------------------------
    To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
    For additional commands, e-mail: user-help@ant.apache.org
    _________________________________________________________________
    Hotmail is redefining busy with tools for the New Busy. Get more from your inbox.
    http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_2
  • Pooja Ganapathi at Apr 9, 2010 at 7:40 am
    Hey Gilbert,

    Thanks, that was a useful info on try\catch. I implemented it in my script,
    and it was good.
    However, when I tried to catch any exception, it didn't do that well.

    basically, I have a main target, which does couple of tasks -this I have put
    under try and have set exception message too in <trycatch>. So, my <catch>
    gets the exception message as "Build failed".

    What am looking is a brief note on which sub task caused exception.

    <trycatch property = "exception" reference ="exception_ref">
    <try>
    <task1/>
    <task2/>


    <mail/> --> success email
    </try>

    <catch>
    <mail/> -- failure email ${exception}
    </catch>

    </trycatch>

    It looks like i can't have multiple try\catch. :(

    any ideas pls!!!!!!!!

    -Pooja





    mgainty wrote:

    setup a log for output parameter for all tasks
    concatenate (append) results for each task onto log(.properties)



    if your output is in properties file format e.g. key=value

    any build.xml will be able to read those property attributes later on e.g.

    <property file="log.properties"/>



    http://ant.apache.org/manual/CoreTasks/property.html



    hth
    Martin Gainty
    ______________________________________________
    Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité


    Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene
    Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte
    Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht
    dient lediglich dem Austausch von Informationen und entfaltet keine
    rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von
    E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
    Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le
    destinataire prévu, nous te demandons avec bonté que pour satisfaire
    informez l'expéditeur. N'importe quelle diffusion non autorisée ou la
    copie de ceci est interdite. Ce message sert à l'information seulement et
    n'aura pas n'importe quel effet légalement obligatoire. Étant donné que
    les email peuvent facilement être sujets à la manipulation, nous ne
    pouvons accepter aucune responsabilité pour le contenu fourni.




    Date: Thu, 8 Apr 2010 05:14:49 -0700
    From: pooja.ganapathi@gmail.com
    To: user@ant.apache.org
    Subject: To set property on any build status


    hi,

    I need my ant build to sent mails based on success or failure of build.

    In brief, after the build, i want to capture the status of the build as a
    property, so that based on the property, different emails could be send.

    Could any one guide me how to acheive this?

    Note: i don't want Maillogger :)

    -Pooja
    --
    View this message in context:
    http://old.nabble.com/To-set-property-on-any-build-status-tp28177664p28177664.html
    Sent from the Ant - Users mailing list archive at Nabble.com.


    ---------------------------------------------------------------------
    To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
    For additional commands, e-mail: user-help@ant.apache.org
    _________________________________________________________________
    Hotmail is redefining busy with tools for the New Busy. Get more from your
    inbox.
    http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_2
    --
    View this message in context: http://old.nabble.com/To-set-property-on-any-build-status-tp28177664p28188702.html
    Sent from the Ant - Users mailing list archive at Nabble.com.


    ---------------------------------------------------------------------
    To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
    For additional commands, e-mail: user-help@ant.apache.org
  • Gilbert Rebhan at Apr 9, 2010 at 8:50 pm

    -------- Original Message --------
    Subject: Re: To set property on any build status
    From: Pooja Ganapathi <pooja.ganapathi@gmail.com>
    To: user@ant.apache.org
    Date: 09.04.2010 09:39


    Hey Gilbert,

    Thanks, that was a useful info on try\catch. I implemented it in my script,
    and it was good.
    However, when I tried to catch any exception, it didn't do that well.

    basically, I have a main target, which does couple of tasks -this I have put
    under try and have set exception message too in <trycatch>. So, my <catch>
    gets the exception message as "Build failed".

    What am looking is a brief note on which sub task caused exception.

    <trycatch property = "exception" reference ="exception_ref">
    <try>
    <task1/>
    <task2/>
    [...]


    i didn't mention try/catch in my response to your post :-)

    but back to your try/catch problem,maybe it's as simple as a missing
    failonerror="true" attribute in your nested tasks, means try =

    trycatch property = "exception" reference ="exception_ref">
    <try>
    <task1 .. failonerror="true"/>
    <task2.. failonerror="true"/>


    because without failonerror="true" it won't get catched ;-)


    Regards, Gilbert

    ---------------------------------------------------------------------
    To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
    For additional commands, e-mail: user-help@ant.apache.org
  • Gilbert Rebhan at Apr 8, 2010 at 6:19 pm

    -------- Original Message --------
    Subject: To set property on any build status
    From: Pooja Ganapathi <pooja.ganapathi@gmail.com>
    To: user@ant.apache.org
    Date: 08.04.2010 14:14


    hi,

    I need my ant build to sent mails based on success or failure of build.

    In brief, after the build, i want to capture the status of the build as a
    property, so that based on the property, different emails could be send.

    Could any one guide me how to acheive this?

    Note: i don't want Maillogger :)

    -Pooja
    For a thread with a similar question and a solution (execlistener)
    that might work for you also, see =
    http://marc.info/?t=121676626300004&r=1&w=2

    Regards, Gilbert

    ---------------------------------------------------------------------
    To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
    For additional commands, e-mail: user-help@ant.apache.org

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupuser @
categoriesant
postedApr 8, '10 at 12:15p
activeApr 9, '10 at 8:50p
posts5
users3
websiteant.apache.org

People

Translate

site design / logo © 2022 Grokbase