Skip to content

Flex Library Project

Lloyd Heberlie edited this page Feb 7, 2013 · 1 revision

Using Adobe® Flash® Builder® to compile the HeatMap Library

This is the first step in the Setup for Development

Create a New Flex Library Project

Screenshot

New Flex Library Project - Project Location

  • /Users/lheberlie/Git/Development/FlexViewer/heatmap-widget-flex

Screenshot

New Flex Library Project - Build Paths

  • Add the ArcGIS API for Flex (*.swc)

Screenshot

Set the link type on (ArcGIS API for Flex *.swc) for the library project.

Set the link type for the ArcGIS API for Flex to "External" in the "Flex Library Build Path" for the library project. This just tells the compiler that our library is dependent upon the ArcGIS API for Flex. When/If we distribute our library it will also require the ArcGIS API for Flex too.

Screenshot

Open the Flex Library Project Properties

  • Open the HeatMap Library project properties

Screenshot

Verify the Resource Location in the Project Properties

  • Make sure that the library points to the root of the downloaded source code repository such as "/Users/lheberlie/Git/Development/FlexViewer/heatmap-widget-flex"

Screenshot

Verify the Flex Library Build Path in the Project Properties

Screenshot

Verify the link type on (ArcGIS API for Flex *.swc) for the library project.

Set the link type for the ArcGIS API for Flex to "External" in the "Flex Library Build Path" for the library project. This just tells the compiler that our library is dependent upon the ArcGIS API for Flex. When/If we distribute our library it will also require the ArcGIS API for Flex too.

Screenshot

Set the namespace for the library project.

  • Namespace URL: library://ns.esri.com/github/2013/flex/samples
  • Manifest file (example):
    • Mac: /Users/Jack/Development/heatmap-widget-flex/build-deps/samples-manifest.xml
    • Windows: C:\Development\heatmap-widget-flex\build-deps\samples-manifest.xml

Screenshot

Flex Library Contents

Screenshot

Copy the env-template.properties file.

  • See the graphic above.

Rename the copy to env.properties

  • Update the properties to match your environment.
  • Below is an example of what your env.properties file might look like:

# If you chose to use this file rename it to env.properties and uncomment the
# properties you wish to set.
  
# For each of
#
#       FLEX_HOME
#       AGS_API_HOME
#       AGS_VIEWER_HOME
#
# you need to set an environment variable with that name or set the property here
# prefixed with "env.".  If a property is set in this file, and the corresponding 
# environment variable is also set, the property set here takes precedence over the 
# corresponding environment variable.
#
# Use absolute file paths. 
# 
# This is a Java property file.  On Windows if you use the '\' file 
# separator you must use "\\", but not escape spaces, for example,
#
#       env.FLEX_HOME=C:\\Program Files (x86)\\Adobe\\Adobe Flash Builder 4.6\\sdks\\4.6.0
#       env.AGS_API_HOME=C:\\arcgis_api_for_flex_3.x\\arcgis_api_for_flex_3_1\\ArcGIS_Flex\\libs
#       env.AGS_VIEWER_HOME=C:\\Git\\Development\\FlexViewer\\arcgis-viewer-flex
#

#
# Set this to the directory that contains the Adobe Flex SDK
# for your platform.
#
# On Windows (32-bit), if installed to the default location, the setting would be
#   env.FLEX_HOME=C:\\Program Files\\Adobe\\Adobe Flash Builder 4.6\\sdks\\4.6.0
#
# or on a 64-bit version of Windows
#       env.FLEX_HOME=C:\\Program Files (x86)\\Adobe\\Adobe Flash Builder 4.6\\sdks\\4.6.0
#
# Note: the folder "Program Files" (or "Program Files (x86)") might have a different name
# depending on the language of your Windows installation.
#
# On Mac, if installed to the default location, the setting would be
#   env.FLEX_HOME=/Applications/Adobe Flash Builder 4.6/sdks/4.6.0
#
env.FLEX_HOME=/Applications/Adobe Flash Builder 4.6/sdks/4.6.0

