Question

UPDATE

  1. solved: embed doc with swc
  2. solved: weird param names: param0, param1, etc.

I created a swc lib using compc.

Then I created the lib doc with asdoc.

But I dont know how to bind them together, since when I use the .swc in another project params names are weird (like myMethod(param0:Number)) and there is no doc description.

I'm using Ant, this is my config file:

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

Edit: How it was solved

The line that make all the magic is this:

<taskdef resource="flexTasks.tasks" classpath="${FLEX_HOME}/ant/lib/flexTasks.jar" />

Then I replaced all my <exec> tags to <compc> and <asdoc> and everything worked. You can see the entire code here.

Was it helpful?

Solution

Try to use zip ant target as in the build.xml of the Starling framework:

<!-- 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>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top