-
Notifications
You must be signed in to change notification settings - Fork 13
Documentation
An Aardvark build file is no different, in structure, from a Gosu program file. You may define variables and functions, and write statements to be executed with every run.
Aardvark will interpret certain functions as targets to be executed by the Ant project engine. To mark a function as a target, annotate it with @Target
. However, Aardvark will automatically consider a function to be a target if (1) it's in the .vark file (you can actually define targets elsewhere, more later), and (2) it's public and has no parameters. When your function has a camel case name, Aardvark will convert it to a hyphenated style to be more Ant-like. Both styles of the names will available. For example a function named "iLikeAardvark" will be available as "i-like-aardvark".
If you apply a Javadoc-style description of your target function, the target and its description will show up when you run vark -p
. This matches Ant's behavior, with the description
attribute for the target
XML element.
Ever wanted a target to take parameters? Can't be done in Ant, but you can in Aardvark! Say you have a target foo
defined as such:
@Target
function add(a : int, b : int = 0) {
print(a + b)
}
And you would call it in this way:
vark add -a 2 -b 2
Bear in mind that Gosu functions support default values, and it's likely a good practice to make use of them for target parameters.
Yes.
See Ant Basics