#
# Set this to the directory that contains the ArcGIS API for Flex library
# for your platform.
#
# On Windows, this setting might be something like
#       env.AGS_API_HOME=C:\\arcgis_api_for_flex_3.x\\arcgis_api_for_flex_3_1\\ArcGIS_Flex\\libs
#
# On Mac, this setting might be something like
#       env.AGS_API_HOME=/Users/Jack/arcgis_api_for_flex_3.x/arcgis_api_for_flex_3_1/ArcGIS_Flex/libs
#
env.AGS_API_HOME=/Users/lheberlie/ArcGIS/Flex/Released/arcgis_api_for_flex_3.x/arcgis_api_for_flex_3_1/ArcGIS_Flex/libs

#
# Set this to the directory that contains the ArcGIS Viewer for Flex application
# for your platform.
#
# On Windows, this setting might be something like
#       env.AGS_VIEWER_HOME=C:\\Git\\Development\\FlexViewer\\arcgis-viewer-flex
#
# On Mac, this setting might be something like
#       env.AGS_VIEWER_HOME=/Users/Jack/Git/Development/FlexViewer/arcgis-viewer-flex
#
env.AGS_VIEWER_HOME=/Users/lheberlie/Git/Development/FlexViewer/arcgis-viewer-flex

Verify the build.properties file

  • project.ags.swc - this must match exactly the name of the ArcGIS API for Flex swc.
  • project.library.release.version - this should match whatever version of the ArcGIS API for Flex you are building against.
  • project.appbuilder.release.version - this should match the version of the ArcGIS API for Flex you are building against.
  • project.appbuilder.widget.release.version - this is the version number on your zip file that is created for Application Builder distribution.

project.ags.swc=agslib-3.1-2012-12-12.swc

project.namespace=library://ns.esri.com/github/2013/flex/samples

project.library.release.version=3.1
project.library.release.name=heatmap
project.library.release=dist

project.asdoc.release=docs
project.asdoc.main-title=ArcGIS API Samples for Flex 3.1
project.asdoc.window-title=ArcGIS API Samples for Flex 3.1

project.viewer.locale=en_US

project.widget.moduleDirectory=widgets
project.widget.moduleSubDirectory=HeatMap
project.widget.moduleFileName=HeatMapWidget.mxml
project.widget.release=dist-widget

project.appbuilder.release.version=3.1
project.appbuilder.widget.release.name=HeatMap
project.appbuilder.widget.release.version=3.1.0

Show the Ant View

  • Using Adobe® Flash® Builder®, show the Ant View: Window -> Show View -> Other -> Ant

Screenshot

Select the Ant View

Screenshot

Add the build file to the Ant View

  • Add the build.xml file to the Ant View
    • Right click inside the Ant View window, "Add BuildFiles...", and browse to the build.xml file include in the heatmap-widget-flex repository.

Screenshot

Screenshot

Compile the HeatMap Library and HeatMap Widget

  • Double click the project name esri-github-flex-samples (heatmap library and widget) in the Ant View Window, this will run the default target named "main" which will build the entire project.

Screenshot

Compile results (Mac®)


Buildfile: /Users/lheberlie/Git/Development/FlexViewer/heatmap-widget-flex/build.xml
check-java-home:
     [echo] JAVA_HOME is /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
     [echo] VM: Java HotSpot(TM) 64-Bit Server VM / 20.12-b01-434
     [echo] Java: 1.6.0_37
check-ant-home:
     [echo] ANT_HOME is /Applications/Adobe Flash Builder 4.6/eclipse/plugins/org.apache.ant_1.8.2.v20110505-1300
     [echo] Ant: Apache Ant(TM) version 1.8.2 compiled on December 20 2010 Ant Java Version: 1.6
     [echo] Ant Project: esri-github-flex-samples (heatmap library and widget)
     [echo] Ant Project Build file: /Users/lheberlie/Git/Development/FlexViewer/heatmap-widget-flex/build.xml
