Search code examples
apache-flexmxmlc

How to specify linked resource folder in mxmlc compiler arguments?


I've got external folder with resources (graphics, movies, etc) which is shared between a couple of projects. I'm able to link this resource folder in FlashBuilder (as described in http://livedocs.adobe.com/flex/3/html/help.html?content=projects_5.html#155069). After that all the pathes to embeds are relative to the project, and that's the behaviour I want.

This linked resource appears in .project file as follows:

<linkedResources>
    <link>
        <name>resources</name>
        <type>2</type>
        <locationURI>DOCUMENTS/Shared/resources</locationURI>
    </link>
</linkedResources>

Note, that it isn't source folder and it is not included in compilerSourcePath tag.

The question is how can I specify resource linked folder in mxmlc command line arguments?

-source-path is not working here, relative pathes to embeds can not be resolved.


Solution

  • Seems like it's not possible and there's no such option. FlashBuilder somehow passes all the workaround to mxmlc java wrapper, therefore it knows where to search resources.

    In my project I used another method to achieve proper sharing of resources:

    1. Autobuild step, which copies images and extractes fla files to resource folder in each project form the source directory.
    2. All css files I moved to shared source folder (e.g. Common/css/main.css) - they are under source control. I added link to it via -source-path option.
    3. After that all relative pathes in css started to look like ../../resources/image.png in both projects.

    Maybe someone will find my experience helpful.