How to handle Flex-projects

Introduction

The build-process of the existing Flex-projects was changed to the Maven-Way. Both referencing between projects/frameworks and resource-handling (graphics, styles) was modified. This documentation is going to explain the changes and details and to what attention should be paid to.

Maven-Configuration

To avoid the known datavisualizition’s “watermark”-problem, when compiling a swf, a valid flex-license during the compiling-step is needed. Due to security reasons our flex-license should be hided in the Maven-Settings (and not in the public POM-files). For this reason the following license-key definition must be added to the settings’ profiles ( ${maven-directory}/conf/ settings.xml):

 

<profiles>
    <profile>
        <id>flex_license</id>
        <properties>
            <flexbuilder.3.license>xxxx-xxxx-xxxx-xxxx-xxxx-xxxx</flexbuilder.3.license>
        </properties>
    </profile>
</profiles>

  To prevent license-dependent build-errors this profile must be active by default:

<activeProfiles>
    <activeProfile>flex_license</activeProfile>
</activeProfiles>

Important note: To get the needed Maven-plugins and flex-frameworks, access to our Nexus-Repository is necessary!

<mirror>
    <id>nexus</id>
    <mirrorOf>\*</mirrorOf>
    <url>http://nexus.next-level-apps.com:8081/nexus/content/groups/public</url>
</mirror>

Framework- and Project-dependencies

Following flex-frameworks are included in the core/org.b2bbp.admin.ui-project and will be known in every project, that has a dependency to core/org.b2bbp.admin.ui or to an project, which has such an dependency:

<dependency>
    <groupId>com.adobe.cairngorm</groupId>
    <artifactId>cairngorm</artifactId>
    <version>2.2.2</version>
    <type>swc</type>
</dependency>

<dependency>
    <groupId>com.adobe.cairngorm</groupId>
    <artifactId>cairngormEnterprise</artifactId>
    <version>2.2.2</version>
    <type>swc</type>
</dependency>

<dependency>
    <groupId>com.google.code</groupId>
    <artifactId>flexiframe</artifactId>
    <version>1.5.2</version>
    <type>swc</type>
</dependency>

<dependency>
    <groupId>com.asfusion.mate</groupId>
    <artifactId>mate-framework</artifactId>
    <version>0.8.9</version>
    <type>swc</type>
</dependency>

<dependency>
    <groupId>org.osflash.thunderbolt</groupId>
    <artifactId>thunderbolt-as3</artifactId>
    <version>2.3.0</version>
    <type>swc</type>
</dependency>

<dependency>
    <groupId>com.adobe.flex.framework</groupId>
    <artifactId>datavisualization</artifactId>
    <version>${flex.sdk.version}</version>
    <type>swc</type>
</dependency>

<dependency>
    <groupId>com.adobe.flex.framework</groupId>
    <artifactId>datavisualization_rb</artifactId>
    <version>${flex.sdk.version}</version>
    <type>swc</type>
</dependency>

<dependency>
    <groupId>com.hillelcoren.component</groupId>
    <artifactId>AdvancedAutoComplete</artifactId>
    <version>1.0</version>
    <type>swc</type>
</dependency>

Every flex-project should have At least a transitive dependency to core/org.b2bbp.admin.ui:

<dependency>
    <groupId>org.b2bbp</groupId>
    <artifactId>org.b2bbp.admin.ui</artifactId>
    <version>1.6.5-SNAPSHOT</version>
    <type>swc</type>
</dependency>

All images and style sheets from the admin.ui-project will be known, because of this inclusion. You can embed these resources with - for example - following relative paths:

  • images/ …. .png
  • images/myImages/ …. .png
  • images/famfamfam-icons/ … .png
  • style/yflexskin.css
  • style/b2bbp\_styles.css

Create importable flex-projects ( ‘mvn eclipse:eclipse’ for flex-projects )

With the following Maven-command it is possible to create flex-project description-files like:

  • .project
  • .actionScriptProperties
  • .flexProperties
  • .flexLibProperties
  • .flexConfig.xml

The FlashBuilder needs these files for project identification.

mvn generate-sources -DdownloadSources=true -P flex,flashbuilder,!flexbuild,!java,!customers

 Important note: Once you have created the listed property- and description-files add their signature (.* html-template bin-debug …) to the TortoiseSVN Global Ignore Patterns at…

TortoiseSVN -> Settings -> General -> Subversion (Global Ignore Pattern)

…to never “check” them “in”, again!

Prepare an FlashBuilder-workspace

This section describes in which way a flex-workspace should be prepared before the existing projects can be imported without getting errors or warnings. We presume a FlashBuilder 4.6 or 4.7 is correctly installed on your machine. We recommend using a new workspace for this purpose. First of all you can create a new folder on the file-system, then run the FlashBuilder and switch the workspace at…

FlashBuilder -> File -> Switch Workspace… -> Other…

Browse to the new created folder and confirm the folder-selection. FlashBuilder will be restarted.

Set up a new Flex-SDK ( 3.3.0.4852 )

In addition to source- and workspace-paths every eclipse-based develop environment saves a huge amount of variables, configurations and settings in a special folder called “.metadata”. Among others information about the used Flex-SDK is stored there. For special reasons our company uses a licensed SDK and so it is necessary to add this to the workspace.

  1. Download and extract the special flex_sdk_3.3.0.4852

  2. [FlashBuilder] -> Window -> Preferences -> Flash Builder -> Installed Flex SDKs -> Add…(Button)

Browse to the location of the unpacked SDK, enter a name and confirm the selection. Use the added SDK as default-SDK for this workspace.

Create an global workspace variable ( B2B_HOME )

Lots of projects do have dependencies to other projects. To avoid FlashBuilder-specific problems during the import of the flex-projects we use a ‘global workspace variable’.

Important: Pay attention to the correct spelling of this variable. It is case sensitive!!!

B2B_HOME

Browse to:

[FlashBuilder] -> Window -> Preferences -> General -> Workspace -> Linked Resources

… and create the variable by clicking on the New…-button.

A new window will appear. Browse to the root-folder of your B2B. This folder must contain the following sub-folders:

B2B_HOME

  • contributions
  • core
  • distro
  • extensions
  • products
  • tools
  • webservices

Import existing Flex-projects

Now the workspace-preparation is done and we can start to import the existing projects.

[FlashBuilder] -> right-click on the Package Explorer ->  Import…

And proceed with clicking the Next…-button. Browse to an project which ends with .ui for example:

…\B2B\extensions\modules\analyzer\com.nextlevel.b2b.edi.analyzer.ui

View Me   Edit Me