check-flex-home:
     [echo] FLEX_HOME is /Applications/Adobe Flash Builder 4.6/sdks/4.6.0
check-ags-api-home:
     [echo] AGS_API_HOME is /Users/lheberlie/ArcGIS/Flex/Released/arcgis_api_for_flex_3.x/arcgis_api_for_flex_3_1/ArcGIS_Flex/libs
     [echo] Using ArcGIS API for Flex (agslib-3.1-2012-12-12.swc) in
     [echo] /Users/lheberlie/ArcGIS/Flex/Released/arcgis_api_for_flex_3.x/arcgis_api_for_flex_3_1/ArcGIS_Flex/libs
check-ags-viewer-home:
     [echo] AGS_VIEWER_HOME is /Users/lheberlie/Git/Development/FlexViewer/arcgis-viewer-flex
     [echo] Using ArcGIS Viewer for Flex in
     [echo] /Users/lheberlie/Git/Development/FlexViewer/arcgis-viewer-flex
pre-build:
set-project-properties:
clean-library:
   [delete] Deleting directory /Users/lheberlie/Git/Development/FlexViewer/heatmap-widget-flex/dist
   [delete] Deleting directory /Users/lheberlie/Git/Development/FlexViewer/heatmap-widget-flex/docs
create-library-directories:
    [mkdir] Created dir: /Users/lheberlie/Git/Development/FlexViewer/heatmap-widget-flex/dist
    [mkdir] Created dir: /Users/lheberlie/Git/Development/FlexViewer/heatmap-widget-flex/docs
clean-build-library:
build-library:
     [echo] Starting component compiler process...
     [echo] Compiling /Users/lheberlie/Git/Development/FlexViewer/heatmap-widget-flex/src
     [java] Loading configuration file /Applications/Adobe Flash Builder 4.6/sdks/4.6.0/frameworks/flex-config.xml
     [java] Loading configuration file /Users/lheberlie/Git/Development/FlexViewer/heatmap-widget-flex/build-deps/samples-namespace.xml
     [java] /Users/lheberlie/Git/Development/FlexViewer/heatmap-widget-flex/dist/agslib-3.1-heatmap-2013-02-06.swc (47167 bytes)
     [echo] Finishing component compiler process...
     [echo] Finished compiling /Users/lheberlie/Git/Development/FlexViewer/heatmap-widget-flex/src
     [echo] Success! Created agslib-3.1-heatmap-2013-02-06.swc
build-library-documentation:
     [echo] Generating documentation...
     [java] Loading configuration file /Applications/Adobe Flash Builder 4.6/sdks/4.6.0/frameworks/flex-config.xml
     [java] Loading configuration file /Users/lheberlie/Git/Development/FlexViewer/heatmap-widget-flex/build-deps/samples-namespace.xml
     [java] Loading configuration file /Users/lheberlie/Git/Development/FlexViewer/heatmap-widget-flex/build-deps/doc/samples-asdoc-config.xml
     [java] Documentation was created in /Users/lheberlie/Git/Development/FlexViewer/heatmap-widget-flex/docs/
     [echo] Success! Finished generating documentation...
post-process-library:
     [echo] Integrating documentation and project library swc
      [zip] Updating zip: /Users/lheberlie/Git/Development/FlexViewer/heatmap-widget-flex/dist/agslib-3.1-heatmap-2013-02-06.swc
   [delete] Deleting directory /Users/lheberlie/Git/Development/FlexViewer/heatmap-widget-flex/docs/tempdita
   [delete] Deleting: /Users/lheberlie/Git/Development/FlexViewer/heatmap-widget-flex/docs/index.tmp
   [delete] Deleting: /Users/lheberlie/Git/Development/FlexViewer/heatmap-widget-flex/docs/toplevel.xml
     [echo] Success! Finished integrating documentation and project library swc.
