My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
StandardHaxeTasks  
Options that affect all haxe tasks
Updated Nov 2, 2009 by wildwin...@gmail.com

The options given here affect all haxe compile tasks, which are currently:

The classpath and libs options affects the haxeEmbed task as well.

Main Entrypoint

You specify the main class involved in the haXe compile task using the main attribute:

<haxe2js main="App" out="app.js"/>

Working Directory

You can specify the working directory for the haXe compile operation by using the dir attribute, like so:

<haxe2swf dir="e:\mytest" main="App" out="app.swf"/>

Classpath

This mimics the syntax used by the Ant Java task - for more details take a look at the classpath reference on that page.

You can specify the classpath either via the attributes classpath or classpathref or the nested element classpath.

For example:

// classpath attribute
<haxe2neko main="App" out="app.n" classpath="test;test/src"/>

// classpath element
<haxe2neko main="App" out="app.n">
  <classpath>
    <pathelement location="test"/>
    <pathelement location="test/src"/>
  </classpath>
</haxe2neko>

// classpathref attribute
<path id="project.class.path">
  <pathelement location="test"/>
  <pathelement location="test/src"/>
</path>

<haxe2neko main="App" out="app.n" classpathref="project.class.path"/>

Haxelib Libs

To use libs from haxelib (i.e. the haxe -lib option) you can include nested lib elements within the haxe command:

<haxe2neko main="App" out="app.n">
  <lib name="anthx"/>
  <lib name="swhx" version="1.18"/>
</haxe2neko>

The only required attribute is name - the name of the library. Optionally, you can specify the version.

Dependency Checking

The haXe compile tasks which result in single output files (currently haxe2neko, haxe2swf and haxe2js) now have dependency checking turned on by default - i.e. if source files have not changed, the haxe compile will not be called.

You can turn this off by setting the attribute forceRebuild="true".

The dependencies are stored by default in a file in your system's temp folder. If you want to have control over where this file is placed, you can specify a different folder with cacheFolder="/path/to/some/folder"

Thanks to Gábor Szuromi for the dependency checking.

If/Unless

All these tasks support the if="{property name}" and unless="{property name}" attributes i.e.

<haxe2swf if="some.property" out="test.swf" main="Main"/>

will only execute if the Ant property some.property is set, and

<haxe2swf unless="some.property" out="test.swf" main="Main"/>

will only execute if the Ant property some.property is not set.

Thanks to Gábor Szuromi for this change.

Optional arguments

Because I'm not foolish enough to believe that I've even covered half of haxes command-line options - besides which, Nicolas is adding to them all the time - you can also specify any other command-line options to haxe that you choose using the arg element like so:

<haxe2neko main="App" out="app.n">
  <arg line="--neko-source"/>
</haxe2neko>

See the ant task Exec for more details of the syntax for arg.


Sign in to add a comment
Powered by Google Project Hosting