1

From Adobe's documentation:

To set the value of these constants in the flex-config.xml file, rather than on the command line, you write this as the following example shows:

<compiler> 
    <define append="true"> 
        <name>CONFIG::debugging</name> 
        <value>true</value> 
    </define> 
    <define append="true"> 
        <name>CONFIG::release</name> 
        <value>false</value> 
    </define> 
</compiler>

The problem is that compiler doesn't actually take them into account and giving me compilation errors like "Error: Access of undefined property debugging." since I have that in my ActionScript code.

If I define them via arguments ("-define+=CONFIG::debugging,true") everything is OK.

I thought maybe my config is not used at all, so I malformed it — mxmlc points that out. So config is actually loaded into compiler.

Any hints? Thank you.

average dev
  • 1,128
  • 7
  • 22

2 Answers2

2

I use the same approach for passing DEFINE params via loading custom-config and all works fine. I don't see error in the part of config you provided.

Here is my variant of config and mxmlc params:

-load-config tools/config-local.xml -dump-config=local-dumped-config.xml. 

Also check the dump config to be sure defines were included.

fsbmain
  • 5,267
  • 2
  • 16
  • 23
  • In dumped config there are no defines, but these lines (exactly, copied from there): ${flexlib}/${configname}-config.xml /Users/fljot/Development/Projects/BirdsWheel/build/metsaylem-config.xml – average dev Feb 15 '13 at 08:06
  • I can only advice you to test on demo project, all should works. There should be a simple solution for your issue, but it pretty hard to find it remotely. – fsbmain Feb 15 '13 at 08:41
  • Could you post respective part of your dumped config please? – average dev Feb 15 '13 at 08:52
  • It's 100% the same (in case I use -load-config+= rather than -load-config): ${flexlib}/${configname}-config.xml tools/config-local.xml but with defines. – fsbmain Feb 15 '13 at 09:59
  • Posted my answer, but still thank you for confirming the general idea. Upvoted. – average dev Feb 20 '13 at 10:34
0

So it was the XML problem — as I actually had strings, not booleans, in config — you should not forget to write the proper XML (weird that compiler didn't say me back anything).

<value>&quot;MyStringValue&quot;</value> 

Or easier:

<value>'MyStringValue'</value> 

And double-quoting ('"MyStringValue"') is when you're using arguments.

average dev
  • 1,128
  • 7
  • 22
  • Yes, I know about quoting issue for strings (had the same in my experience) but your example is with boolean values so I didn't consider it as a potential cause ) – fsbmain Feb 20 '13 at 11:20
  • And a note to myself: post the actual stuff, do not over-simplify =) – average dev Feb 20 '13 at 12:04