Flex dependencies can't be made external in SWCs

Patrick Mowrer's Avatar

Patrick Mowrer

26 Oct, 2012 09:56 PM

First of all, thanks for building this very promising build tool!

I've ran into an issue where I can't seem to get Gradle to externalize Flex framework dependencies: they're always compiled in, even if I explicitly declare frameworkLinkage=external.

Simple reproduction:

  • Create a class that extends from any Flex component, for example spark.components.Group, in /src/main/actionscript.

  • Create a build.gradle file that declares type='swc'

Flash Builder, using external framework linkage, will produce a 2kb SWC from this, whereas Gradle's is 408kb.

I used SDK 4.5.1.21328 to reproduce this.

  1. Support Staff 1 Posted by Yennick Trevels on 26 Oct, 2012 11:25 PM

    Yennick Trevels's Avatar

    Hi Patrick,

    This is indeed a bug in GradleFx. I got a fix for this in GradleFx itself so this will be in the next GradleFx version which will be released maybe this weekend (but next week is more likely).

    What you can do in the meantime is this:

    additionalCompilerOptions = [
    "-runtime-shared-library-path=",
    "-external-library-path+=${flexHome}/frameworks/libs/framework.swc",
    "-external-library-path+=${flexHome}/frameworks/libs/textLayout.swc",
    "-external-library-path+=${flexHome}/frameworks/libs/spark.swc",
    "-external-library-path+=${flexHome}/frameworks/libs/sparkskins.swc",
    "-external-library-path+=${flexHome}/frameworks/libs/rpc.swc",
    "-external-library-path+=${flexHome}/frameworks/libs/charts.swc",
    "-external-library-path+=${flexHome}/frameworks/libs/spark_dmv.swc",
    "-external-library-path+=${flexHome}/frameworks/libs/osmf.swc",
    "-external-library-path+=${flexHome}/frameworks/libs/mx/mx.swc",
    "-external-library-path+=${flexHome}/frameworks/libs/advancedgrids.swc",
    ]
    
  2. 2 Posted by Patrick Mowrer on 29 Oct, 2012 04:04 PM

    Patrick Mowrer's Avatar

    Thanks Yennick for the quick reply and the workaround!

  3. Yennick Trevels closed this discussion on 29 Oct, 2012 09:40 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac