http://businessintelligence.me/blog_en/ria/rsl-compile-flex-project-ant/
Recently, we had to write an Ant script to build our application and put it under continuous integration. At the beginning, we passed the minimum arguments to the compiler to build the SWF file and it compiled the project, including the framework classes, in the application SWF file.
So, how to use RSL winthin an ant script to reduce the size of the swf result file ?
Firs of all, you have to use a configuration file witch specifies a lots of information to the compiler about your application like the name, the player version, etc. So, you can create your own configuration file and specify all the informations needed. A sample of the file is in the flex sdk named “flex-config.xml”. Inside this file, you can write a tag runtime-shared-library-path witch specify the SWC file you want to use as an RSL.
An example of the config file may be:
<flex-config>
<compiler>
…
</compiler>
<runtime-shared-library-path>
<path-element>libs/framework.swc</path-element>
<rsl-url>framework_3.2.0.3958.swz</rsl-url>
<policy-file-url></policy-file-url>
<rsl-url>framework_3.2.0.3958.swf</rsl-url>
<policy-file-url></policy-file-url>
</runtime-shared-library-path>
…
</flex-config>
The <path-element> tag is the relative path to the library file, the <rsl-url> is the relative url of the RSL relatively to the root server path and the <policy-file-url> is the relative URL for the crossdomain.xml file. If not specify, flash will try to find it at the root of the server.
Now we can use this file in our ant task as a config file for the compiler. Therefore, the compiler will create correct links to the RSL in the project SWF file.
This is a sample how to use the config file:
<mxmlc file="..." >
…
<load-config filename=”${basedir}/flex-config.xml”/>
…
</mxmlc>
After the build, the SWF file of the project is smaller than before and you have just to put the framework.swz and framework.swf file at the correct location on the server to use them as Runtime Shared Libraries !
分享到:
相关推荐
How to build compile server with virtualbox & samba
how to compile the sample ?
How to compile Windows Server 2003-bO0daYbti5g.mkv windows server 2003操作系统源代码构建指南视频教程
`<taskdef>`标签用于引入Flex Ant任务,例如`<taskdef resource="flexTasks.tasks" classpath="path/to/flex_sdk/lib/ant/flexTasks.jar"/>`。接着,我们可以使用`<compc>`标签来调用Flex编译器,指定输入源代码目录...
本文将深入探讨如何利用Apache Ant来自动编译Flex程序。Apache Ant是一种基于Java的构建工具,它允许开发者通过XML配置文件来定义任务,实现软件项目的构建、部署等自动化操作。Flex是一种用于创建富互联网应用程序...
The transition from Flex Builder to Eclipse as the primary development environment is a common one, particularly in teams with a strong Java background. This shift leverages the flexibility and ...
使用这样的Ant脚本,开发者可以轻松地在命令行上运行`ant compile`命令,从而自动编译Flex项目,无需手动操作IDE。这对于持续集成(CI)环境尤其有用,因为它可以方便地集成到自动化构建流程中。 总结起来,"flex_...
(跑通sqlcipher-4.4.0)https://www.youtube.com/watch?v=SFHGeetZ0po
1、创建vue项目后安装less,执行 npm install less less-loader –save-dev 下载版本为:less-loader@6.1.0 , less@3.11.3,重启服务报错,报错信息如下: 2、报错原因 less 本版太高需要降低版本,执行代码 ...
The last chapter explains how a compiler works and shows how to compile "by hand" little (but not trivial--even recursive) programs. The book is intended for anyone who thinks mathematically and ...
[1] This paper will provide such a project model and is donated to the FreeBSD Documentation project where it can evolve together with the project so that it can at any point in time reflect the way ...
Chapter 6, Building a Smart Contract Deployment Platform, shows how to compile smart contracts using web3.js and deploy it using web3.js and EthereumJS. Chapter 7, Building a Betting App, explains how...
PNG" to "ON" and "WITH_LIBPNGINC" to the path where the libpng include files and libraries are located. zlib support: set "DCMTK_WITH_Z" to "ON" and "WITH_ZLIBINC" to the path where the zlib include ...
本话题将深入探讨如何使用Flex Ant Tasks来编译工程文件,这是一款基于Apache Ant的工具,专为Adobe Flex应用程序开发设计。Ant是一个流行的Java项目管理工具,而Flex Ant Tasks则扩展了Ant,增加了对Flex SDK的支持...
A simple to use library to create a android L dialog on any 2.3 android device in your app using 3 Lines of code! How to compile the example Download the zip Extract Import with android studio ...
The final section of the course is a practical 4-part lesson, teaching how to implement a fully animated HTML5 Canvas project using WebAssembly as the main processor. Upon completion of this course ...
One chapter covers how to efficiently count the 1 bits in an array with the most efficient version using the recently-introduced popcnt instruction. Another chapter covers using SSE instructions to ...
"Ant ant ant antant ant ant antant ant ant ant" 这个描述可能是在强调Ant在项目构建过程中的重复性和不可或缺性,暗示着它在工程中的频繁使用和核心地位。 Ant的设计理念是“一切都是XML”,它通过XML格式的构建...
Chapter 6, Building a Smart Contract Deployment Platform, shows how to compile smart contracts using web3.js and deploy it using web3.js and EthereumJS. Chapter 7, Building a Betting App, explains how...
Hands-On Computer Vision with Julia is a thorough guide for developers who want to get started with building computer vision applications using Julia. Julia is well suited to image processing because ...