I couldn't agree with you more! :) once I resolve my current issues with null assets, I'm going to start trimming that config file down and merging the settings back into the ant build.
> From: [email protected] > To: [email protected] > Date: Sun, 24 Nov 2013 07:38:54 -0800 > Subject: Re: how to compile MXML module with ANT > > OK, I'm just saying that I don't think the answer is to create a full > config.xml file. It might have just been to set the source-paths > correctly. > > -Alex > > On 11/24/13 6:59 AM, "David Coleman" <[email protected]> wrote: > > >Hi Alex, thanks for your response. No worries, I wasn't expecting an > >instant response and less so on the weekend. :) > > > >I just answered my own question because I absolutely hate it when I'm > >searching the net and I find someone asking exactly the question that I > >need answered, but no answer is posted! :) > > > >I have a follow up question if you don't mind please. I'll send it in a > >new thread. > > > >> From: [email protected] > >> To: [email protected] > >> Date: Sat, 23 Nov 2013 21:02:56 -0800 > >> Subject: Re: how to compile MXML module with ANT > >> > >> > >> > >> On 11/23/13 6:05 PM, "David Coleman" <[email protected]> > >>wrote: > >> > >> >I will answer my own question. Finally HOURS AND HOURS later, I found > >> >the trick. > >> > > >> >I had to create an external config file and load it with > >> > > >> ><load-config filename="${basedir}/config/ModuleConfig.xml"/> > >> > > >> >the contents of ModuleConfig.xml re-define nearly every framework > >> >configuration. none of them seem non standard to me... > >> > > >> >Basically I just defined everything to be what it SHOULD be and loaded > >> >this config file after I apply the default flex-config.xml from the > >>sdk. > >> > > >> >I'm still quite confused as to why this worked. AFAIK, what I did was > >> >the equivalent of 1=1. > >> Hi David, > >> > >> Response times are generally slower on the weekend. > >> > >> From what I can tell from these snippets, the thing that you might have > >> messed up is the -source-path options. > >> > >> If I have a file in a folder structure like: > >> > >>c:\Work\projects\MyModule\src\com\foo\ISomeInterface.as > >> > >> and ISomeInterface is defined as: > >> > >> package com.foo > >> { > >> public interface ISomeInterface > >> { > >> } > >> } > >> > >> the source-path option you need to define is (in the ANT mxmlc > >>flex-task): > >> > >> > >> <source-path path-element="c:\Work\projects\MyModule\src"/> > >> > >> (I might have the slashed wrong, it's been a while since I've done this > >>on > >> Windows). > >> > >> It looks to me like you had path elements pointing to > >> c:\Work\projects\MyModule\src\com and > >> c:\Work\projects\MyModules\src\com\foo but then the package com.foo > >>lookup > >> from those path elements start looking for > >> c:\Work\projects\MyModule\src\com\com\foo and > >> c:\Work\projects\MyModule\src\com\foo\com\foo respectively, neither > >>which > >> exists. > >> > >> It looks like in your config.xml you finally did set source-path > >>correctly. > >> > >> Of course I could be wrong, but that's what it looks like from here. > >> > >> -Alex > >> > >> > > >> >I've opened a question on > >>http://forums.adobe.com/thread/1342158?tstart=0 > >> > > >> >but i can't answer my own question. > >> > > >> >Maybe Alex or someone can post the answer on my behalf and include my > >> >solution so that others with my problem can find an answer in the > >>future? > >> > > >> >here is my ModuleConfig.xml: > >> > > >> ><flex-config xmlns="http://www.adobe.com/2006/flex-config"> > >> > <compiler> > >> > <warn-no-constructor>false</warn-no-constructor> > >> > <accessible>true</accessible> > >> > <fonts> > >> > <managers> > >> > <manager-class>flash.fonts.JREFontManager</manager-class> > >> > <manager-class>flash.fonts.BatikFontManager</manager-class> > >> > <manager-class>flash.fonts.AFEFontManager</manager-class> > >> > <manager-class>flash.fonts.CFFFontManager</manager-class> > >> > </managers> > >> > </fonts> > >> > <source-path> > >> > <path-element>${basedir}/src/locale/{locale}</path-element> > >> > <path-element>${basedir}/src</path-element> > >> > </source-path> > >> > <debug>true</debug> > >> > <theme> > >> > > >><filename>${FLEX_HOME}frameworks/themes/Spark/spark.css</filename> > >> > </theme> > >> > <namespaces> > >> > <namespace> > >> > <uri>http://ns.adobe.com/mxml/2009</uri> > >> > > >><manifest>${FLEX_HOME}frameworks/mxml-2009-manifest.xml</manifest> > >> > </namespace> > >> > <namespace> > >> > <uri>library://ns.adobe.com/flex/spark</uri> > >> > <manifest>${FLEX_HOME}frameworks/spark-manifest.xml</manifest> > >> > </namespace> > >> > <namespace> > >> > <uri>library://ns.adobe.com/flex/mx</uri> > >> > <manifest>${FLEX_HOME}frameworks/mx-manifest.xml</manifest> > >> > </namespace> > >> > <namespace> > >> > <uri>http://www.adobe.com/2006/mxml</uri> > >> > <manifest>${FLEX_HOME}frameworks/mxml-manifest.xml</manifest> > >> > </namespace> > >> > </namespaces> > >> > <library-path> > >> > > >><path-element>${FLEX_HOME}frameworks/locale/{locale}</path-element> > >> > <path-element>${FLEX_HOME}frameworks/libs/rpc.swc</path-element> > >> > <path-element>${FLEX_HOME}frameworks/libs/osmf.swc</path-element> > >> > > >><path-element>${FLEX_HOME}frameworks/libs/spark.swc</path-element> > >> > > >><path-element>${FLEX_HOME}frameworks/libs/charts.swc</path-element> > >> > > >> ><path-element>${FLEX_HOME}frameworks/libs/framework.swc</path-element> > >> > > >> ><path-element>${FLEX_HOME}frameworks/libs/spark_dmv.swc</path-element> > >> > > >> ><path-element>${FLEX_HOME}frameworks/libs/sparkskins.swc</path-element> > >> > > >> ><path-element>${FLEX_HOME}frameworks/libs/textLayout.swc</path-element> > >> > > >> > >>><path-element>${FLEX_HOME}frameworks/libs/advancedgrids.swc</path-elemen > >>>t> > >> > > >> > >>><path-element>${FLEX_HOME}frameworks/libs/authoringsupport.swc</path-ele > >>>me > >> >nt> > >> > > >> > >>><path-element>${FLEX_HOME}frameworks/libs/flash-integration.swc</path-el > >>>em > >> >ent> > >> > > >><path-element>${FLEX_HOME}frameworks/libs/mx/mx.swc</path-element> > >> > <!-- > >> > redacted because these are our private proprietary libraries. > >> > here you would add your main application's libraries as well as > >>any > >> >external swc's > >> > from other flex/as3 lib projects > >> > --> > >> > </library-path> > >> > <external-library-path> > >> > > >> > >>><path-element>${FLEX_HOME}frameworks/libs/player/10.2/playerglobal.swc</ > >>>pa > >> >th-element> > >> > </external-library-path> > >> > <locale> > >> > <locale-element>en_US</locale-element> > >> > <locale-element>es_ES</locale-element> > >> > <locale-element>fr_FR</locale-element> > >> > <locale-element>it_IT</locale-element> > >> > </locale> > >> > </compiler> > >> > <target-player>10.2</target-player> > >> > <swf-version>11</swf-version> > >> > > >> > >>><static-link-runtime-shared-libraries>false</static-link-runtime-shared- > >>>li > >> >braries> > >> > <runtime-shared-library-path> > >> > > >><path-element>${FLEX_HOME}frameworks/libs/framework.swc</path-element> > >> > > >> > >>><rsl-url>http://fpdownload.adobe.com/pub/swz/flex/4.5.1.21328/framework_ > >>>4. > >> >5.1.21489.swz</rsl-url> > >> > > >> > >>><policy-file-url>http://fpdownload.adobe.com/pub/swz/crossdomain.xml</po > >>>li > >> >cy-file-url> > >> > <rsl-url>framework_4.5.1.21489.swz</rsl-url> > >> > <policy-file-url /> > >> > </runtime-shared-library-path> > >> > <runtime-shared-library-path> > >> > > >> ><path-element>${FLEX_HOME}frameworks/libs/textLayout.swc</path-element> > >> > > >> > >>><rsl-url>http://fpdownload.adobe.com/pub/swz/tlf/2.0.0.232/textLayout_2. > >>>0. > >> >0.232.swz</rsl-url> > >> > > >> > >>><policy-file-url>http://fpdownload.adobe.com/pub/swz/crossdomain.xml</po > >>>li > >> >cy-file-url> > >> > <rsl-url>textLayout_2.0.0.232.swz</rsl-url> > >> > <policy-file-url /> > >> > </runtime-shared-library-path> > >> > <runtime-shared-library-path> > >> > <path-element>${FLEX_HOME}frameworks/libs/osmf.swc</path-element> > >> > > >> > >>><rsl-url>http://fpdownload.adobe.com/pub/swz/flex/4.5.1.21328/osmf_1.0.0 > >>>.1 > >> >6316.swz</rsl-url> > >> > > >> > >>><policy-file-url>http://fpdownload.adobe.com/pub/swz/crossdomain.xml</po > >>>li > >> >cy-file-url> > >> > <rsl-url>osmf_1.0.0.16316.swz</rsl-url> > >> > <policy-file-url /> > >> > </runtime-shared-library-path> > >> > <runtime-shared-library-path> > >> > <path-element>${FLEX_HOME}frameworks/libs/spark.swc</path-element> > >> > > >> > >>><rsl-url>http://fpdownload.adobe.com/pub/swz/flex/4.5.1.21328/spark_4.5. > >>>1. > >> >21489.swz</rsl-url> > >> > > >> > >>><policy-file-url>http://fpdownload.adobe.com/pub/swz/crossdomain.xml</po > >>>li > >> >cy-file-url> > >> > <rsl-url>spark_4.5.1.21489.swz</rsl-url> > >> > <policy-file-url /> > >> > </runtime-shared-library-path> > >> > <runtime-shared-library-path> > >> > > >> ><path-element>${FLEX_HOME}frameworks/libs/sparkskins.swc</path-element> > >> > > >> > >>><rsl-url>http://fpdownload.adobe.com/pub/swz/flex/4.5.1.21328/sparkskins > >>>_4 > >> >.5.1.21328.swz</rsl-url> > >> > > >> > >>><policy-file-url>http://fpdownload.adobe.com/pub/swz/crossdomain.xml</po > >>>li > >> >cy-file-url> > >> > <rsl-url>sparkskins_4.5.1.21328.swz</rsl-url> > >> > <policy-file-url /> > >> > </runtime-shared-library-path> > >> > <runtime-shared-library-path> > >> > <path-element>${FLEX_HOME}frameworks/libs/rpc.swc</path-element> > >> > > >> > >>><rsl-url>http://fpdownload.adobe.com/pub/swz/flex/4.5.1.21328/rpc_4.5.1. > >>>21 > >> >328.swz</rsl-url> > >> > > >> > >>><policy-file-url>http://fpdownload.adobe.com/pub/swz/crossdomain.xml</po > >>>li > >> >cy-file-url> > >> > <rsl-url>rpc_4.5.1.21328.swz</rsl-url> > >> > <policy-file-url /> > >> > </runtime-shared-library-path> > >> > <runtime-shared-library-path> > >> > <path-element>${FLEX_HOME}frameworks/libs/charts.swc</path-element> > >> > > >> > >>><rsl-url>http://fpdownload.adobe.com/pub/swz/flex/4.5.1.21328/charts_4.5 > >>>.1 > >> >.21328.swz</rsl-url> > >> > > >> > >>><policy-file-url>http://fpdownload.adobe.com/pub/swz/crossdomain.xml</po > >>>li > >> >cy-file-url> > >> > <rsl-url>charts_4.5.1.21328.swz</rsl-url> > >> > <policy-file-url /> > >> > </runtime-shared-library-path> > >> > <runtime-shared-library-path> > >> > > >><path-element>${FLEX_HOME}frameworks/libs/spark_dmv.swc</path-element> > >> > > >> > >>><rsl-url>http://fpdownload.adobe.com/pub/swz/flex/4.5.1.21328/spark_dmv_ > >>>4. > >> >5.1.21328.swz</rsl-url> > >> > > >> > >>><policy-file-url>http://fpdownload.adobe.com/pub/swz/crossdomain.xml</po > >>>li > >> >cy-file-url> > >> > <rsl-url>spark_dmv_4.5.1.21328.swz</rsl-url> > >> > <policy-file-url /> > >> > </runtime-shared-library-path> > >> > <runtime-shared-library-path> > >> > <path-element>${FLEX_HOME}frameworks/libs/mx/mx.swc</path-element> > >> > > >> > >>><rsl-url>http://fpdownload.adobe.com/pub/swz/flex/4.5.1.21328/mx_4.5.1.2 > >>>14 > >> >89.swz</rsl-url> > >> > > >> > >>><policy-file-url>http://fpdownload.adobe.com/pub/swz/crossdomain.xml</po > >>>li > >> >cy-file-url> > >> > <rsl-url>mx_4.5.1.21489.swz</rsl-url> > >> > <policy-file-url /> > >> > </runtime-shared-library-path> > >> > <runtime-shared-library-path> > >> > > >> > >>><path-element>${FLEX_HOME}frameworks/libs/advancedgrids.swc</path-elemen > >>>t> > >> > > >> > >>><rsl-url>http://fpdownload.adobe.com/pub/swz/flex/4.5.1.21328/advancedgr > >>>id > >> >s_4.5.1.21328.swz</rsl-url> > >> > > >> > >>><policy-file-url>http://fpdownload.adobe.com/pub/swz/crossdomain.xml</po > >>>li > >> >cy-file-url> > >> > <rsl-url>advancedgrids_4.5.1.21328.swz</rsl-url> > >> > <policy-file-url /> > >> > </runtime-shared-library-path> > >> > <file-specs> > >> > > >> > >>><path-element>${APP_ROOT}/src/@{module-package}/@{module-name}.mxml</pat > >>>h- > >> >element> > >> > </file-specs> > >> > <output>${DEPLOY_DIR}/@{out-path}/@{module-name}.swf</output> > >> ></flex-config> > >> > > >> >> From: [email protected] > >> >> To: [email protected] > >> >> Subject: RE: how to compile MXML module with ANT > >> >> Date: Sat, 23 Nov 2013 18:02:51 -0300 > >> >> > >> >> Just to add a little information here. I have been trying to make > >>this > >> >>work all day. If i remove the "implements" from my module component, > >> >>then the Interfaces inside my module are not found. I have searched > >>on > >> >>google all day and tried everything I know of. The few references > >>that > >> >>I find online are from people who have asked the question and never > >> >>received an answer. This tells me that I'm doing something incredibly > >> >>dumb or that there is some undocumented trick here. > >> >> > >> >> Can anyone please help me? > >> >> > >> >> > From: [email protected] > >> >> > To: [email protected] > >> >> > Subject: how to compile MXML module with ANT > >> >> > Date: Sat, 23 Nov 2013 14:58:08 -0300 > >> >> > > >> >> > Hi, I'm experiencing a problem and it has me completely baffled. > >> >> > > >> >> > BTW: sorry if you receive this twice. I accidentally sent it to > >>the > >> >>old flex-users@incubator... list... I'm posting again here to make > >>sure > >> >>I do in fact get my question out to the community. > >> >> > > >> >> > I have a project using flex4.5.1A > >> >> > > >> >> > it has many modules. > >> >> > > >> >> > I have set up an ant script with builds the main swf perfectly. > >> >> > > >> >> > I'm now trying to set up the building of the modules. > >> >> > > >> >> > I have the module defined as such: > >> >> > > >> >> > <?xml version="1.0" encoding="utf-8"?> > >> >> > <s:Module xmlns:fx="http://ns.adobe.com/mxml/2009" > >> >> > xmlns:s="library://ns.adobe.com/flex/spark" > >> >> > xmlns:mx="library://ns.adobe.com/flex/mx" > >> >> > implements="com.------.modules.IVolatileAssets" > >> >> > width="400" height="300" > >> >> > creationComplete="onDummy(event)" > >> >> > > > >> >> > > >> >> > the interface IVolatileAssets is in the same package as the module > >> >>itself. In FlashBuilder this compiles perfectly. It works perfectly > >> >>too. we have it IN PRODUCTION TODAY and millions of ppl use it daily. > >> >> > > >> >> > when I use the following ANT build script: > >> >> > > >> >> > <macrodef name="buildModule"> > >> >> > <attribute name="module-name" default="none" /> > >> >> > <attribute name="module-package" default="none" /> > >> >> > <attribute name="out-path" default="." /> > >> >> > <sequential> > >> >> > <echo message="building @{module-name} to > >> >>@{out-path}/@{module-name}.swf" /> > >> >> > <mxmlc > >> >>file="${APP_ROOT}/src/@{module-package}/@{module-name}.mxml" > >> >> > > >> >>output="${DEPLOY_DIR}/@{out-path}/@{module-name}.swf" > >> >> > keep-generated-actionscript="false" > >> >> > incremental="false" > >> >> > debug="true" > >> >> > load-externs="${ANT_ROOT}/link-report.xml" > >> >> > > > >> >> > <load-config > >> >>filename="${FLEX_HOME}/frameworks/flex-config.xml"/> > >> >> > <source-path > >>path-element="${FLEX_HOME}/frameworks"/> > >> >> > <source-path > >> >>path-element="${APP_ROOT}/src/@{module-package}"/> > >> >> > <source-path > >> >>path-element="${APP_ROOT}/src/@{module-package}/interfaces"/> > >> >> > <compiler.library-path dir="${HOF_COMMON_ROOT}" > >> >>append="true"> > >> >> > <include name="bin"/> > >> >> > </compiler.library-path> > >> >> > <compiler.library-path dir="${APP_ROOT}" > >> >>append="true"> > >> >> > <include name="libs"/> > >> >> > </compiler.library-path> > >> >> > <compiler.library-path > >>dir="${FLEX_HOME}/frameworks" > >> >>append="true"> > >> >> > <include name="libs" /> > >> >> > <include name="../bundles/{locale}" /> > >> >> > </compiler.library-path> > >> >> > <source-path > >> >>path-element="${APP_ROOT}/src/locale/{locale}"/> > >> >> > </mxmlc> > >> >> > </sequential> > >> >> > </macrodef> > >> >> > > >> >> > <target name="modulesDebug" depends="lobbyDependencies" > >> >>description="Build the lobby modules for debug"> > >> >> > <buildModule module-name="VolatileAssets" > >> >>module-package="com/-----/modules" out-path="modules3"/> > >> >> > </target> > >> >> > > >> >> > i get the following error: > >> >> > > >> >> > [mxmlc] > >> > >>>>F:\var\projects\hof\svn2.------.com\lobby\branches\3.1.39.0\src\com\hof > >>>>\l > >> >>obby\modules\VolatileAssets.mxml(-1): Error: Interface > >>IVolatileAssets > >> >>was not found. > >> >> > [mxmlc] <?xml version="1.0" encoding="utf-8"?> > >> >> > > >> >> > BUILD FAILED > >> >> > > >> > >>>>F:\var\projects\hof\svn2.--------.com\lobby\branches\3.1.39.0\build.xml > >>>>:9 > >> >>7: The following error occurred while executing this line: > >> >> > > >> >> > I have redacted the lines where our URL is shown for obvious > >>reasons. > >> >> What I don't understand AT ALL is how this interface could not be > >> >>found. it is in the same folder as my module file, and the mxmlc task > >> >>does not have the -includes-sources option to force it to be included. > >> >> > > >> >> > Am I missing something obvious? > >> >> > > >> >> > Thank you in advance for any advice. > >> >> > > >> >> > >> > > >> > > >
