Compile SWC with COMPC, excluding third-party libraries

I have a code library that I created. It relies on 2 other (third-party) libraries. At the moment, when I compile the library in swc, both third-party libraries are included in it. I am looking for a way to compile my code library with third-party libraries, but without including them in compiled swc.

This, obviously, would mean that everyone who uses my library would need both libraries, but I would prefer it that way. I do not use Flex / Flashbuilder, which, as I know, allows you to choose the classes to include in swc.

thanks

+3
source share
2 answers

-external-library-path + = my.swc is the answer, although there is no need to use time-extension libraries. Using this argument, you can specify the code that will be used in compilation, but not placed in swc. Obviously, this excluded code will still be needed if swc is used.

It should be noted that, unlike other arguments, -external-library-path uses + = not =. Using just =, you expand the link to the classes of low-level players and add other external libraries.

If you use FlexTasks w / Ant, your goal might look like this:

<target name="compileToSWC"> <compc output="${bin}/${SWCName}"> <source-path path-element="${src}"/> <!-- Source to include in SWC --> <include-sources dir="${src}" includes="*"/> <!-- Libs to exclude from the swc - Note append="true" which is equivillant to using +=--> <external-library-path file="${thirdparty.libs}/SomeLib.swc" append="true"/> <external-library-path file="${thirdparty.libs}/SomeOtherLib.swc" append="true"/> </compc> </target> 

You can also specify the path of the external library to the folder, in which case it will include all the swcs inside. Please note: if you follow the recommendations of Adobe FlexTasks and put the flexTasks.jar file in your libs folder and configure it as a folder using the path of an external library, flexTasks.jar itself will be excluded, which will lead to a build failure. To solve this problem, put the flexTasks.jar file in a separate folder or directly configure swcs in the same way as in the above example.

+6
source

I donโ€™t think you can just demand that someone has addictions. It can use third-party libraries as shared runtime libraries, you will need third-party libraries available at the URL, and when compiling -runtime-shared-libraries=http://www.yourhost.com/my.swf -external-library-path+=my.swc use the following. See Adobe docs for complete RSL information.

0
source

Source: https://habr.com/ru/post/907624/


All Articles