So, what it is all about?

Flaka is a contribution to Ant, the popular build system. When plugged into Ant, build scripts can be written using:

  • Control structures (when, for, switch, ..)
  • Exception handling
  • An Expression Language which in turn provides:
    • access to underlying data objects
    • variables in addition to Ant properties
    • powerfull expressions
  • Additional tasks, types and macros

Where to go from here?

Flaka is ready to be used. Download latest version and follow the installation instructions laid out in Flaka’s manual.

Teaser

This is the programming task to solve:

  1. Firstly there should be a kind of greeting saying who we are. Who we are is given by the project name – if any is given. If no project name is given, we would just greet with Hello only.
  2. In addition, all files and folders in the folder containing the build script shall be listed along with their last modification time.

And this would be the Flaka way of doing it:

<project xmlns:c="antlib:it.haefelinger.flaka" name="Flaka" default="package">
<c:logo>
        ;; Part1: do a greeting
        Hello #{ project.name ? project.name : ''}!
 </c:logo>
 <c:for var="f" in=" ''.tofile.list ">
     <c:echo>
        ;; report file name and modification time
        file #{f.name} last modified: #{ f.mtime }
     </c:echo>
   </c:for>
</project>

When executed, it will dump something like

[c:logo] ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
[c:logo] :                           Hello Flaka !                       :
[c:logo] ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
[c:echo] file .svn last modified: Wed Feb 24 11:12:28 CET 2010
[c:echo] file ant-flaka.jar last modified: Wed Feb 24 11:12:37 CET 2010
 ..

Project Goal

The project’s goal is to simplify writing build scripts. The framework is based on collected experiences made at the European Patent Office. There, a large amount of scripts were changed in order to adopt them for the build system “Darwin”. Since build scripts were traditionally written by team members scripts differed considerable from each other and almost all of them were hard to read and understand. This seems to be inevitable when writing reasonable Ant scripts. Instead of rewriting the scripts in Ant, Maven was given a try. Maven gained recently a lot of popularity due to its declarative approach instead of a procedural as Ant does. Writing a build script in Maven is therefore as simple as teaching Maven about the project structure – at least as long the project follows certain constrains imposed by the Maven team. In cases where this constraints are violated, using Maven can become nightmarish. In such cases, one wishes to have the procedural approach of Ant back.

Flaka tries to solve the problem by providing a framework which automatically recognizes the project structure and then would do the right thing. In order to implement such a framework in Ant, Ant needs to be extended. Flaka extends Ant by providing well known control structures and an expression language to glue thing together.

Technologies

Ant
A popular tool for carrying our tasks, typically the tasks of compiling, testing and packaging a project, i.e. building a project. Tasks are written described using XML. The underlying programming language, also the language to be used when extending Ant, is Java.
Java
A well known programming language developed by Sun.
XML
A universal data structure language.