Aardvark for Java Only?

60 views
Skip to first unread message

McKinley

unread,
Feb 21, 2011, 12:15:16 PM2/21/11
to Aardvark
I would like to use Aardvark with Java only. Gosu looks great, but
until there are class files and natural access to Gosu from Java I
don't want to introduce it to my projects. I was looking at the source
code and there are very few Gosu files and if I understand correctly
there are all static enhancements to existing classes. The rest of the
Gosu code is the generated enum classes. Those could be generated to
Java just as easily.

If I want to use Aardvark without Gosu (with utility classes instead
of enhancements and Java enums) do you have a place in the project for
this? I know that writing the build files in Java will not be as
flexible as Gosu, but it is the best option for me right now.

Thanks,

McKinley

Carson Gross

unread,
Feb 21, 2011, 1:47:17 PM2/21/11
to aardv...@googlegroups.com
Aardvark is simply a build/system scripting tool, in Gosu, written on top of Ant. It can certainly be used to build a pure java project. An example of this the build script (which is very, very simple) for my protocols typeloader, which is a pure Java project:

https://github.com/protocols/protocols/blob/master/build.vark

Pretty simple transliteration of what the ant script would look like.

The latest releases of aardvark contain Ivy support to provide dependency management. You can look at ronin's vark file for an example:

https://github.com/kprevas/ronin/blob/master/build.vark

(Side note: I'm currently advocating that we remove the necessity for the ivy configuration files so you don't need any XML for your build system... Maybe I'll try to hack that together today.)

Cheers,
Carson

Carson Gross

unread,
Feb 21, 2011, 11:09:51 PM2/21/11
to aardv...@googlegroups.com, aardv...@googlegroups.com, mckinl...@gmail.com
Ah, yup. That's what reading email with a screaming one year old in the room will get you...

Sorry for the confusion. 

Cheers,
Carson

On Feb 21, 2011, at 7:03 PM, Brian Chang <bcha...@gmail.com> wrote:

Carson, I think you misinterpreted the question.  I'm pretty sure McKinley is asking for a way to write an Aardvark buildfile in Java, not necessarily for a way to build a Java project (which indeed is one of Aardvark's primary uses).

McKinley, unfortunately, I don't have an agreeable answer for you.  Aardvark is expressly built to take advantage of the Gosu type system and language - it's more tightly bound than you think.

Aardvark uses Gosu in order to parse the .vark build file and it then translates the program instance into an Ant Project.  We also use Gosu extensively to make Ant (and Ivy) tasks convenient to use.  For example, it's certainly possible to invoke an Ant task from some Java program; the code would look as such:

Copy copyTask = new Copy()
copyTask.setFile(myOrigFile)
copyTask.setTofile(myDestFile)
copyTask.execute()

While in Gosu/Aardvark, the same operation would be:

Ant.copy(:file = myOrigFile, :tofile = myDestFile)

If I understand correctly, your issues with coding Aardvark in Gosu come down to
  (1) inadequate editor support, and thus, lack of quality type-ahead help, and
  (2) insufficient documentation

Editor support will continue to improve over time, but it is admittedly weak at this time.  But for the shorter term, I've been meaning to place a top priority on thorough documentation - would that help significantly to encourage you to write your buildfiles in Gosu?


Brian Chang

unread,
Feb 21, 2011, 10:03:15 PM2/21/11
to aardv...@googlegroups.com, mckinl...@gmail.com
Carson, I think you misinterpreted the question.  I'm pretty sure McKinley is asking for a way to write an Aardvark buildfile in Java, not necessarily for a way to build a Java project (which indeed is one of Aardvark's primary uses).

McKinley, unfortunately, I don't have an agreeable answer for you.  Aardvark is expressly built to take advantage of the Gosu type system and language - it's more tightly bound than you think.

Aardvark uses Gosu in order to parse the .vark build file and it then translates the program instance into an Ant Project.  We also use Gosu extensively to make Ant (and Ivy) tasks convenient to use.  For example, it's certainly possible to invoke an Ant task from some Java program; the code would look as such:

Copy copyTask = new Copy()
copyTask.setFile(myOrigFile)
copyTask.setTofile(myDestFile)
copyTask.execute()

While in Gosu/Aardvark, the same operation would be:

Ant.copy(:file = myOrigFile, :tofile = myDestFile)

If I understand correctly, your issues with coding Aardvark in Gosu come down to
  (1) inadequate editor support, and thus, lack of quality type-ahead help, and
  (2) insufficient documentation

Editor support will continue to improve over time, but it is admittedly weak at this time.  But for the shorter term, I've been meaning to place a top priority on thorough documentation - would that help significantly to encourage you to write your buildfiles in Gosu?


On Mon, Feb 21, 2011 at 10:47 AM, Carson Gross <carso...@gmail.com> wrote:

McKinley

unread,
Feb 22, 2011, 4:18:34 AM2/22/11
to Aardvark


On Feb 21, 7:03 pm, Brian Chang <bchan...@gmail.com> wrote:
> code would look as such:
>
> Copy copyTask = new Copy()
> copyTask.setFile(myOrigFile)
> copyTask.setTofile(myDestFile)
> copyTask.execute()

I envision a Java version that would be

import lombok.val;
...
val copyTask = Ant.copy().file(myOrigFile).tofile(myDestFile);

Fluid interfaces aren't the most readable, but they are all you have
in Java.

> While in Gosu/Aardvark, the same operation would be:
>
> Ant.copy(:file = myOrigFile, :tofile = myDestFile)

After parsing, how are your tasks and accessors applied? Is it through
reflection?

> If I understand correctly, your issues with coding Aardvark in Gosu come
> down to
>   (1) inadequate editor support, and thus, lack of quality type-ahead help,
> and
>   (2) insufficient documentation

Editor support and documentation are not a problem. I just Gosu built
libraries usable from within Java code somewhat as if it where normal
Java libraries.

Thanks,

McKinley
Reply all
Reply to author
Forward
0 new messages