当我使用compc构建组件时,为什么我的一些资产的大小为0字节?

时间:2009-09-09 15:40:24

标签: flex flex3 adobe compc

我正在使用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

1 个答案:

答案 0 :(得分:1)

在您的ant脚本中,包含一个源路径元素,该元素引用可以找到图像的根位置,如下所示:

<source-path path-element="${FLEX_HOME}/frameworks/projects/framework/src" />

您应该能够从该根位置找到特定图像。例如,以下结果:

find $FLEX_HOME/frameworks/projects/framework/src -name '*.png'

应该包含你的swc中引用的图像的0字节。