1 Reply Latest reply on Oct 30, 2010 5:15 PM by Flex harUI

    unable to load app with rsl

    sddolphins2010

      Please help!!

       

      My company project has 2 component libraries (swc) and 4-5 separate flex apps that use the 2 component libraries.  So far, the entire project has been build using "merge in code" and it is working fine.  However, some of the applications are getting so big that we need to reduce the overall size of all components and apps.  Using ant (flextask), I try to compile the components and the apps using the framework RSL and I was be able to get everything compiled and linked, but when I try to load one of the application at run time, nothing happens - I got no errors, just a blank, empty default screen.

       

      pic 1: ant script to compile bs_vo component:

       

           <!-- Compile component files -->
           <target name="compile" depends="init,doWindows,doUnix" description="Compiles the mxml/as source files">
                <!-- Create the deploy directory if it doesn't exist -->
                <mkdir dir="${deploy.dir}" />
                <mkdir dir="${deploy.dir}/lib" />
      
                <!-- Compile Flex mxm/as files -->
                <compc output="${swc.export}" locale="${DEFAULT.LOCAL}" debug="${FLEX_DEBUG}">
      
                     <!-- Define namespace to be referenced in other MXML source files -->
                     <namespace uri="http://bidshift.com/vo" manifest="${manifest.xml.file}" />
                     <include-namespaces uri="http://bidshift.com/vo" />
      
                     <!-- Load default compiler options -->
                  <load-config filename="${FLEX_HOME}/frameworks/${flex.conf.filename}" />
      
                     <!-- List of path elements that form the roots of ActionScript
                     class hierarchies -->
                     <source-path path-element="${FLEX_HOME}/frameworks"/>
      
                     <!-- Path of mxml/as source files -->
                     <compiler.source-path path-element="${src.dir}" />
      
                     <!-- List of SWC files or directories that contain SWC files use to
                          build and include in the component -->
                     <compiler.include-libraries dir="${lib.dir}" append="true">
                          <include name="**/*.swc"/>
                     </compiler.include-libraries>
      
                     <!-- Do not merge the framework SWC files -->
                     <compiler.external-library-path dir="${FLEX_HOME}/frameworks" append="true">
                          <include name="libs/**/*.swc" />
                          <exclude name="libs/framework.swc" />
                          <exclude name="libs/rpc.swc" />
                     </compiler.external-library-path>
                </compc>
      
              <!--*****************************************************-->
              <!-- Prepare the RSL so that it can be found at run time -->
              <!--******************************************************-->
      
              <!-- Extract the SWF file from the SWC file -->
              <unzip src="${swc.export}" dest="${deploy.dir}/lib">
                  <patternset>
                      <include name="library.swf" />
                  </patternset>
              </unzip>
      
              <!-- Run the flex optimizer on the extracted SWF so that it does not
                   contain any debug code or unnecessary metadata.  Note that the
                   as3 metadata that's kept, it's required -->
              <exec executable="${flex.optimizer}" dir="." failonerror="true">
                  <arg line="-input ${deploy.dir}/lib/library.swf -output ${deploy.dir}/${application.name}.swf" />
                  <arg line="-keep-as3-metadata='Bindable,Managed,ChangeEvent,NonCommittingChangeEvent,Transient'" />
              </exec>
      
              <!-- Delete the unoptimized SWF, don't need it anymore -->
              <delete file="${deploy.dir}/lib/library.swf" />
      
              <!-- Restore the digest from catalog.xml -->
              <exec executable="${flex.digest}" dir="." failonerror="true">
                  <arg line="-digest.rsl-file ${deploy.dir}/${application.name}.swf" />
                  <arg line="-digest.swc-path ${swc.export}" />
              </exec>
           </target>
      
       
      

       

      pic 2:  ant script to compile bs_comp component which includes bs_vo as dependency

       

           <!-- Compile component files -->
           <target name="compile" depends="init,doWindows,doUnix" description="Compiles the mxml/as source files">
                <!-- Create the deploy directory if it doesn't exist -->
                <mkdir dir="${deploy.dir}" />
                <mkdir dir="${deploy.dir}/lib" />
      
                <!-- Compile Flex mxm/as files -->
                <compc output="${swc.export}" locale="${DEFAULT.LOCAL}" debug="${FLEX_DEBUG}">
      
                     <!-- Define namespace to be referenced in other MXML source files -->
                     <namespace uri="http://bidshift.com/component" manifest="${manifest.xml.file}" />
                     <include-namespaces uri="http://bidshift.com/component" />
      
                     <namespace uri="http://mikenimer.com/component" manifest="${nimer.manifest.xml.file}"/>
                     <include-namespaces uri="http://mikenimer.com/component"/>
      
                     <namespace uri="http://hevery.com/component" manifest="${hevery.manifest.xml.file}"/>
                     <include-namespaces uri="http://hevery.com/component"/>
      
                     <namespace uri="http://adobe_extra.com/component" manifest="${adobe.manifest.xml.file}"/>
                     <include-namespaces uri="http://adobe_extra.com/component"/>
      
                     <!-- Load default compiler options -->
                  <load-config filename="${FLEX_HOME}/frameworks/${flex.conf.filename}" />
      
                     <!-- List of path elements that form the roots of ActionScript
                     class hierarchies -->
                     <source-path path-element="${FLEX_HOME}/frameworks"/>
      
                     <!-- Path of mxml/as source files -->
                     <compiler.source-path path-element="${src.dir}" />
      
                     <!-- List of SWC files or directories that contain SWC files use to
                          build and include in the component -->
                     <compiler.include-libraries dir="${lib.dir}" append="true">
                          <include name="**/*.swc" />
                     </compiler.include-libraries>
      
                     <!-- List of SWC files or directories to compile against but to omit
                       from linking -->
                              <compiler.external-library-path dir="${deploy.dir}/lib">
                                   <include name="bs_vo.swc" />
                              </compiler.external-library-path>
      
                     <!-- Do not merge the framework SWC files -->
                     <compiler.external-library-path dir="${FLEX_HOME}/frameworks/" append="true">
                          <include name="libs/**/*.swc" />
                          <exclude name="libs/framework.swc" />
                          <exclude name="libs/rpc.swc" />
                     </compiler.external-library-path>
                </compc>
      
              <!--*****************************************************-->
              <!-- Prepare the RSL so that it can be found at run time -->
              <!--******************************************************-->
      
              <!-- Extract the SWF file from the SWC file -->
              <unzip src="${swc.export}" dest="${deploy.dir}/lib">
                  <patternset>
                      <include name="library.swf" />
                  </patternset>
              </unzip>
      
              <!-- Run the flex optimizer on the extracted SWF so that it does not
                   contain any debug code or unnecessary metadata.  Note that the
                   as3 metadata that's kept, it's required -->
              <exec executable="${flex.optimizer}" dir="." failonerror="true">
                  <arg line="-input ${deploy.dir}/lib/library.swf -output ${deploy.dir}/${application.name}.swf" />
                  <arg line="-keep-as3-metadata='Bindable,Managed,ChangeEvent,NonCommittingChangeEvent,Transient'" />
              </exec>
      
              <!-- Delete the unoptimized SWF, don't need it anymore -->
              <delete file="${deploy.dir}/lib/library.swf" />
      
              <!-- Restore the digest from catalog.xml -->
              <exec executable="${flex.digest}" dir="." failonerror="true">
                  <arg line="-digest.rsl-file ${deploy.dir}/${application.name}.swf" />
                  <arg line="-digest.swc-path ${swc.export}" />
              </exec>
           </target>
      
       
      

       

      pic 3:  ant script to compile application

       

           <!-- Compile Main application -->
           <target name="compile" depends="init" description="Compiles the mxml/as source files">
                <!-- get the common styles css files -->
                <copy todir="${src.assets}" includeEmptyDirs="no">
                     <fileset dir="${assets.dir}">
                          <include name="**/*.css" />
                          <include name="**/*.gif" />
                          <include name="**/*.jpg" />
                          <include name="**/*.png" />
                          <include name="**/*.svg" />
                          <include name="**/*.swf" />
                          <include name="**/*.ttf" />
                     </fileset>
                </copy>
      
                <!-- Compile client flex mxm/as -->
                <mxmlc file="${main.class}"
                     output="${swf.export}"
                     services="${server.conf.dir}/flex/services-config.xml"
                     context-root="${WEBAPP_CONTEXT_ROOT}"
                     use-network="true"
                     actionscript-file-encoding="${ENCODING}"
                     keep-generated-actionscript="false"
                     incremental="false"
                    debug="${FLEX_DEBUG}"
                     static-link-runtime-shared-libraries="false"
                    link-report="${deploy.dir}/bs_employee_calendar_link-report.xml">
      
                     <!-- Load default compiler options -->
                  <load-config filename="${FLEX_HOME}/frameworks/${flex.conf.filename}" />
      
                     <!-- List of path elements that form the roots of ActionScript class hierarchies -->
                     <source-path path-element="${FLEX_HOME}/frameworks"/>
      
                     <!-- Path of mxml/as source files -->
                     <compiler.source-path path-element="${src.dir}"/>
      
                     <!-- List of SWC files or directories that contain SWC files use to
                          build and include in the component -->
                     <compiler.include-libraries dir="${lib.dir}" append="true">
                          <include name="**/*.swc"/>
                          <exclude name="bs_vo.swc"/>
                          <exclude name="bs_comp.swc"/>
                     </compiler.include-libraries>
      
                     <!--******************************************************-->
                              <!-- Location and other information about an RSL that the -->
                              <!-- application will use                                 -->
                     <!--******************************************************-->
      
                  <!-- Framework RSL linked libraries -->
                  <runtime-shared-library-path path-element="${FRAMEWORKS}/libs/framework.swc">
                      <url rsl-url="framework_3.5.0.12683.swz"/>
                      <url rsl-url="framework_3.5.0.12683.swf"/>
                  </runtime-shared-library-path>
      
                  <!-- RPC RSL linked libraries -->
                  <runtime-shared-library-path path-element="${FRAMEWORKS}/libs/rpc.swc">
                      <url rsl-url="rpc_3.5.0.12683.swz"/>
                      <url rsl-url="rpc_3.5.0.12683.swf"/>
                  </runtime-shared-library-path>
      
                  <!-- Third party RSL linked libraries -->
                  <runtime-shared-library-path path-element="${flex.src.dir}/deploy/lib/bs_vo.swc">
                      <url rsl-url="bs_vo.swf"/>
                  </runtime-shared-library-path>
      
                  <runtime-shared-library-path path-element="${flex.src.dir}/deploy/lib/bs_comp.swc">
                      <url rsl-url="bs_comp.swf"/>
                  </runtime-shared-library-path>
                </mxmlc>
           </target>
      
       
      

       

      Thanks in advance.