Swc library file in application 'libs' folder

5 views
Skip to first unread message

HIlary Bridel

unread,
May 29, 2010, 9:43:35 AM5/29/10
to Antennae Discussion
Hi,
Antennae does not seem to compile any SWC files I have in a flex
application 'libs' folder.
How do I make this happen?

Daniel Rinehart

unread,
May 29, 2010, 10:22:40 AM5/29/10
to antennae-...@googlegroups.com
If you have SWCs that are in a "libs" folder that is part of your
project, you will need to define a path called flex.lib.path which
includes all of the files in that directory. This is a sample of what
would be added to your build.xml file (after the import lines):

<path id="flex.lib.path">
<fileset dir="libs" includes="*.swc"/>
</path>

Hope that helps.

-- Daniel R. <dan...@neophi.com> [http://danielr.neophi.com/]

> --
> You received this message because you are subscribed to the Google Groups "Antennae Discussion" group.
> To post to this group, send email to antennae-...@googlegroups.com.
> To unsubscribe from this group, send email to antennae-discus...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/antennae-discussion?hl=en.
>
>

Hilary Bridel

unread,
May 29, 2010, 10:34:18 AM5/29/10
to antennae-...@googlegroups.com
Thanks Daniel,
I am using one of the templates which already has the following, which points to an external library project.

   <path id="flex.lib.path">
        <pathelement location="${PFPLibrary.swc}"/>
    </path>

How do I implement your suggestion?

Also, I dont seem to be able to find much documentation on all of this.
Can you point me in the right direction?

Thanks again.

Hilary
--
--
Hilary

--

Daniel Rinehart

unread,
May 29, 2010, 12:16:53 PM5/29/10
to antennae-...@googlegroups.com
If you have specific SWCs you wish to include in addition to all of
the SWCs in a libs directory, you can combine the two as follows:

<path id="flex.lib.path">
<pathelement location="${PFPLibrary.swc}"/>

<fileset dir="libs" includes="*.swc"/>
</path>

Antennae is a set of best practices and helpful Ant targets and tasks
to make building AS3, Flex, and AIR projects easier. As it relies
heavily on Ant I'd strongly recommend the Ant User Manual for general
Ant syntax and concepts:

http://ant.apache.org/manual/index.html

For the intent behind Antennae the "Build Philosophy" section of the
README in the root of the distribution is a great place to start.

http://code.google.com/p/antennae/source/browse/trunk/Antennae/README.txt

Hilary Bridel

unread,
May 30, 2010, 3:36:31 AM5/30/10
to antennae-...@googlegroups.com
Thanks Daniel,
Looks like I have a lot of reading and learning to do.

Does Antennae have a target specifically for modules, or do I need to figure that one out myself?
I need to optimise separate flex projects that are modules, for the main application.

Thanks for you help and fast responses.

Hilary

--

Daniel Rinehart

unread,
May 31, 2010, 8:47:26 PM5/31/10
to antennae-...@googlegroups.com
To compile a module (that is a SWF with a root class of mx:Module or
ModuleBase) you use the standard MXML application build target of
"flex-application" provided your root class is an ".mxml" file. If you
have a module that uses an ".as" file as its root class you would
still use the "flex-application" build target but you would need to
override the default property value for "project.flex.application"
using the syntax (this must be placed before the first <import> line
in build.xml):

<property name="project.flex.application" value="MyModule.as" />

Hilary Bridel

unread,
Jun 1, 2010, 5:13:39 AM6/1/10
to antennae-...@googlegroups.com
Thanks Daniel,
That target does not include optimisation for a module. E.G -link-report and -load-externs.
Is there a target for that?

Hilary

--

Daniel Rinehart

unread,
Jun 1, 2010, 10:57:52 AM6/1/10
to antennae-...@googlegroups.com
There isn't a specific target for modules as the syntax is almost
identical to a standard MXMLC invocation. Antennae does provide a
facility to handle additional compiler options like "link-report" and
"load-externs". There are two properties "flex.mxmlc.options" and
"flex.compc.options" which can be set before the standard import and
can hold additional parameters that should be passed to the respective
compiler.

For your main application, to generate the link report you would add
the following to its build.xml:

<property name="flex.compc.options"
value="-link-report=${build.generated.dir}/report.xml" />

Likewise to reference that link report in the module you'd probably
want to define a build-assets.xml file that references the generated
file:

<property name="flex.compc.options"
value="-load-externs=${application.link.report}" />

Alternatively you could use relative paths. Hopefully that gives you
an idea of the next steps.

Hilary Bridel

unread,
Jun 1, 2010, 11:02:32 PM6/1/10
to antennae-...@googlegroups.com
Thanks Daniel,
Very helpful.

Regards

Hilary

--
Reply all
Reply to author
Forward
0 new messages