1
votes

I have an ant script to compile and generate an AIR file, and it runs well. Now, I am trying asDocs also into the ant script in order to auto generate documentation whenever I am generating a new AIR file.

Though the mxmlc task which is creating my swf file runs smoothly, my asdoc task in ANT is throwing up errors. I keep getting errors like:

compileASDoc: [asdoc] Loading configuration file D:\4.1\4.1\frameworks\air-config.xml
[asdoc] ALPHA.as(3): col: 35 Error:
The definition of base class Panel was not found.
[asdoc]
[asdoc] public class ExtendPanel extends Panel
[asdoc] ^
[asdoc]
[asdoc] XYZABC.mxml(-1): Error: Duplicate function definition.
[asdoc]
[asdoc] < ?xml version="1.0" encoding="utf-8"?>
[asdoc]
[asdoc] XYZABC.mxml(-1): Error: A conflict exists with definition linkbutton1 in namespace internal.
[asdoc]
[asdoc] < ?xml version="1.0" encoding="utf-8"?>
[asdoc]
[asdoc] GHIJKL.mxml(-1): Error: A conflict exists with definition linkbutton1 in namespace internal.
[asdoc]
[asdoc] < ?xml version="1.0" encoding="utf-8"?>
[asdoc]

I am at a loss to understand why these errors are coming up. My ant script is very similar to the one below:

<!-- 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>

I wrote this script after looking at the build.xml inside the asdoc folder in FLEX_HOME folder.

Any hints on why I am getting the errors and how I can resolve them will be greatly appreciated!

Regards,
Ravi.

1
Also, when using the ant script above, I am getting an error with the mxml file containing this statement: <fx:Object id="abc">. The error said unable to find implementation for fx:Object. So I included the namespace for fx (ns.adobe.com/mxml/2009) and mapped it to the mx-manifest.xml. If I map it to the mx-manifest.xml, I am NOT getting the Panel error given above in the post, but I am getting the fx:Object implementation not found error. If I the fx namespace to mxml-2009-manifest.xml, then I am getting the Panel error, and not the fx:Object error.Neo
when addint extra details your question, it is perfectly acceptable to edit the question to add them.JeffryHouser

1 Answers

0
votes

I was able to find out what the error is by myself. Sourcepath was not pointing to my source files!

There is no need to give doc-classes and mention the flex inbuilt classes like spark etc in the xml. Also, the namespaces thingy is redundant and can be excluded.

So in the XML provided above, just remove all the doc-classes, doc-namespaces, namespace and compiler.source-path tags. And add a single which points to your source directory!