You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Stefan Bodewig <bo...@apache.org> on 2008/10/30 12:56:05 UTC

JavFront ProjectHelper

On Wed, 29 Oct 2008, Matt Benson <gu...@yahoo.com> wrote:

--- Stefan Bodewig <bo...@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


Re: JavFront ProjectHelper

Posted by Stefan Bodewig <bo...@apache.org>.
On Thu, 30 Oct 2008, Kevin Jackson <fo...@gmail.com> wrote:

>> I'm not doing OO stuff, the build file is a Java source.
> 
> I suppose it would be possible to do the same using JavaScript as
> the language?

Not by taking the same approach, but probably similar.

> All you would need is a dependency on Rhino +BSF or Java6. - It
> would be interesting to see how hard HelloWorld is (/me puts on huge
> list of things todo..)

A Clojure version is on mine 8-)

Stefan

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


Re: JavFront ProjectHelper

Posted by Kevin Jackson <fo...@gmail.com>.
> I'm not doing OO stuff, the build file is a Java source.

I suppose it would be possible to do the same using JavaScript as the
language? All you would need is a dependency on Rhino +BSF or Java6. -
It would be interesting to see how hard HelloWorld is (/me puts on
huge list of things todo..)

> 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.

Looks really nice

Kev

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