4 Replies Latest reply on Dec 10, 2009 7:52 AM by Gaurav J

    asdoc how to add a custom local namespace with manifest file?

    maddec2

      Hi there,

       

      I use the flex 4 beta1 sdk to test the following:

       

      I have:

      MainScreen.mxml:

      <?xml version="1.0" encoding="utf-8"?>
      <s:Group xmlns:fx="http://ns.adobe.com/mxml/2009"
          xmlns:s="library://ns.adobe.com/flex/spark"
          xmlns:mx="library://ns.adobe.com/flex/halo"
         
          xmlns:views="com.xyz.core.view.components.*"
          >


          <views:AbcView id="abcView" right="20" />

       

      </s:Group>

       

      I tried to use a manifest file which seems to be how to handle this kind of situation (using ant):

          <arg line="-namespace views ${manifest.file}"/>
          <arg line="-doc-namespaces views"/>

       

      the manifest.xml contain the following:

      <?xml version="1.0" encoding="UTF-8"?>
      <componentPackage>
                 <component id="AbcView" class="com.xyz.core.view.components.AbcView" />
      </componentPackage>

       

      when I compile asdoc return the following error:

      ...MainScreen.mxml(52):  Error: Type was not found or was not a compile-time constant: AbcView

       

      Any idea how I can force asdoc to add/recognize AbcView.mxml ? Is my use of manifest file correct in this situation?

       

       

      Thank you in advance for your help.

       

      Best regards.

      maddec

        • 1. Re: asdoc how to add a custom local namespace with manifest file?
          Daniel T Employee Moderator

          Moved from Labs General Discussion to Flash Builder and Flex SDK forum.

          • 2. Re: asdoc how to add a custom local namespace with manifest file?
            Gaurav J Adobe Employee

            Do you have the source path defined? and does it contains the folder that is parent of com.xyz.core.view.components ?

             

            Can you post your complete call to asdoc?

             

            Also you can use <asdoc> ant task which is available in Flex 4. Take a look at http://gauravj.com/blog/?p=328

             

            Thanks,

            Gaurav Jain

            Flex SDK Team

            http://www.gauravj.com/blog

            • 3. Re: asdoc how to add a custom local namespace with manifest file?
              maddec2 Level 1

              Hello,

               

              >Do you have the source path defined?

              yes definitely.

               

              >and does it contains the folder that is parent of com.xyz.core.view.components ?

              yes absolutely

               

              >Can you post your complete call to asdoc?

              Please find below the ant task I use:

              Thank you very much for your help.

               

               

              <?xml version="1.0" encoding="UTF-8"?>
              <project name="asdoc" default="main" basedir=".">

               

              <!--

               

                  Properties Definitions

               

              -->
                  <!-- The Location of Flex on your Computer -->
                  <property name="Flex.dir" location="C:\Program Files (x86)\Adobe\Flex Builder 3 Plug-in"/>
                 
                  <!-- The Location of FlexSDK on your Computer -->
                  <property name="FlexSDK.dir" location="${Flex.dir}\sdks\4.0.0.7219"/>
                  <!-- <property name="FlexSDK.latest.build.dir" location="${Flex.dir}\sdks\4.0.0.12412"/> -->
                 
                  <!-- The Location of ASDocs on your Computer -->
                  <property name="asDocs.exe" location="${FlexSDK.dir}\bin\asdoc.exe"/>
                 
                  <!-- main path info -->   
                  <!--
                      The Location of your Application Classes on your Computer
                      NOTE: This Path should be relative to the build.xml file.
                      NOTE: ${basedir} is an ant property that represents the directory holding the build.xml file
                      NOTE: I have encountered issues with this folder containing Spaces
                  -->
                  <property name="AppClasses.dir" value='-doc-sources "${basedir}/src"'/>
                  <property name="asdoc.source.paths" value='-source-path "${basedir}/src/"' />
                 
                  <!-- configs -->
                  <property name="asdoc.config" value='-load-config="${FlexSDK.dir}/frameworks/flex-config.xml"' />
                  <property name="sp.config" value='-load-config+="${basedir}/conditionalCompil.xml"' />
                 
                  <!-- additional path info -->   
                  <property name="source.path.srcShared" value='-source-path+="D:/analogdesign/Clients/Minsh/flash/GIT-sources/minsh-flex-widget/s rcShared"' />
                  <property name="libs.path" value='-external-library-path="${basedir}/libs"' />

               

                  <!-- custom components -->
                  <property name="manifest.file" location="${basedir}\ant\customCpnsManifest.xml" />
                 
                  <!-- branding data -->
                  <property name="window.title" value='-window-title="Minsh API Documentation"' />
                  <property name="main.title" value='-main-title="Minsh API Documentation"' />

               

                  <!--
                      The Location you wish to output to on your Computer
                      NOTE: I have encountered issues with this folder containing Spaces
                      NOTE: This location gets DELETED and re-generated each time the build is run
                  -->
                  <property name="output.dir" location="${basedir}\output\AppDocs"/>
                  <property name="asdoc.output" value='-output="${output.dir}"' />
                 
              <!--

               

                  Execute the ASDoc Compile
                 
              -->
              <target name="main" depends="clean,compile" description="full build of asdocs"/>

               

              <!--

               

                  DELETE the existing output folder and files and then re-generate the output folder

               

              -->

               

              <target name="clean">
                  <delete dir="${output.dir}" failOnError="false" includeEmptyDirs="true"/>
                  <mkdir dir="${output.dir}"/>
              </target>

               


              <!--

               

                  Run the ASDoc executable and generate the ASDocs to the new output folder
                 
              -->

               

              <target name="compile">
                  <exec executable="${asDocs.exe}" failonerror="true">
                      <arg line="${asdoc.config}"/>
                      <arg line="${sp.config}"/>
                 
                      <arg line="${asdoc.source.paths}"/>
                      <arg line="${AppClasses.dir}"/>
                     
                      <arg line="${libs.path}"/>
                      <arg line="${source.path.srcShared}"/>
                     
                      <arg line="-namespace views ${manifest.file}"/>
                      <arg line="-doc-namespaces views"/>
                 
                      <arg line="${window.title}"/>
                      <arg line="${main.title}"/>
                      <arg line="${asdoc.output}"/>
                  </exec>
              </target>
                 
              </project>

               

               

              Best regards.

               

              maddec

              • 4. Re: asdoc how to add a custom local namespace with manifest file?
                Gaurav J Adobe Employee

                If while calling ant you pass in -debug, then you should see all arguments (that are passed in) printed on the console.

                 

                Is the MainScreen.mxml at the root package? i.e directly under the src folder?

                 

                -Gaurav