Ok, i solved my problem. In fact, I don't use FlexAntTask anymore which is
definitevely useless in my mind, just the executables, config file (xml) and
build.properties.
SOLUTION:
To give variables to the config.xml loaded by "-load-config", add arguments
to the compiler executable (mxmlc or compc) like that:
"+myVarName=myVarValue"
Then access the variable as usual : ${myVarName}
No need to access environment var since we can do that ofc :)
--
Yannick Lacaute
On Wed, Dec 2, 2009 at 8:56 AM, Yannick Lacaute
<[email protected]>wrote:
> Hi, I am using FlexAntTask and I am using a custom config.xml, given to
> mxmlc like this:
>
> <mxmlc ... >
> <load-config filename="${APP_ROOT_DIR}/${APP_CONFIG_FILE}"/>
> <compiler.source-path path-element="${SRC_DIR}"/>
> </mxmlc>
>
> It works, but i can't use environment variables in the config.xml, unless
> ${FLEX_HOME} !!
>
> <flex-config>
> <compiler>
> <library-path>
> ...
>
> <path-element>${FLEX_HOME}/frameworks/libs</path-element>
>
>
> <path-element>${THORPORA_HOME}/swc/org/thorpora/lib/ThorporaUILib.swc</path-element>
> </library-path>
> ...
>
> The ${THORPORA_HOME} make this error (in french yeah ^^) :
> [mxmlc] D:\workspace\ThorporaTextEditorLibTest\build.app.xml(23): Erreur:
> la valeur de la variable de configuration compiler.library-path contient le
> jeton inconnu THORPORA_HOME
> [mxmlc] </library-path>
>
>
> At the begenning of my ant script, I check environment variables and we can
> see:
>
> prepare:
> [echo] PROJECT.TYPE set to Application
> [echo] PROJECT.NAME set to ThorporaTextEditorLibTest
> [echo] FLEX_HOME set to D:\app\Adobe\flex_sdk_4.0.0.10485
> [echo] ANT_HOME set to D:\app\apache-ant-1.7.1
> [echo] THORPORA_HOME set to D:\workspace\ThorporaHome
>
> Both ${FLEX_HOME} and ${THORPORA_HOME} are correct, but only ${FLEX_HOME}
> works.
>
> I tryied a lot's of others name like "${TEST}", "$TEST", {TEST}, in user
> and system environment, with machine reboot, etc, only ${FLEX_HOME} works...
> (!!)
>
> Is that a bug ? Can't we use an environment variable in a custom config.xml
> ? (or just a variable from the build.xml ^^)
> Can you tell where are the best places to post this kind of problem ?
>
> It's stange becasue flex-config.xml use things like
> {targetPlayerMajorVersion}, it is a variable, so it should be possible to do
> same... do you know whre is defined targetPlayerMajorVersion ?
>
> Sorry, many questions... :)
> Thanks.
>
> --
> Yannick Lacaute
>
>