release-library:
clean-widget:
create-widget-directories:
    [mkdir] Created dir: /Users/lheberlie/Git/Development/FlexViewer/heatmap-widget-flex/dist-widget
    [mkdir] Created dir: /Users/lheberlie/Git/Development/FlexViewer/heatmap-widget-flex/build-widget-deps
clean-build-widget:
create-viewer-module-linker-report:
     [echo] Starting mxmlc command-line compiler process...
     [echo] Creating linker report for '/Users/lheberlie/Git/Development/FlexViewer/arcgis-viewer-flex'
     [java] Loading configuration file /Applications/Adobe Flash Builder 4.6/sdks/4.6.0/frameworks/flex-config.xml
     [java] Required RSLs:
     [java]     http://fpdownload.adobe.com/pub/swz/flex/4.6.0.23201/framework_4.6.0.23201.swz with 1 failover.
     [java]     http://fpdownload.adobe.com/pub/swz/tlf/2.0.0.232/textLayout_2.0.0.232.swz with 1 failover.
     [java]     http://fpdownload.adobe.com/pub/swz/flex/4.6.0.23201/spark_4.6.0.23201.swz with 1 failover.
     [java]     http://fpdownload.adobe.com/pub/swz/flex/4.6.0.23201/sparkskins_4.6.0.23201.swz with 1 failover.
     [java]     http://fpdownload.adobe.com/pub/swz/flex/4.6.0.23201/rpc_4.6.0.23201.swz with 1 failover.
     [java]     http://fpdownload.adobe.com/pub/swz/flex/4.6.0.23201/charts_4.6.0.23201.swz with 1 failover.
     [java]     http://fpdownload.adobe.com/pub/swz/flex/4.6.0.23201/osmf_1.0.0.16316.swz with 1 failover.
     [java]     http://fpdownload.adobe.com/pub/swz/flex/4.6.0.23201/mx_4.6.0.23201.swz with 1 failover.
     [java] /Users/lheberlie/Git/Development/FlexViewer/heatmap-widget-flex/build-widget-deps/index.swf (683470 bytes)
     [echo] Finished! Creating linker report for '/Users/lheberlie/Git/Development/FlexViewer/arcgis-viewer-flex'
build-widget:
     [echo] Starting mxmlc command-line compiler process...
     [echo] Compiling widgets/HeatMap/HeatMapWidget.mxml
     [echo] for project /Users/lheberlie/Git/Development/FlexViewer/arcgis-viewer-flex
     [java] Loading configuration file /Applications/Adobe Flash Builder 4.6/sdks/4.6.0/frameworks/flex-config.xml
     [java] Required RSLs:
     [java]     http://fpdownload.adobe.com/pub/swz/flex/4.6.0.23201/framework_4.6.0.23201.swz with 1 failover.
     [java]     http://fpdownload.adobe.com/pub/swz/tlf/2.0.0.232/textLayout_2.0.0.232.swz with 1 failover.
     [java]     http://fpdownload.adobe.com/pub/swz/flex/4.6.0.23201/spark_4.6.0.23201.swz with 1 failover.
     [java]     http://fpdownload.adobe.com/pub/swz/flex/4.6.0.23201/sparkskins_4.6.0.23201.swz with 1 failover.
     [java]     http://fpdownload.adobe.com/pub/swz/flex/4.6.0.23201/rpc_4.6.0.23201.swz with 1 failover.
     [java]     http://fpdownload.adobe.com/pub/swz/flex/4.6.0.23201/charts_4.6.0.23201.swz with 1 failover.
     [java]     http://fpdownload.adobe.com/pub/swz/flex/4.6.0.23201/osmf_1.0.0.16316.swz with 1 failover.
     [java]     http://fpdownload.adobe.com/pub/swz/flex/4.6.0.23201/mx_4.6.0.23201.swz with 1 failover.
     [java] /Users/lheberlie/Git/Development/FlexViewer/heatmap-widget-flex/dist-widget/widgets/HeatMap/HeatMapWidget.swf (98721 bytes)
     [echo] Finishing mxmlc command-line compiler process...
     [echo] Finished compiling 'widgets/HeatMap/HeatMapWidget.mxml'
     [echo] Success! Created 'widgets/HeatMap/HeatMapWidget.swf'
post-process-widget:
     [echo] Assembling widget for Application Builder.
     [echo] Does the HeatMapWidget include a config file ? true : /Users/lheberlie/Git/Development/FlexViewer/heatmap-widget-flex/viewer-HeatMapWidget/src/widgets/HeatMap/HeatMapWidget.xml
     [echo] Does the HeatMapWidget include additional assets ? true : /Users/lheberlie/Git/Development/FlexViewer/heatmap-widget-flex/viewer-HeatMapWidget/src/widgets/HeatMap/assets
     [echo] Does the HeatMapWidget include a meta config file ? true : /Users/lheberlie/Git/Development/FlexViewer/heatmap-widget-flex/viewer-HeatMapWidget/src/widgets/HeatMap/meta.xml
     [echo] Copying '/Users/lheberlie/Git/Development/FlexViewer/heatmap-widget-flex/viewer-HeatMapWidget/src/widgets/HeatMap/HeatMapWidget.xml'
     [echo] to '/Users/lheberlie/Git/Development/FlexViewer/heatmap-widget-flex/dist-widget/widgets/HeatMap'
     [copy] Copying 1 file to /Users/lheberlie/Git/Development/FlexViewer/heatmap-widget-flex/dist-widget/widgets/HeatMap
     [echo] Copying '/Users/lheberlie/Git/Development/FlexViewer/heatmap-widget-flex/viewer-HeatMapWidget/src/widgets/HeatMap/assets/*'
     [echo] to '/Users/lheberlie/Git/Development/FlexViewer/heatmap-widget-flex/dist-widget/widgets/HeatMap/assets'
    [mkdir] Created dir: /Users/lheberlie/Git/Development/FlexViewer/heatmap-widget-flex/dist-widget/widgets/HeatMap/assets
     [copy] Copying 8 files to /Users/lheberlie/Git/Development/FlexViewer/heatmap-widget-flex/dist-widget/widgets/HeatMap/assets
     [echo] Copying '/Users/lheberlie/Git/Development/FlexViewer/heatmap-widget-flex/viewer-HeatMapWidget/src/widgets/HeatMap/meta.xml'
     [echo] to '/Users/lheberlie/Git/Development/FlexViewer/heatmap-widget-flex/dist-widget/widgets/HeatMap/meta.xml'
     [copy] Copying 1 file to /Users/lheberlie/Git/Development/FlexViewer/heatmap-widget-flex/dist-widget/widgets/HeatMap
      [zip] Building zip: /Users/lheberlie/Git/Development/FlexViewer/heatmap-widget-flex/dist/AppBuilder-3.1_HeatMapWidget-3.1.0.zip
     [echo] Success! Assembled widget for Application Builder.
set-project-properties:
clean-widget:
   [delete] Deleting directory /Users/lheberlie/Git/Development/FlexViewer/heatmap-widget-flex/dist-widget
   [delete] Deleting directory /Users/lheberlie/Git/Development/FlexViewer/heatmap-widget-flex/build-widget-deps
release-widget:
main:
BUILD SUCCESSFUL
Total time: 43 seconds

Compile results (Windows®)


Buildfile: C:\Git\Development\FlexViewer\heatmap-widget-flex\build.xml
check-java-home:
     [echo] JAVA_HOME is C:\Program Files\Adobe\Adobe Flash Builder 4.7 (64 Bit)\jre
     [echo] VM: Java HotSpot(TM) 64-Bit Server VM / 20.6-b01
     [echo] Java: 1.6.0_31
check-ant-home:
     [echo] ANT_HOME is C:\Program Files\Adobe\Adobe Flash Builder 4.7 (64 Bit)\eclipse\plugins\org.apache.ant_1.8.2.v20110505-1300
     [echo] Ant: Apache Ant(TM) version 1.8.2 compiled on December 20 2010 Ant Java Version: 1.6
     [echo] Ant Project: esri-github-flex-samples (heatmap library and widget)
     [echo] Ant Project Build file: C:\Git\Development\FlexViewer\heatmap-widget-flex\build.xml
check-flex-home:
     [echo] FLEX_HOME is C:\Program Files\Adobe\Adobe Flash Builder 4.7 (64 Bit)\sdks\4.6.0
check-ags-api-home:
     [echo] AGS_API_HOME is C:\ArcGIS\Flex\Released\arcgis_api_for_flex_3.x\arcgis_api_for_flex_3_1\ArcGIS_Flex\libs
     [echo] Using ArcGIS API for Flex (agslib-3.1-2012-12-12.swc) in
     [echo] C:\ArcGIS\Flex\Released\arcgis_api_for_flex_3.x\arcgis_api_for_flex_3_1\ArcGIS_Flex\libs
check-ags-viewer-home:
     [echo] AGS_VIEWER_HOME is C:\Git\Development\FlexViewer\arcgis-viewer-flex
     [echo] Using ArcGIS Viewer for Flex in
     [echo] C:\Git\Development\FlexViewer\arcgis-viewer-flex
pre-build:
set-project-properties:
clean-library:
   [delete] Deleting directory C:\Git\Development\FlexViewer\heatmap-widget-flex\dist
   [delete] Deleting directory C:\Git\Development\FlexViewer\heatmap-widget-flex\docs
create-library-directories:
    [mkdir] Created dir: C:\Git\Development\FlexViewer\heatmap-widget-flex\dist
    [mkdir] Created dir: C:\Git\Development\FlexViewer\heatmap-widget-flex\docs
clean-build-library:
build-library:
     [echo] Starting component compiler process...
     [echo] Compiling C:\Git\Development\FlexViewer\heatmap-widget-flex\src
     [java] Loading configuration file C:\Program Files\Adobe\Adobe Flash Builder 4.7 (64 Bit)\sdks\4.6.0\frameworks\flex-config.xml
     [java] Loading configuration file C:\Git\Development\FlexViewer\heatmap-widget-flex\build-deps\samples-namespace.xml
     [java] C:\Git\Development\FlexViewer\heatmap-widget-flex\dist\agslib-3.1-heatmap-2013-02-06.swc (47106 bytes)
     [echo] Finishing component compiler process...
     [echo] Finished compiling C:\Git\Development\FlexViewer\heatmap-widget-flex\src
     [echo] Success! Created agslib-3.1-heatmap-2013-02-06.swc
build-library-documentation:
     [echo] Generating documentation...
     [java] Loading configuration file C:\Program Files\Adobe\Adobe Flash Builder 4.7 (64 Bit)\sdks\4.6.0\frameworks\flex-config.xml
     [java] Loading configuration file C:\Git\Development\FlexViewer\heatmap-widget-flex\build-deps\samples-namespace.xml
     [java] Loading configuration file C:\Git\Development\FlexViewer\heatmap-widget-flex\build-deps\doc\samples-asdoc-config.xml
     [java] Documentation was created in C:\Git\Development\FlexViewer\heatmap-widget-flex\docs\
     [echo] Success! Finished generating documentation...
post-process-library:
     [echo] Integrating documentation and project library swc
      [zip] Updating zip: C:\Git\Development\FlexViewer\heatmap-widget-flex\dist\agslib-3.1-heatmap-2013-02-06.swc
   [delete] Deleting directory C:\Git\Development\FlexViewer\heatmap-widget-flex\docs\tempdita
   [delete] Deleting: C:\Git\Development\FlexViewer\heatmap-widget-flex\docs\index.tmp
   [delete] Deleting: C:\Git\Development\FlexViewer\heatmap-widget-flex\docs\toplevel.xml
     [echo] Success! Finished integrating documentation and project library swc.
release-library:
clean-widget:
create-widget-directories:
    [mkdir] Created dir: C:\Git\Development\FlexViewer\heatmap-widget-flex\dist-widget
    [mkdir] Created dir: C:\Git\Development\FlexViewer\heatmap-widget-flex\build-widget-deps
clean-build-widget:
create-viewer-module-linker-report:
     [echo] Starting mxmlc command-line compiler process...
     [echo] Creating linker report for 'C:\Git\Development\FlexViewer\arcgis-viewer-flex'
     [java] Loading configuration file C:\Program Files\Adobe\Adobe Flash Builder 4.7 (64 Bit)\sdks\4.6.0\frameworks\flex-config.xml
     [java] Required RSLs:
     [java]     http://fpdownload.adobe.com/pub/swz/flex/4.6.0.23201/framework_4.6.0.23201.swz with 1 failover.
     [java]     http://fpdownload.adobe.com/pub/swz/tlf/2.0.0.232/textLayout_2.0.0.232.swz with 1 failover.
     [java]     http://fpdownload.adobe.com/pub/swz/flex/4.6.0.23201/spark_4.6.0.23201.swz with 1 failover.
     [java]     http://fpdownload.adobe.com/pub/swz/flex/4.6.0.23201/sparkskins_4.6.0.23201.swz with 1 failover.
     [java]     http://fpdownload.adobe.com/pub/swz/flex/4.6.0.23201/rpc_4.6.0.23201.swz with 1 failover.
     [java]     http://fpdownload.adobe.com/pub/swz/flex/4.6.0.23201/charts_4.6.0.23201.swz with 1 failover.
     [java]     http://fpdownload.adobe.com/pub/swz/flex/4.6.0.23201/osmf_1.0.0.16316.swz with 1 failover.
     [java]     http://fpdownload.adobe.com/pub/swz/flex/4.6.0.23201/mx_4.6.0.23201.swz with 1 failover.
     [java] C:\Git\Development\FlexViewer\heatmap-widget-flex\build-widget-deps\index.swf (683506 bytes)
     [echo] Finished! Creating linker report for 'C:\Git\Development\FlexViewer\arcgis-viewer-flex'
build-widget:
     [echo] Starting mxmlc command-line compiler process...
     [echo] Compiling widgets/HeatMap/HeatMapWidget.mxml
     [echo] for project C:\Git\Development\FlexViewer\arcgis-viewer-flex
     [java] Loading configuration file C:\Program Files\Adobe\Adobe Flash Builder 4.7 (64 Bit)\sdks\4.6.0\frameworks\flex-config.xml
     [java] Required RSLs:
     [java]     http://fpdownload.adobe.com/pub/swz/flex/4.6.0.23201/framework_4.6.0.23201.swz with 1 failover.
     [java]     http://fpdownload.adobe.com/pub/swz/tlf/2.0.0.232/textLayout_2.0.0.232.swz with 1 failover.
     [java]     http://fpdownload.adobe.com/pub/swz/flex/4.6.0.23201/spark_4.6.0.23201.swz with 1 failover.
     [java]     http://fpdownload.adobe.com/pub/swz/flex/4.6.0.23201/sparkskins_4.6.0.23201.swz with 1 failover.
     [java]     http://fpdownload.adobe.com/pub/swz/flex/4.6.0.23201/rpc_4.6.0.23201.swz with 1 failover.
     [java]     http://fpdownload.adobe.com/pub/swz/flex/4.6.0.23201/charts_4.6.0.23201.swz with 1 failover.
     [java]     http://fpdownload.adobe.com/pub/swz/flex/4.6.0.23201/osmf_1.0.0.16316.swz with 1 failover.
     [java]     http://fpdownload.adobe.com/pub/swz/flex/4.6.0.23201/mx_4.6.0.23201.swz with 1 failover.
     [java] C:\Git\Development\FlexViewer\heatmap-widget-flex\dist-widget\widgets\HeatMap\HeatMapWidget.swf (98773 bytes)
     [echo] Finishing mxmlc command-line compiler process...
     [echo] Finished compiling 'widgets/HeatMap/HeatMapWidget.mxml'
     [echo] Success! Created 'widgets/HeatMap/HeatMapWidget.swf'
post-process-widget:
     [echo] Assembling widget for Application Builder.
     [echo] Does the HeatMapWidget include a config file ? true : C:\Git\Development\FlexViewer\heatmap-widget-flex/viewer-HeatMapWidget/src/widgets/HeatMap/HeatMapWidget.xml
     [echo] Does the HeatMapWidget include additional assets ? true : C:\Git\Development\FlexViewer\heatmap-widget-flex/viewer-HeatMapWidget/src/widgets/HeatMap/assets
     [echo] Does the HeatMapWidget include a meta config file ? true : C:\Git\Development\FlexViewer\heatmap-widget-flex/viewer-HeatMapWidget/src/widgets/HeatMap/meta.xml
     [echo] Copying 'C:\Git\Development\FlexViewer\heatmap-widget-flex/viewer-HeatMapWidget/src/widgets/HeatMap/HeatMapWidget.xml'
     [echo] to 'C:\Git\Development\FlexViewer\heatmap-widget-flex\dist-widget/widgets/HeatMap'
     [copy] Copying 1 file to C:\Git\Development\FlexViewer\heatmap-widget-flex\dist-widget\widgets\HeatMap
     [echo] Copying 'C:\Git\Development\FlexViewer\heatmap-widget-flex/viewer-HeatMapWidget/src/widgets/HeatMap/assets/*'
     [echo] to 'C:\Git\Development\FlexViewer\heatmap-widget-flex\dist-widget/widgets/HeatMap/assets'
    [mkdir] Created dir: C:\Git\Development\FlexViewer\heatmap-widget-flex\dist-widget\widgets\HeatMap\assets
     [copy] Copying 8 files to C:\Git\Development\FlexViewer\heatmap-widget-flex\dist-widget\widgets\HeatMap\assets
     [echo] Copying 'C:\Git\Development\FlexViewer\heatmap-widget-flex/viewer-HeatMapWidget/src/widgets/HeatMap/meta.xml'
     [echo] to 'C:\Git\Development\FlexViewer\heatmap-widget-flex\dist-widget/widgets/HeatMap/meta.xml'
     [copy] Copying 1 file to C:\Git\Development\FlexViewer\heatmap-widget-flex\dist-widget\widgets\HeatMap
      [zip] Building zip: C:\Git\Development\FlexViewer\heatmap-widget-flex\dist\AppBuilder-3.1_HeatMapWidget-3.1.0.zip
     [echo] Success! Assembled widget for Application Builder.
set-project-properties:
clean-widget:
   [delete] Deleting directory C:\Git\Development\FlexViewer\heatmap-widget-flex\dist-widget
   [delete] Deleting directory C:\Git\Development\FlexViewer\heatmap-widget-flex\build-widget-deps
release-widget:
main:
BUILD SUCCESSFUL
Total time: 43 seconds

Distribution

If your build completes successfully, you should see results similar to the screenshot below. There will be a zip file in the distribution folder (dist) that is the "ready-to-go" file that you can hand off to users that want to import your widget into Application Builder and the compiled heatmap library that can be shared or put into other Adobe® Flash® Builder® projects.

Screenshot

Flex Library Project - Documentation

Screenshot

Benefits of using a library project:

  1. Since the namespace is tied to a specific package structure, any time you modify the package structure of the library or move components around in it, you have to go through and update all your namespaces.
  2. If you use more than one component from your library in the same MXML file, and those components exist in different packages in your library, you end up with multiple namespaces -- one for each package from which the components came from.
  3. You can reuse the library across projects instead of having to move the source code into your other projects each time you need it.