如何编译具有多个命名空间的 SWC 文件
我正在尝试从给定的 ActionScript 类列表编译 SWC 文件。我正在使用 compc 编译器。问题是,有太多的类被分组到多个命名空间中,我发现指定要包含在 SWC 中的每个单独的类非常繁琐。有没有更简单的方法可以做到这一点,例如简单地指定这些类的根目录?
目前我有这样的东西:
<?xml version="1.0"?>
<flex-config xmlns="http://www.adobe.com/2006/flex-config">
<output>C:\SomeFolder\testSWC.swc</output>
<compiler>
<source-path>.</source-path>
</compiler>
<include-classes>
<class>SomeNamespaceOne.One</class>
<class>SomeNamespaceOne.Two</class>
<class>SomeNamespaceOne.Three</class>
<class>SomeNamespaceOne.Four</class>
...
<class>SomeNamespaceFifty.One</class>
</include-classes>
</flex-config>
但我想要这样的东西:
<?xml version="1.0"?>
<flex-config xmlns="http://www.adobe.com/2006/flex-config">
<output>C:\SomeFolder\testSWC.swc</output>
<compiler>
<source-path>. </source-path>
</compiler>
<include-classes>
<class>SomeRootDirectoryOfClassesToCompile</class>
</include-classes>
</flex-config>
这可能吗?
I'm trying to compile an SWC file from a list of given ActionScript classes. I'm using the compc compiler. The problem is that there are so many classes grouped into multiple namespaces that I am finding it very tedious to specify each individual class to be included in the SWC. Is there any easier way of doing this like just simply specifying a root directory of these classes?
At the moment I have something like this:
<?xml version="1.0"?>
<flex-config xmlns="http://www.adobe.com/2006/flex-config">
<output>C:\SomeFolder\testSWC.swc</output>
<compiler>
<source-path>.</source-path>
</compiler>
<include-classes>
<class>SomeNamespaceOne.One</class>
<class>SomeNamespaceOne.Two</class>
<class>SomeNamespaceOne.Three</class>
<class>SomeNamespaceOne.Four</class>
...
<class>SomeNamespaceFifty.One</class>
</include-classes>
</flex-config>
But I want something like this:
<?xml version="1.0"?>
<flex-config xmlns="http://www.adobe.com/2006/flex-config">
<output>C:\SomeFolder\testSWC.swc</output>
<compiler>
<source-path>. </source-path>
</compiler>
<include-classes>
<class>SomeRootDirectoryOfClassesToCompile</class>
</include-classes>
</flex-config>
Is this possible?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我们想要在《蚂蚁》中看到类似的东西。
我假设您没有使用 Flex Builder。在这种情况下,我绝对会推荐使用 Adobe 提供的 Ant 和 Flex Ant 任务。即使您使用 Ant,做您想做的事情也不容易,所以我在下面包含了我们的代码。
以下是我们的代码。我不记得我从哪里得到这个想法,所以无法感谢它的来源:)
We wanted something similar, in "Ant".
I am assuming you are not using Flex Builder. In that case, I will definitely recommend using Ant and Flex Ant tasks available from Adobe. Even when you use Ant, its not easy doing what you want to do, so I am including our code below.
Following is our code. I don't remember where I got the idea from, so cannot thank the source for it :)
就像 Tanmay 所说,您应该使用 ANT 任务来让生活变得更轻松,但还有一个更简单的方法,在 compc ant 任务中包含整个目录。如果您只需要包含 src.dir 中的所有内容,您可以这样做:
Like Tanmay said, you should use the ANT tasks to make life easier, but there's an even simpler wach include an entire directory in the compc ant task. If you just need to include everything in src.dir you can do it like this: