GUI-Output from Apache ant

This is the first of my Ant snippets. I think I will post more in the future. Most of these snippets are written during discussions on the dev@ant and user@ant mailing lists for showing possibilities or solutions to problems. Sometimes I only played with something …

With <echo> you can print log messages to Ant’s output. I tried to make a „popup“, so you will be informed if a „background“ Ant process has something important to say.

<project>
    <scriptdef name="alert" language="beanshell">
        <attribute name="message"/>
        <attribute name="title"/>
        <!&#91;CDATA&#91;
            title   = attributes.get("title");
            message = attributes.get("message");

            if (title==null) {
                title =  "Ant Alert!";
            }

            import javax.swing.*;
            JOptionPane.showMessageDialog(
                null, message,
                title, JOptionPane.ERROR_MESSAGE);
        &#93;&#93;>
    </scriptdef>

    <alert message="A long and boring message"/>
    <alert message="A long and boring message" title="Danger Danger"/>

</project>

Explore posts in the same categories: Ant, en

Schlagwörter: , ,

You can comment below, or link to this permanent URL from your own site.

Schreibe einen Kommentar

Trage deine Daten unten ein oder klicke ein Icon um dich einzuloggen:

WordPress.com-Logo

Du kommentierst mit Deinem WordPress.com-Konto. Abmelden / Ändern )

Twitter-Bild

Du kommentierst mit Deinem Twitter-Konto. Abmelden / Ändern )

Facebook-Foto

Du kommentierst mit Deinem Facebook-Konto. Abmelden / Ändern )

Google+ Foto

Du kommentierst mit Deinem Google+-Konto. Abmelden / Ändern )

Verbinde mit %s


%d Bloggern gefällt das: