Posted tagged ‘Ant’

Links for 2008-10-16

16. Oktober 2008

According to this German article (relies on an article by ComputerWorld Australia)Australia plans to filter all internet traffic in AUS. There are two blacklists: one for illegal content (which should be blocked) and one for content for adults.

Trustin Lee has released Ant2IDE. Basically this is a BuildListener that collects (almost) all data required for generating Eclipse settings.

Werbeanzeigen

Ant: Deleting files from ZIP

14. Oktober 2008

A common problem is deleting single files from a ZIP. An old workaround is „unzip+zip“. This snippet implements a macro. The <selectors/> statement in line 21 together with the <element> definition in line 14 is the placeholder for all selectors you pass in.

<project default="test">

    <target name="prepare">
        <mkdir dir="zip"/>
        <echo file="zip/one.txt"   message="one"/>
        <echo file="zip/two.txt"   message="two"/>
        <echo file="zip/three.txt" message="three"/>
        <zip destfile="zip.zip" basedir="zip"/>
        <delete dir="zip"/>
    </target>

    <macrodef name="delFromZip">
        <attribute name="zip"/>
        <element   name="selectors" implicit="true" optional="true"/>
        <sequential>
            <mkdir dir="__tmp__"/>
            <unzip dest="__tmp__" src="@{zip}"/>
            <delete file="@{zip}"/>
            <delete>
                <fileset dir="__tmp__">
                    <selectors/>
                </fileset>
            </delete>
            <zip destfile="@{zip}" basedir="__tmp__"/>
            <delete dir="__tmp__"/>
        </sequential>
    </macrodef>

    <target name="test">
        <delFromZip zip="zip.zip">
            <include name="two.*"/> 
        </delFromZip>
    </target>

</project>

GUI-Output from Apache ant

14. Oktober 2008

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>

Google Summer of Code 2008

4. April 2008

Cool – some years ago I got the idea that refactoring support for Ant buildfiles would be nice and opened a feature request on Eclipse. Now (three years later) this (maybe) could be done in a GSoC project because now it is proposed by the Eclipse team.

IT-News 2007.10.22

22. Oktober 2007

German Article: advocate forbid to see the HTML source of their homepage
But I am not sure how they would bind people to load their page with a browser …

VirtualAnt is released.
There is a free license for open source projects.

Web-Harvest 1.0 released.
It seems to be a nice project and I should spend some time on converting my semi-manual website searches to full-automatic searches based on Web-Harvest and Newsreader (RSSOwl).

IT-News 2007.10.12

12. Oktober 2007

English Article: Visualizing Data: Self-Documenting Ant files
Several options to get an overview of an Ant buildfile: like JavaDoc, dependency graphs, XML based form layout …