Skip to content

Instantly share code, notes, and snippets.

@jgranick
Created August 8, 2012 22:44
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jgranick/3299508 to your computer and use it in GitHub Desktop.
Save jgranick/3299508 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.

Development Builds

Since Cordova support is a beta feature, we will continue to improve NME's support of Cordova over time. If you want, you can get the latest development build here:

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

Assuming you already installed NME using the full installer, you can update to a development build 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