Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/actionscript-3/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Actionscript 3 如何使用文档构建SWC_Actionscript 3_Apache Flex_Ant_Swc_Asdoc - Fatal编程技术网

Actionscript 3 如何使用文档构建SWC

Actionscript 3 如何使用文档构建SWC,actionscript-3,apache-flex,ant,swc,asdoc,Actionscript 3,Apache Flex,Ant,Swc,Asdoc,更新 已解决:使用swc嵌入文档 已解决:奇怪的参数名称:param0、param1等 我使用compc创建了一个swc库 然后我用asdoc创建了lib文档 但是我不知道如何将它们绑定在一起,因为当我在另一个项目中使用.swc时,参数名称很奇怪(比如myMethod(param0:Number)),并且没有文档描述 我正在使用Ant,这是我的配置文件: <?xml version="1.0" encoding="utf-8" ?> <project name="uil" d

更新

  • 已解决:使用swc嵌入文档
  • 已解决:奇怪的参数名称:param0、param1等

  • 我使用
    compc
    创建了一个
    swc

    然后我用
    asdoc
    创建了lib文档

    但是我不知道如何将它们绑定在一起,因为当我在另一个项目中使用.swc时,参数名称很奇怪(比如
    myMethod(param0:Number)
    ),并且没有文档描述

    我正在使用Ant,这是我的配置文件:

    <?xml version="1.0" encoding="utf-8" ?>
    <project name="uil" default="compile" basedir=".">
    
        <property name="flexsdk" location="C:/sdks/flex_sdk_4.6/bin"/>
    
        <property name="compc" location="${flexsdk}/compc.exe"/>
        <property name="asdoc" location="${flexsdk}/asdoc.exe"/>
    
        <property name="src" location="../src"/>
        <property name="bin" location="../bin"/>
    
        <target name="compile" depends="doc">
            <exec executable="${compc}" failonerror="true">
                <arg line="-debug=false" />
                <arg line="-optimize=true" />
                <arg line="-strict=true" />
                <arg line="-locale=en_US" />
                <arg line="-include-sources=${src}" />
                <arg line="-output=${bin}/uil.swc" />
            </exec>
        </target>
    
        <target name="doc">
            <exec executable="${asdoc}" failonerror="true">
                <arg line="-main-title 'UIL API Documentation'" />
                <arg line="-window-title 'UIL API Documentation'" />
                <arg line="-source-path ${src} -doc-sources ${src}" />
                <arg line="-output ${bin}/uil-asdoc" />
            </exec>
        </target>
    
    </project>
    
    
    

    尝试使用
    zip
    ant目标,如
    Starling
    框架中的:

    <!-- call asdoc to generate dita xml files -->
    <asdoc output="${temp.dir}" lenient="true" failonerror="true" keep-xml="true" skip-xsl="true" fork="true">
      <compiler.source-path path-element="${basedir}/src" />
      <doc-sources path-element="${basedir}/src" />
    </asdoc>
    <!-- update swc with asdoc xml -->
    <zip destfile="${deploy.dir}/${ant.project.name}.swc" update="true">
      <zipfileset dir="${temp.dir}/tempdita" prefix="docs">
        <include name="*.*"/>
        <exclude name="ASDoc_Config.xml" />
        <exclude name="overviews.xml" />
      </zipfileset>
    </zip>
    
    
    
    当它嵌入时,文件大小会变大。但不起作用。我在IDE中看不到文档,参数名称仍然很奇怪:(编辑nvm,我犯了一些错误。现在我的文档正在工作,只有参数名称现在很奇怪。我已经测试了这个示例(来自starling)在flex sdk 4.6上,具有正确的方法描述和参数名称。请尝试使用它,而不是您的变体,可能使用lenient属性会有所帮助。我完全按照该示例中的方法制作,现在可以使用,谢谢。我想知道,这是否可以在没有ANT的情况下完成?例如,直接使用命令行?
    <!-- call asdoc to generate dita xml files -->
    <asdoc output="${temp.dir}" lenient="true" failonerror="true" keep-xml="true" skip-xsl="true" fork="true">
      <compiler.source-path path-element="${basedir}/src" />
      <doc-sources path-element="${basedir}/src" />
    </asdoc>
    <!-- update swc with asdoc xml -->
    <zip destfile="${deploy.dir}/${ant.project.name}.swc" update="true">
      <zipfileset dir="${temp.dir}/tempdita" prefix="docs">
        <include name="*.*"/>
        <exclude name="ASDoc_Config.xml" />
        <exclude name="overviews.xml" />
      </zipfileset>
    </zip>