Skip to content

Instantly share code, notes, and snippets.

@savage69kr
Forked from jgranick/README.md
Created August 16, 2012 11:50
Show Gist options
  • Save savage69kr/3369577 to your computer and use it in GitHub Desktop.
Save savage69kr/3369577 to your computer and use it in GitHub Desktop.
How to setup Cordova support for NME

Install NME

First, go to http://www.haxenme.org/download and install NME.

Update to Beta

Since Cordova support is only in development builds, you will need to update your copy of the NME library. You still want to use the installer above, because it installs the dependencies in one step.

You can get the latest development build here:

http://www.haxenme.org/builds/latest/

Then you can update your local install like this:

haxelib test (path to zip)

Setup HTML5

Open a terminal or command-prompt, and run:

nme setup html5

Let it install Cordova for you when it asks. The public 2.0.0 release is broken, but hopefully it will be fixed for Cordova 2.0.1.

Compiling

You can build a project with Cordova by adding an "-html5" flag to the desired target. This will automatically call the "bin/create" tool for the specified Cordova platform, then the command-line tools for NME handle the compile, install and run process.

The following commands are currently supported:

nme test project.nmml blackberry -html5
nme test project.nmml blackberry -simulator -html5 
nme test project.nmml blackberry -bbos -html5
nme test project.nmml ios -html5
nme test project.nmml ios -simulator -html5

Samples

Here is a project that uses only Javascript:

http://github.com/jgranick/SampleJS

Here is a project that uses Haxe, compiled to Javascript:

http://github.com/jgranick/SampleHaxeJS

Here is a sample NME project that will work for native or HTML5:

http://github.com/jgranick/PiratePig

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment