Setting -Dnext in project.xml

Context: I’m using HaxeFlixel and building with a project.xml file. What’s the correct way to set -Dnext in project.xml? Which of the below options do I need?

  1. <set name="next" value="true"/>
  2. <set name="openfl_next" value="true"/>
  3. <haxedef name="next" />
  4. <haxedef name="openfl_next" />

This should work (without dots):

<set name="next"/>
<haxelib name="flixel"/>

Cool, thanks. Follow-up question: is there a way that I can definitively tell that I’m running OpenFL vNext? Is there some value I can trace, for example?

Newer versions of Lime support <define />

<define name="next" />

However, please be aware that -Dnext has not been a part of OpenFL since OpenFL 2. That was the last time we had an “OpenFL Next”. I’m just pointing this out just so you know this is a HaxeFlixel-specific define.

OpenFL 4 and greater removed the legacy code branch. OpenFL 3 has openfl-legacy and lime-legacy defines that may be enabled. The following might work

var isLegacy = #if ((openfl < "4.0.0") && openfl_legacy) true #else false #end;

Then you should be able to detect if you are running in OpenFL 3 -Dlegacy mode, or not.