当我使用 compc 构建组件时,为什么我的某些资源的大小为 0 字节?
我正在使用 Ant 构建一个 flex .swc 库,并且许多本应位于该文件中的资源不会被复制,而是在 .swc 中创建 0 字节条目。
这是正在进行创建的 ant compc 目标。我在这里尝试了compiler.include-libraries和compiler.library-path,这就是为什么后者仍然存在并被注释掉的原因。两者都不起作用。
<compc headless-server="true"
default-frame-rate="${flex.default-frame-rate}"
debug="${flex.compiler.debug.mode}"
directory="false"
output="${project.swc.dir}/${project.swc.name}.swc">
<source-path path-element="${project.src.dir}"/>
<source-path path-element="${FLEX_HOME}/frameworks"/>
<compiler.include-libraries dir="${FLEX_HOME}" append="true">
<include name="*.swc"/>
<include name="bundles/{locale}/*.swc"/>
<include name="libs/*"/>
</compiler.include-libraries>
<!-- List of SWC files or directories that contain SWC files.
<compiler.library-path dir="${FLEX_HOME}/frameworks" append="true">
<include name="libs" />
<include name="../bundles/{locale}" />
</compiler.library-path>-->
<include-sources dir="${project.src.dir}">
<include name="**/*.as" />
<include name="**/*.mxml" />
</include-sources>
<include-file name="package/assets/error.png" path="${project.src.dir}/package/assets/error.png" />
<include-file name="package/assets/folder.png" path="${project.src.dir}/package/assets/folder.png" />
<include-file name="package/assets/success.png" path="${project.src.dir}/package/assets/success.png" />
</compc>
其输出是一个如下所示的 .swc 文件:
Archive: flex/package/bin/package.swc
Length Date Time Name
-------- ---- ---- ----
0 10-16-08 12:59 mx/controls/NumericStepper.png
4741 10-16-08 12:59 locale/en_US/rpc.properties
1222 10-30-08 22:27 locale/en_US/core.properties
1130 10-30-08 22:27 locale/en_US/formatters.properties
0 10-16-08 12:59 mx/containers/ControlBar.png
6460 10-16-08 12:59 locale/en_US/messaging.properties
0 10-16-08 12:59 mx/controls/Spacer.png
3170 10-30-08 22:27 locale/en_US/controls.properties
641 10-30-08 22:27 locale/en_US/effects.properties
962 10-16-08 13:00 locale/en_US/logging.properties
0 10-16-08 12:59 mx/controls/List.png
0 10-16-08 12:59 mx/controls/Tree.png
0 10-16-08 12:59 mx/containers/HBox.png
0 10-16-08 12:59 mx/controls/Button.png
334062 09-09-09 09:34 catalog.xml
0 10-16-08 12:59 mx/controls/VScrollBar.png
0 10-16-08 12:59 mx/containers/Box.png
638 10-30-08 22:27 locale/en_US/containers.properties
1091 10-30-08 22:27 locale/en_US/SharedResources.properties
0 10-16-08 12:59 mx/controls/HScrollBar.png
0 10-16-08 12:59 mx/controls/TextArea.png
518 10-30-08 22:27 locale/en_US/skins.properties
0 10-16-08 12:59 mx/controls/ProgressBar.png
5251 09-08-09 12:44 package/assets/success.png
847017 09-09-09 09:34 library.swf
1572 10-30-08 22:27 locale/en_US/collections.properties
0 10-16-08 12:59 mx/controls/Label.png
315 09-08-09 12:44 package/assets/folder.png
0 10-16-08 12:59 mx/controls/TextInput.png
504 10-30-08 22:27 locale/en_US/styles.properties
0 10-16-08 12:59 mx/containers/TitleWindow.png
5316 09-08-09 12:44 package/assets/error.png
0 10-16-08 12:59 mx/controls/DataGrid.png
0 10-16-08 12:59 mx/controls/CheckBox.png
0 10-16-08 12:59 mx/containers/Panel.png
-------- -------
1214610 35 files
但是,Flex Builder 的输出是这样的:
Archive: ./bin/package-flex_base.swc
Length Date Time Name
-------- ---- ---- ----
463 03-04-09 12:58 mx/controls/NumericStepper.png
4741 03-04-09 12:57 locale/en_US/rpc.properties
1222 03-19-09 02:43 locale/en_US/core.properties
1130 03-19-09 02:43 locale/en_US/formatters.properties
510 03-04-09 12:58 mx/containers/ControlBar.png
6460 03-04-09 12:57 locale/en_US/messaging.properties
405 03-04-09 12:58 mx/controls/Spacer.png
3170 03-19-09 02:43 locale/en_US/controls.properties
641 03-19-09 02:43 locale/en_US/effects.properties
962 03-04-09 12:58 locale/en_US/logging.properties
382 03-04-09 12:58 mx/controls/List.png
373 03-04-09 12:58 mx/controls/Tree.png
555 03-04-09 12:58 mx/containers/HBox.png
483 03-04-09 12:58 mx/controls/Button.png
337860 09-09-09 09:22 catalog.xml
425 03-04-09 12:58 mx/controls/VScrollBar.png
649 03-04-09 12:58 mx/containers/Box.png
638 03-19-09 02:43 locale/en_US/containers.properties
1091 03-19-09 02:43 locale/en_US/SharedResources.properties
372 03-04-09 12:58 mx/controls/HScrollBar.png
409 03-04-09 12:58 mx/controls/TextArea.png
518 03-19-09 02:43 locale/en_US/skins.properties
313 03-04-09 12:58 mx/controls/ProgressBar.png
5251 09-08-09 12:44 package/assets/success.png
868260 09-09-09 09:22 library.swf
1572 03-19-09 02:43 locale/en_US/collections.properties
401 03-04-09 12:58 mx/controls/Label.png
315 09-08-09 12:44 package/assets/folder.png
374 03-04-09 12:58 mx/controls/TextInput.png
504 03-19-09 02:43 locale/en_US/styles.properties
542 03-04-09 12:58 mx/containers/TitleWindow.png
5316 09-08-09 12:44 package/assets/error.png
397 03-04-09 12:58 mx/controls/DataGrid.png
670 03-04-09 12:58 mx/controls/CheckBox.png
537 03-04-09 12:58 mx/containers/Panel.png
-------- -------
1247911 35 files
I'm building a flex .swc library using Ant, and many of the assets that are supposed to be in the file are not being copied, instead creating 0-byte entries in the .swc.
Here is the ant compc target that is doing the creation. I've tried both compiler.include-libraries and compiler.library-path here, which is why the latter is still present and commented out. Neither worked.
<compc headless-server="true"
default-frame-rate="${flex.default-frame-rate}"
debug="${flex.compiler.debug.mode}"
directory="false"
output="${project.swc.dir}/${project.swc.name}.swc">
<source-path path-element="${project.src.dir}"/>
<source-path path-element="${FLEX_HOME}/frameworks"/>
<compiler.include-libraries dir="${FLEX_HOME}" append="true">
<include name="*.swc"/>
<include name="bundles/{locale}/*.swc"/>
<include name="libs/*"/>
</compiler.include-libraries>
<!-- List of SWC files or directories that contain SWC files.
<compiler.library-path dir="${FLEX_HOME}/frameworks" append="true">
<include name="libs" />
<include name="../bundles/{locale}" />
</compiler.library-path>-->
<include-sources dir="${project.src.dir}">
<include name="**/*.as" />
<include name="**/*.mxml" />
</include-sources>
<include-file name="package/assets/error.png" path="${project.src.dir}/package/assets/error.png" />
<include-file name="package/assets/folder.png" path="${project.src.dir}/package/assets/folder.png" />
<include-file name="package/assets/success.png" path="${project.src.dir}/package/assets/success.png" />
</compc>
The output of this is a .swc file like this:
Archive: flex/package/bin/package.swc
Length Date Time Name
-------- ---- ---- ----
0 10-16-08 12:59 mx/controls/NumericStepper.png
4741 10-16-08 12:59 locale/en_US/rpc.properties
1222 10-30-08 22:27 locale/en_US/core.properties
1130 10-30-08 22:27 locale/en_US/formatters.properties
0 10-16-08 12:59 mx/containers/ControlBar.png
6460 10-16-08 12:59 locale/en_US/messaging.properties
0 10-16-08 12:59 mx/controls/Spacer.png
3170 10-30-08 22:27 locale/en_US/controls.properties
641 10-30-08 22:27 locale/en_US/effects.properties
962 10-16-08 13:00 locale/en_US/logging.properties
0 10-16-08 12:59 mx/controls/List.png
0 10-16-08 12:59 mx/controls/Tree.png
0 10-16-08 12:59 mx/containers/HBox.png
0 10-16-08 12:59 mx/controls/Button.png
334062 09-09-09 09:34 catalog.xml
0 10-16-08 12:59 mx/controls/VScrollBar.png
0 10-16-08 12:59 mx/containers/Box.png
638 10-30-08 22:27 locale/en_US/containers.properties
1091 10-30-08 22:27 locale/en_US/SharedResources.properties
0 10-16-08 12:59 mx/controls/HScrollBar.png
0 10-16-08 12:59 mx/controls/TextArea.png
518 10-30-08 22:27 locale/en_US/skins.properties
0 10-16-08 12:59 mx/controls/ProgressBar.png
5251 09-08-09 12:44 package/assets/success.png
847017 09-09-09 09:34 library.swf
1572 10-30-08 22:27 locale/en_US/collections.properties
0 10-16-08 12:59 mx/controls/Label.png
315 09-08-09 12:44 package/assets/folder.png
0 10-16-08 12:59 mx/controls/TextInput.png
504 10-30-08 22:27 locale/en_US/styles.properties
0 10-16-08 12:59 mx/containers/TitleWindow.png
5316 09-08-09 12:44 package/assets/error.png
0 10-16-08 12:59 mx/controls/DataGrid.png
0 10-16-08 12:59 mx/controls/CheckBox.png
0 10-16-08 12:59 mx/containers/Panel.png
-------- -------
1214610 35 files
However, the Flex Builder output is this:
Archive: ./bin/package-flex_base.swc
Length Date Time Name
-------- ---- ---- ----
463 03-04-09 12:58 mx/controls/NumericStepper.png
4741 03-04-09 12:57 locale/en_US/rpc.properties
1222 03-19-09 02:43 locale/en_US/core.properties
1130 03-19-09 02:43 locale/en_US/formatters.properties
510 03-04-09 12:58 mx/containers/ControlBar.png
6460 03-04-09 12:57 locale/en_US/messaging.properties
405 03-04-09 12:58 mx/controls/Spacer.png
3170 03-19-09 02:43 locale/en_US/controls.properties
641 03-19-09 02:43 locale/en_US/effects.properties
962 03-04-09 12:58 locale/en_US/logging.properties
382 03-04-09 12:58 mx/controls/List.png
373 03-04-09 12:58 mx/controls/Tree.png
555 03-04-09 12:58 mx/containers/HBox.png
483 03-04-09 12:58 mx/controls/Button.png
337860 09-09-09 09:22 catalog.xml
425 03-04-09 12:58 mx/controls/VScrollBar.png
649 03-04-09 12:58 mx/containers/Box.png
638 03-19-09 02:43 locale/en_US/containers.properties
1091 03-19-09 02:43 locale/en_US/SharedResources.properties
372 03-04-09 12:58 mx/controls/HScrollBar.png
409 03-04-09 12:58 mx/controls/TextArea.png
518 03-19-09 02:43 locale/en_US/skins.properties
313 03-04-09 12:58 mx/controls/ProgressBar.png
5251 09-08-09 12:44 package/assets/success.png
868260 09-09-09 09:22 library.swf
1572 03-19-09 02:43 locale/en_US/collections.properties
401 03-04-09 12:58 mx/controls/Label.png
315 09-08-09 12:44 package/assets/folder.png
374 03-04-09 12:58 mx/controls/TextInput.png
504 03-19-09 02:43 locale/en_US/styles.properties
542 03-04-09 12:58 mx/containers/TitleWindow.png
5316 09-08-09 12:44 package/assets/error.png
397 03-04-09 12:58 mx/controls/DataGrid.png
670 03-04-09 12:58 mx/controls/CheckBox.png
537 03-04-09 12:58 mx/containers/Panel.png
-------- -------
1247911 35 files
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在您的 ant 脚本中,包含一个引用可找到图像的根位置的源路径元素,如下所示:
您应该能够从该根位置找到特定图像。例如,以下结果:
应包含 swc 中引用的图像的 0 字节。
In your ant script, include a source path element that references the root location where the images can be found as follows:
You should be able to find a particular image from that root location. For example, the result of the following:
should include the 0-byte the images referenced in your swc.