Development Update: Added “nme setup”

This change is only on Subversion right now, but I wanted to share briefly about a new feature I added to the NME command line tools.

If you execute “haxelib run nme setup” from a command-line or terminal, it will add a script to your PATH (in the Haxe directory) that shortens the command string. Instead of having to call “haxelib run nme”, you can simply call “nme”.

This is a minor change, but if you’re working from a terminal, this may help save your fingers. In the future, I would like to have an NME installer, which will set this up automatically.

While most of the supported targets for NME work automatically, some targets — particularly Android — will not work unless some variables are set. In the past, it might have been possible to try and build NME for Android, only to receive a compiler error. Now it will throw an error that prompts you to run “nme android setup” first.

It’s simple, but I think it should help eliminate confusion. When you run “nme android setup”, it will prompt you for the path to your Android SDK, Android NDK, Apache Ant and Java JDK directories. If you hit enter instead of typing a value, it will keep the original. If the value was set in your system variables, it will leave them there and will not write a new copy in your .hxcpp_config.xml file.

The command will update your .hxcpp_config.xml automatically. It will preserve any custom include paths you set for HXCPP, as well as other defines you may have had set in the file.

There are other changes that have happened (and will happen), even since the recent 3.1 beta 2 release, but this was a little tidbit that I thought was worth mentioning. If you have more ideas for making NME even easier to install and use, we would love to hear all your suggestions here, on the forums, or on the mailing list.

  • Milo

    Keep up the good work! In my company, we start believing in haXe and NME for mobile applications!

  • Thanks! If you run into any bumps, or have ideas for how the workflow/process can be improved, I’d love to hear it (or even if you have something cool you’d like to show off 😉

  • Jerommeke

    Hi Joshua! Great work, like your blog. Starting to look into HaxeNME now. Was just wondering about a small thing: how do you let your trace output in your swf files appear on top of the flash movie itself when it plays, instead of in the output panel of FlashDevelop? 

    Keep it up! Gr.,John

  • Hi, and welcome!

    If you target Flash, trace messages will output on top of the SWF, and will not trace in FlashDevelop, by default. However, there is an easy way to redirect traces so that they will appear in FlashDevelop, so long as you are testing with the Flash target:

    http://www.haxenme.org/community/forums/general-discussion/debugger/re-debugger7/

  • Xander

    Hi Joshua, great work so far.
    When I try to run the command, I get the following error:
    C:UsersXander>haxelib run nme setup
    Unknown command: setup

    Regards,
    Xander

  • Sounds like you have an old version installed?

    You can run “haxelib list” to see which version of NME is currently active (it will be surrounded with brackets). NME 3.0.1 did not have this functionality, but NME 3.1.0 should have it.

    If you’re working off of SVN, you will need to rebuild the command-line tools, since the compiled script is no longer hosted on SVN.

    Otherwise, you can try the automated installer:

    http://www.haxenme.org/developers/get-started

  • Xander

    Hi Joshua, you are right. I had an old version installed.
    I really thought I installed 3.1.0, sorry about that 🙂

  • sixman9

    Hi Joshua,
    I would be very interested in looking at your ‘nme setup android’ routines, I’m intrigued as to what you’re doing to download/install/configure the SDK and NDK. Could you tell which source files I need to look at, thanks?

    Cheers

    Rich