Compile a SWC using COMPC, excluding 3rd party libs

≡放荡痞女 提交于 2019-12-05 22:18:48

-external-library-path+=my.swc is the answer, though there is no need for using -runtime-shared-libraries. Using this argument allows you to specify code which will be used in compilation but not placed into the swc. Obviously this excluded clode will still be needed when the swc is used.

Of particular note is that unlike other arguments, -external-library-path uses += not =. By using just = you will break the refernce to the players low level classes and any other external libraries added.

If you are using FlexTasks w/ Ant, your target 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 point external-library-path to a folder in which case it will include all swcs inside. Note that if you follow Adobe's FlexTasks guidelines and place the flexTasks.jar file into your libs folder and target it as a folder using external-library-path, the flexTasks.jar is itself excluded, causing the build to fail. To solve this, either place the flexTasks.jar in a separate folder or target your swcs directly as in the above example

I don't think you can just require that someone else has the dependencies. It could use the third party libraries as Runtime Shared Libraries, you will need the third party libs available on the url and use the following when compiling -runtime-shared-libraries=http://www.yourhost.com/my.swf -external-library-path+=my.swc. See the Adobe docs for full details about RSLs

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!