通过Ant生成ASDoc

时间:2011-05-10 09:58:49

标签: flex asdoc

我有一个ant脚本来编译和生成一个AIR文件,它运行良好。现在,我正在尝试asDocs进入ant脚本,以便在生成新的AIR文件时自动生成文档。

虽然创建我的swf文件的mxmlc任务运行顺利,但我在ANT中的asdoc任务却抛出了错误。我不断收到错误:

compileASDoc:     [asdoc]加载配置文件D:\ 4.1 \ 4.1 \ frameworks \ air-config.xml
    [asdoc] ALPHA.as(3):col:35错误:
 未找到基类Panel的定义     [的asdoc]
    [asdoc]公共类ExtendPanel扩展了Panel
    [asdoc] ^
    [的asdoc]
    [asdoc] XYZABC.mxml(-1):错误:重复的函数定义     [的asdoc]
    [asdoc]< ?xml version =“1.0”encoding =“utf-8”?>
    [的asdoc]
    [asdoc] XYZABC.mxml(-1):错误:内部命名空间中定义linkbutton1存在冲突。
    [的asdoc]
    [asdoc]< ?xml version =“1.0”encoding =“utf-8”?>
    [的asdoc]
    [asdoc] GHIJKL.mxml(-1):错误:内部命名空间中定义linkbutton1存在冲突。
    [的asdoc]
    [asdoc]< ?xml version =“1.0”encoding =“utf-8”?>
    [asdoc]

我无法理解为什么会出现这些错误。我的蚂蚁脚本与下面的脚本非常相似:

<!-- Run the ASDoc executable and generate the ASDocs to the new output folder -->
<target name="compileASDoc" depends="clean, init">

    <condition property="asdoc.jvm.args" value="-Xmx384m">
        <os family="windows"/>
    </condition>

    <condition property="asdoc.jvm.args" value="-Xmx512m">
        <os family="mac"/>
    </condition>

    <condition property="asdoc.jvm.args" value="-Xmx512m">
        <os family="unix"/>
    </condition>

    <asdoc output="${Asdoc.dir}" lenient="true" failonerror="true" warnings="false" 
        strict="false" fork="true"
        left-frameset-width="300"
        main-title='${Main.title}'
        footer="${Footer.text}"
        window-title="Custom asdoc documentation" >

        <doc-sources path-element="${SRC_DIR}" />
        <doc-sources path-element="${IMAGES_DIR}" />
        <doc-sources path-element="${SOME_LOCALE}/en_US" />
        <doc-sources path-element="${SOME_LOCALE}/ar_AE" />

        <load-config filename='${FLEX_HOME}/frameworks/air-config.xml'/>

        <!-- top level class to include in asdoc -->
        <doc-classes class="AIRFrameworkClasses"/>
        <doc-classes class="AIRSparkClasses"/>
        <doc-classes class="FlexClasses"/>
        <doc-classes class="SparkClasses"/>
        <doc-classes class="FrameworkClasses"/>
        <!--    <doc-classes class="HaloClasses"/> -->
        <doc-classes class="OSMFClasses"/>
        <doc-classes class="SparkSkinsClasses"/>
        <doc-classes class="RPCClasses"/>
        <doc-classes class="flashx.textLayout.CoreClasses"/>
        <doc-classes class="flashx.textLayout.EditClasses"/>
        <doc-classes class="flashx.textLayout.ConversionClasses"/>

        <!-- source path for asdoc -->
        <compiler.source-path path-element="${flexlib}/projects/airframework/src"/>
        <compiler.source-path path-element="${flexlib}/projects/airspark/src"/>
        <compiler.source-path path-element="${flexlib}/projects/flex/src"/>
        <compiler.source-path path-element="${flexlib}/projects/spark/src"/>
        <compiler.source-path path-element="${flexlib}/projects/framework/src"/>
        <compiler.source-path path-element="${flexlib}/projects/sparkskins/src"/>
        <compiler.source-path path-element="${flexlib}/projects/osmf/src"/>
        <compiler.source-path path-element="${flexlib}/projects/rpc/src"/>
        <compiler.source-path path-element="${flexlib}/projects/textLayout/src"/>

        <!-- namespaces to include in asdoc -->
        <doc-namespaces uri="http://www.adobe.com/2006/airmxml"/>
        <doc-namespaces uri="http://www.adobe.com/2006/airspark"/>
        <doc-namespaces uri="library://ns.adobe.com/flex/spark"/>
        <doc-namespaces uri="http://www.adobe.com/2006/mxml"/>
        <doc-namespaces uri="http://www.adobe.com/2006/rpcmxml"/>
                    <doc-namespaces uri="library://ns.adobe.com/flashx/textLayout"/>  
                    <doc-namespaces uri="http://ns.adobe.com/mxml/2009"/>
        <namespace uri="library://ns.adobe.com/flashx/textLayout" manifest="${flexlib}/projects/textLayout/manifest.xml"/>

        <!-- namespace declaration for asdoc -->
        <namespace uri="http://www.adobe.com/2006/airmxml" manifest="${flexlib}/projects/airframework/manifest.xml"/>
        <namespace uri="http://www.adobe.com/2006/airspark" manifest="${flexlib}/projects/airspark/manifest.xml"/>
        <namespace uri="http://www.adobe.com/2006/rpcmxml" manifest="${flexlib}/projects/rpc/manifest.xml"/>
        <namespace uri="http://www.adobe.com/2006/mxml" manifest="${flexlib}/mxml-manifest.xml"/>
        <namespace uri="library://ns.adobe.com/flex/spark" manifest="${flexlib}/projects/spark/manifest.xml"/>
        <namespace uri="library://ns.adobe.com/flex/mx" manifest="${flexlib}/mxml-manifest.xml"/>  
                    <namespace uri="http://ns.adobe.com/mxml/2009" manifest="${flexlib}/mxml-2009-manifest.xml"/>

        <library-path/>

        <external-library-path dir="${flexlib}/libs">
            <include name="*.swc" />
        </external-library-path>

                    <external-library-path dir="${flexlib}/libs/air">
            <include name="*.swc" />
        </external-library-path>

        <external-library-path dir="${LIBS_DIR}">
            <include name="*.swc" />
        </external-library-path>

        <external-library-path dir="${LOCALE_DIR}">
            <include name="*.swc" />
        </external-library-path>

        <external-library-path dir="${AR_LOCALE_DIR}">
            <include name="*.swc" />
        </external-library-path>

        <jvmarg line="${asdoc.jvm.args}"/>

        <define name="CONFIG::debug" value="false"/>
        <define name="CONFIG::release" value="true"/>
        <define name="CONFIG::FLASH_10_1" value="false"/>
        <define name="CONFIG::LOGGING" value="false"/>
    </asdoc>
    <echo>Docs creation complete</echo>
</target>

我在查看FLEX_HOME文件夹中asdoc文件夹内的build.xml后写了这个脚本。

我将非常感谢任何关于我为什么会收到错误以及如何解决错误的提示!

的问候,
拉维。

1 个答案:

答案 0 :(得分:0)

我能够自己找出错误是什么。 Sourcepath没有指向我的源文件!

没有必要提供doc-classes并在xml中提及flex内置类,如spark等。此外,命名空间thingy是多余的,可以排除。

因此,在上面提供的XML中,只需删除所有doc-classes,doc-namespaces,namespace和compiler.source-path标签。并添加一个指向源目录的单词!