ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <bode...@apache.org>
Subject JavFront ProjectHelper
Date Thu, 30 Oct 2008 11:56:05 GMT
On Wed, 29 Oct 2008, Matt Benson <gudnabrsam@yahoo.com> wrote:

--- Stefan Bodewig <bodewig@apache.org> wrote:

>> My "build file" is going to look like this (I'm
>> making up half of it):
>> 
> 
> This looks like it's friends with my concept of an Ant
> DSL except mine is pretty much just a de-XMLization of
> the status quo, no OO stuff as you show above.

I'm not doing OO stuff, the build file is a Java source.

I've committed an embryonic version to the sandbox[1] which right now
doesn't have the convenience base class I envision and doesn't have
the TaskBuilder (or probably better TagBuilder) library to create
tasks, yet.

But a few things it can do:

$ cat src/etc/examples/Simple2.java
package org.example;

import org.apache.ant.javafront.annotations.AntProject;
import org.apache.ant.javafront.annotations.AntTarget;

import org.apache.tools.ant.Project;

@AntProject()
public class Simple2 {
    private final Project p;

    public Simple2(Project p) {
        this.p = p;
    }

    @AntTarget(Name="hello", Description="says hello", Depends="nonsense")
    public void foo() {
        p.log("Hello, world!");
        p.log("This is " + p.getProperty("ant.version") + " calling.");
    }

    @AntTarget public void nonsense() {}
}
$ ant -lib build/lib/ant-javafront-0.1.jar -f src/etc/examples/Simple2.java -projecthelp
Buildfile: src\etc\examples\Simple2.java
     [null] Compiling 1 source file to c:\DOKUME~1\STEFAN~1.BOD\LOKALE~1\Temp\ja
vafront
Main targets:

 hello  says hello

$ ant -lib build/lib/ant-javafront-0.1.jar -f src/etc/examples/Simple2.java hello
Buildfile: src\etc\examples\Simple2.java

nonsense:

hello:
Hello, world!
This is Apache Ant version 1.7.1 compiled on June 27 2008 calling.

BUILD SUCCESSFUL
Total time: 0 seconds

Stefan

who feels like he is exposing a toy project too early.

[1] http://svn.apache.org/repos/asf/ant/sandbox/javafront/

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


Mime
View raw message