Proposal: getenv in project.xml

Hi

setenv is already possible in project.xml, it would be great if getenv were also available and the value of it could be assigned to a define/variable.

Something like:

<getenv name="FLEX_HOME" define="flexhome" />
...
<haxeflag name="--swf-lib-extern" value="${flexhome}/frameworks/libs/framework.swc"/>

This is just an example of a use case.

Thanks
Cheers

1 Like

I was just looking into implementing this, but it actually looks like you can already access environment variables in project.xml. They’re basically the same as defines. For instance, if your system has a FLEX_HOME environment variable defined, you can simply reference it in project.xml with ${FLEX_HOME}.

Another example… I have Sublime Text set up as my default editor by setting the EDITOR environment variable. When I add the following to my project.xml and build the project:

<echo value="${EDITOR}"/>

It echoes subl -w to my console!

1 Like

Wow, that’s great!
Thank you