Using a Haxe Define for project.xml value

I’m wanting to use an OpenFL compiler argument (as in -Dversion=3.0.2) for a version value in the meta node in project.xml. I tried using “${version}” but that only seems to work when setting conditionals in the xml as in . Is there any way to apply the define to a project.xml value? Thanks.

If I am understanding you correctly, you might want to set the define from within the project.xml like so:

<haxedef name="specialmode" />

Then you can use that as a condition elsewhere in the xml:

<template path="assets/config.xml" unless="specialmode" />
<template path="assets/config2.xml" if="specialmode" />

Does that help?

In your case I think haxeflag is what you want

<haxeflag name="-Dversion" value="3.0.2" />

Full documentation of project.xml is here: https://lime.software/docs/project-files/xml-format/

1 Like

You might instead consider using a <set> or <define> tag which allow for handy access of their data.

Thanks, Confidant. I ended up doing it using , but my goal was to apply a haxe define to the version value for the meta tag as in version="${-Dversion}" which doesn’t work. The documentation doesn’t indicate how to apply a haxe define value as a value in the xml. I am looking for a way to update the version number of builds by passing it as a compiler argument as in “openfl build ios -Dversion=3.0.2”