Question

In Flash Builder 4.6, when managing a Flex project, under the Build Path options for a Flex Library Project, I can select between "external" and "Merged into code" Framework linkage, with "external" being the default.

How can I use external linkage when calling compc directly?

It seems like compc by default puts the Flex components in the library-path section instead of in the external-library-path section (looking at the generated -dump-config file).

It seems like the option available in Flash Builder ought to be accessible through some option on compc or through some combination of arguments. I've looked through the compc options documentation and unfortunately have come up empty. Any help would be appreciated.

Was it helpful?

Solution

First have a look at the flex-config.xml file. You'll find it in [flex_sdk_path]/frameworks/flex-config.xml. Now find the nodes called runtime-shared-library-path. Here you'll find a list of all the libraries that will be merged when you compile with compc (the nodes are called runtime-shared-library-path because RSL is the default linkage when you use mxmlc). These are the files that you need to link externally.

You have two options to do this:

  1. Create your own config file in which you translate all those runtime-shared-library-path nodes to external-library-path nodes. Load this file instead of the default by adding -load-config=my-config.xml to the compiler command.
  2. Keep the default config file but override the linkage with command options. Simply add each swc to the external-library-path: -external-library-path+=libs/framework.swc and so forth.

When you compile an application with mxmlc though, the default linkage is RSL. You may want to override this too and make it 'merged'. In this case you'll first have to reset the RSL path: -runtime-shared-library-path= (that's right, nothing after the =). Then add each swc to the -library-path: -library-path+=libs/framework.swc


Alternatively (warning! shameless self-promotion on the way), you could use a build tool called GradleFx. If you create a build file with just this line:

type = 'swc'

it will compile your library with the framework linked externally. You can override this default if the need be:

type = 'swc'
frameworkLinkage = 'merged'
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top