Thanks, Brian. I had figured out the "List"/"Blocks" convention from studying the limited examples and the Aardvark source. I wasn't getting much help from IntelliJ's assistance -- until just now, after an import was added:
uses gw.vark.antlibs.Ant. Whoops.
The plugin has been useful for flagging errors, however. That's how I learned that the DefaultTarget property's type is now a method reference instead of a string. I couldn't seem to get the right syntax for the feature literal -- I kept getting the error, "A method with the name build and types was not found" -- and then found that it was actually correct when I ran the script. When I created a minimal test case to reproduce the problem, there was no error. I eventually realized that the error occurred only when the feature literal matched the file name (e.g.,
DefaultTarget = #build() when the file is named build.vark). The bug isn't specific to Aardvark, so I created an issue for the Gosu plugin:
https://github.com/gosu-lang/Gosu-IntelliJ-Plugin/issues/10.
I still haven't figured out how to use the WaitFor task in an Aarvark script. The compiler is happy with this:
uses gw.vark.enums.WaitFor_Unit
uses org.apache.tools.ant.taskdefs.condition.Http
uses gw.vark.antlibs.Ant
function openfireCheck() {
var http = new Http()
Ant.waitfor(
:checkevery = 1,
:checkeveryunit = WaitFor_Unit.Second,
:maxwait = 20,
:timeoutproperty = "openfire.is.down",
:httpList = {http})
}
(I thought Gosu might let me create the Http instance more succinctly as
new Http() {:Url = "http://localhost:9090"}, but the compiler didn't like that. Does the object initializer syntax require a
getUrl() method, even though it's setting a property?)
Running the openfireCheck target resulted in this error:
java.lang.ClassCastException: org.apache.tools.ant.taskdefs.WaitFor cannot be cast to org.apache.tools.ant.Task
at gw.vark.typeloader.AntlibTypeInfo$TaskCallHandler.handleCall(AntlibTypeInfo.java:253)
at gw.internal.gosu.runtime.GosuRuntimeMethods.invokeMethodInfo(GosuRuntimeMethods.java:117)
at program_.__Program__0.openfireCheck(Unknown Source)
[...]
So I think I've finally given up on Aardvark for now. My knowledge of Gosu has improved after all this fumbling, but it would probably improve faster if I focused on writing actual application code. ;-)