<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="/static/xsl/demos.xsl"?>
<demo title="Haxe Archetype">
<wiki>
= Introduction =

The Haxe Archetype project let's you start new [http://haxe.org Haxe] projects quickly.

If you are having trouble getting it via haxelib install, you can get a copy of [http://haxe-archetype.googlecode.com/files/archetype.zip archetype.zip] here instead.

''' HAXELIB INSTALL ISN'T WORKING! USE: haxelib test [http://haxe-archetype.googlecode.com/files/archetype.zip archetype.zip] FOR NOW!!!'''

= Installation + Quickstart =

Here is the quick and dirty:
</wiki>
<code> % sudo haxelib install archetype
 % haxelib run archetype create -artifactId=myProject -packageName=us.versus.them -version=1.0
 % cd myProject
 % haxe compile.hxml
 % ls myProject.swf
 myProject.swf
</code>

<wiki>

The arguments artifactId and packageName are mandatory.

If version is not set, it will default to 1.0.

If type is not set, it will default to flash.

In 1.0.1, artifacts are now handled by templated zip files to make the creation of new types of projects easier.  You can get a list of currently installed archetypes by running:
 
</wiki>
<code> % haxelib run archetype list
 types installed:
 * opengl
 * flash
</code>

<wiki>

== New opengl project ==
To create a new opengl project (for example):
</wiki>

<code> % haxelib run archetype create -type=opengl -artifactId=myProject -packageName=us.versus.them
 % cd myProject
 % haxe compile.hxml
 % ls app
</code>

<wiki>

For the morbidly curious:
</wiki>

<code> % find $( haxelib config ) -name "flash.zip"
 /usr/lib/haxe/lib/archetype/1,0,1/archives/flash.zip
</code>

If you create a new archetype or have an idea for one, drop me a line...

<wiki>
= Compilation + Packaging =
</wiki>

<code>% haxe compile.hxml
% cd ..
% zip -r myProject.zip myProject
</code>

<wiki>
You can install them into your local haxe library ala:

 % haxelib test myProject.zip


= Running Testcases =

Running unit tests is still a little clunky…

 % haxe test.hxml &amp;&amp; neko test.n

Unfortunately, you have to update Test.hx to add new tests. They can live in the tests subdirectory to keep them separate from the main code.

</wiki>

</demo>
