使用acompc编译器编译AIR组件或库
使用组件编译器acompc编译AIR库或独立组件。组件编译器很类似amxmlc编译器,只是需要注意以下事项:
1. 你必须指定哪些类将被编译进库或组件。
2. Acompc不会自己去寻找本地配置文件,你必须手动使用-load-config选项加载。
Acompc和compc一样,除了载入配置文件air-config.xml文件代替flex_config.xml文件。
下面的例子演示建立用两个类所建立的库:ParticleManager和Particle,都在com.adobe.samples.particles包中,存放在source/com/adobe/samples/particles目录下:
<flex-config>
<compiler>
<source-path>
<path-element>source</path-element>
</source-path>
</compiler>
<include-classes>
<class>com.adobe.samples.particles.ParticleManager</class>
<class>com.adobe.samples.particles.Particle</class>
</include-classes>
</flex-config>
然后输入下面的命令:
compc -source-path source -include-classes com.adobe.samples.particles.Particle
com.adobe.samples.particles.ParticleManager
编译AIR组件或库:
acompc -load-config myLib-config.xml -output lib/myLib.swc
编译runtime-shared library:
acompc -load-config myLib-config.xml -directory -output lib
(注意,在运行此命令之前lib目录必须存在且空的)