Skip to end of metadata
Go to start of metadata

Abstract

The Mavenizer tool is used to convert the Apache Flex SDKs and Adobe Air SDKs into Maven artifacts. Automatically creating the Directories, pom-files, copying and moving the resources to the correct destinations. These artifacts can then be used in Maven builds using the Flexmojos plugin (Starting with version 7.x).However we are working on a new Apache Maven plugin, but this will take quite a while till it's finished. Until that's done, please feel free to use Flexmojos 7.x branch. https://flexmojos.atlassian.net/wiki/display/FLEXMOJOS/Home. Currently development of Flexmojos is done at GITHub and the source is available at: https://github.com/chrisdutz/flexmojos

The Mavenizer consists of several parts:

  • Retrievers
  • Converters
    • Flex Converter (Converts a Flex SDK)
    • Flash Converter (Converts an Air SDK)
    • Air Converter (Converts the playerglobal for a given Flash version)
  • Deployers
    • Aether Deployer (Deploys the artifacts directly from inside the Mavenizer VM, a lot faster, but possibly less stable and less options)
    • Maven Deployer (Deploys the artifacts using a locally installed Maven version)

The Mavenizer modules were built in a way that they can be utilized by external tools especially Flexmojos, which is able to automatically download and mavenize AIR and Flash resources.

Building the Mavenizer

Here come the steps needed to build the Generator (Assuming you already have a working Maven installation)

  • Clone the flex-utilities repo (https://git-wip-us.apache.org/repos/asf/flex-utilities.git)
  • Checkout the "develop" branch. (The "mavenizer" directory I will call [home] from now on)
  • Go to the directory [home]
  • Execute "mvn package"

After the build is finished, the directory "mavenizer/core/target" should now have a jar file called "flex-sdk-converter-1.0.0-SNAPSHOT.jar" this jar contains all you need to mavenize a FDK. If you are however trying to embed mavenization capabilities into a dedicated tool, using the individual artifacts is recommendable.

Using the Mavenizer

Warning

Icon

I would suggest not to generate the artifacts into your local repo directly, but to generate it to an empty directory and then move it from there. This makes especially deploying the FDK to a remote repository a lot easier.

 

  1. Prepare the directories:
    1. Use the Flex Installer to download the Flex SDK as well as the Flash and AIR versions you intend on using (I'll call the installation directory "sdkhome")
    2. Create a directory anywhere which will contain the output (I will call it "fdktarget" from now on)
  2. Change to the "sdkhome" directory
  3. Execute the following command:

    (You should wrap the both directory names in double-quotes if they contain spaces)

  4. In order to use the generated Maven version, simply copy all files in "fdktarget" to your maven local repository.

Deploying your artifacts to a remote Maven repository

The SDK deployers allow you to deploy any maven structured directory to a remote maven repository as soon as you've got the remote rights. So be sure not to deploy your maven local repository to a remote as this will deploy everything and not only your flex sdks.

Using the Aether deployer

The AetherDeployer needs 2 or 4 ordered parameters separated by spaces:

  1. fdktarget: The path to the directory the SDKGenerator generated its artifacts to.
  2. repository-url: The url of the maven repository we want to deploy the artifacts to.
  3. username: (optional) The username used to deploy the artifacts.
  4. password: (required only if a username is provided) The password used to deploy the artifacts.

Using the Maven deployer

The MavenDeployer needs 4 ordered parameters separated by spaces:

  1. directory: The path to the directory to deploy.
  2. repositoryId: Server Id to map on the <id> under <server> section of settings.xml.
  3. url: URL where the artifacts will be deployed. 
  4. mvn: The path to the mvn.bat / mvn.sh.

Some specialities with certain FDKs

Flex SDK 2.0:

Version is strange "3.0 Moxie M2.180927". Has to be changed to 2.0.1.180927 in flex-sdk-description.xml 

Flex 3.0.0.477A, Flex 3.0.1.1732A, Flex 3.2.0.3958A

I did have some trouble finding out the AIR version as well as the binary artifacts. The sizes and checksums of the airglobal.swc didnt match any of the official AIR artifacts and the adl command didn't output a version. Currently without tweaking these FDKs are generated without working AIR support.

If however you need one of these FDKs you can simply make the generator use the air version you want, by copying the airglobal.swc of the version you want to use into thedirectory "fdkroot/frameworks/libs/air" assuming you have deployed any FDK or Air SDK containing that version of airglobal, the generator will correctly add dependencies to that AIR version.

Flex 4.8.0.1359417

  • Needs a "player" directory in "framework" in order to execute compc (Copy from Flex 4.6.0).
  • Needs all the dependencies in place "textlayout", "osmf" and the stuff that needs to be copied into the "[fdkroot]/lib/external" and "[fdkroot]/lib/external/optional" directories. For more instructions on this, please read the README.txt in the root of Your FDK.
  • Needs to detect the AIR version the FDK is compatible with, this is currently determined by checking the version of the airglobal.swc in the framework/libs/air/airglobal.swc. Simply copy this from the 4.6 FDK

Download Links to binary versions of Flex and Air  

AIR SDKs (From Adobe):  http://helpx.adobe.com/air/kb/archived-air-sdk-version.html

Flex SDKs (From Adobe): (Unfortunately the page seems messed-up, but you can get the URLs from there)http://sourceforge.net/adobe/flexsdk/wiki/downloads/

Labels
  • No labels
  1. Anonymous

    While using mavenizer for apache flex 4.9.1, I always get the below error. Any help appreciated.

    ---------------------------------------------
    – Generating Flex SDK version: 4.9.1.1447119
    ---------------------------------------------
    Exception in thread "main" java.lang.NullPointerException
    at java.util.Arrays$ArrayList.<init>(Unknown Source)
    at java.util.Arrays.asList(Unknown Source)
    at flex.FlexCompilerGenerator.process(FlexCompilerGenerator.java:43)
    at SDKGenerator.generateFlex(SDKGenerator.java:121)
    at SDKGenerator.generateAllFlex(SDKGenerator.java:111)
    at SDKGenerator.main(SDKGenerator.java:153)