2 Replies Latest reply on Nov 20, 2009 1:18 PM by PaulAtSfly

    Compiler.define in flex-config and compc

    PaulAtSfly Level 1

      I'm having an issue with compile time constants.  I'd like to define these constants in two places, but when I do the flex compiler forgets constants defined in my flex-config.xml (DEBUG::DEBUGGING and DEBUG::VERBOSE).  I am using flextasks.tasks in ant to build the project.

       

      In my build.xml:

      <target name="build-project" depends="init">
          <echo message="Building ${proj.swc.file}" />
             
          <compc output="${proj.target.dir.bin}/${proj.swc.file}"
              target-player="${proj.flashver}">
              <compiler.define name="INFO::VERSION_MAJOR" value="${proj.version.major}" />
              <compiler.define name="INFO::VERSION_MINOR" value="${proj.version.minor}" />
              <compiler.define name="INFO::VERSION_RELEASE" value="${proj.version.release}" />
              <compiler.define name="INFO::BUILD_TIMESTAMP" value="${proj.build.timestamp}" />
              <compiler.define name="INFO::BUILD_TIMEZONE" value="${proj.build.timezone}" />
              <load-config filename="${mx.sdk.dir}/frameworks/flex-config.xml"/>
              <load-config filename="${basedir}/flex-release-config.xml"/>
              <source-path path-element="${proj.build.dir.src}" />
              <include-sources dir="${proj.build.dir.src}" includes="**/*.as **/*.mxml"/>
              <!-- <compiler.external-library-path dir="${proj.build.dir.lib}" includes="*.swc" append="true" /> -->
              <compiler.external-library-path dir="${proj.target.dir.lib}" includes="*.swc" append="true" />
          </compc>
      </target>

       

      In flex-release-config.xml:

      <flex-config>
          <compiler>
              <debug>false</debug>
              <keep-generated-actionscript>false</keep-generated-actionscript>
              <verbose-stacktraces>false</verbose-stacktraces>
              <optimize>true</optimize>
             
              <define>
                  <!-- Enables debugging mode -->
                  <name>DEBUG::DEBUGGING</name>
                  <value>false</value>
              </define>
              <define>
                  <!-- Provides more information to the developer -->
                  <name>DEBUG::VERBOSE</name>
                  <value>false</value>
              </define>
          </compiler>
      </flex-config>

       

      If I compile using compc on the command line I can use -define+=NAME,value and it works.  Why is it not working using the compc task in ant?