Friday, December 21, 2012

G+ comunity

Hi,

We started new community on Google + "Mobile Gaming with Adobe AIR and Starling". If you are interested in game development with Starling your are welcome.

Thanks.

Monday, December 3, 2012

Christmas Toys game



Hi all.
We just published new game powered by Flash and Starling framework. It's very cool game specially created for children who likes to get toys, candies and other holiday stuff from Santa Claus on Christmas. Play it and feel the spirit of Christmas.

Tuesday, July 31, 2012

Combining FlexMojos, Maven and RIATest



First of all, why RIATest?

FlexMonkium (MonkeyTalk) – free open source testing application with only one but – you need to pay for support (price for premium status:  http://www.gorillalogic.com/testing-tools/support-services);
AutoIT – another free application (easy to install/easy to use) also with only one but – poor functionality;
RIATest – not so expensive application (for about 499$ (http://www.riatest.com/shop.html) you can get RIATest Standard edition + don’t forget about support),  it comes with IDE (integrated development environment), returns exit codes indicating success, failure or other problems and it support Flex 4.6.

Six Simple Steps to combine FlexMojos, Maven and RIATest Agent (get it all in one pom.xml file)

Building Flex with Maven + FlexMojos-maven-plugin

<plugins>

  <plugin>
    <groupId>org.sonatype.flexmojos</groupId>
    <artifactId>flexmojos-maven-plugin</artifactId>
    <version>3.9</version>
    <extensions>true</extensions>
    <configuration>
      <debug>false</debug>
      <targetPlayer>10.2.0</targetPlayer>
      <showWarnings>true</showWarnings>
      <linkReport>true</linkReport>
      <allowSourcePathOverlap>true</allowSourcePathOverlap>
      <sourceFile>SOME.mxml</sourceFile>
      <configFiles>
            <configFile>config-swf-version-11.xml</configFile>
      </configFiles>
      <enableMavenResourcesResolver>true</enableMavenResourcesResolver>
      <testTimeout>25000</testTimeout>
    </configuration>
    <dependencies>
      <dependency>
            <groupId>com.adobe.flex</groupId>
            <artifactId>compiler</artifactId>
            <version>${flex-framework.version}</version>
            <type>pom</type>
      </dependency>
    </dependencies>
  </plugin>
</plugins&gt;
    
 “config-swf-version-11.xml” - don’t forget to create this xml file which indicates swf version:
 <?xml version="1.0"?>
<flex-config>
  <swf-version>11</swf-version>
</flex-config>

Pom.xml Properties:

<properties>
  <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  <flex-framework.version>4.5.0.20967</flex-framework.version>
</properties>

Next step is to include all needed libraries: 

<dependencies>
  <dependency>
    <groupId>com.riatest</groupId>
    <artifactId>riatestagent</artifactId>
    <version>4.6_B4404</version>
    <type>swc</type>
    <scope>internal</scope>
  </dependency>
  <dependency>
    <groupId>com.adobe.flex.framework</groupId>
    <artifactId>automation</artifactId>
    <version>${flex-version}</version>
    <type>swc</type>
    <scope>internal</scope>
  </dependency>
  <dependency>
    <groupId>com.adobe.flex.framework</groupId>
    <artifactId>automation</artifactId>
    <version>${flex-version}</version>
    <classifier>en_US</classifier>
    <type>rb.swc</type>
  </dependency>
  <dependency>
    <groupId>com.adobe.flex.framework</groupId>
    <artifactId>automation_agent</artifactId>
    <version>${flex-version}</version>
    <type>swc</type>
    <scope>internal</scope>
  </dependency>
  <dependency>
    <groupId>com.adobe.flex.framework</groupId>
    <artifactId>automation_agent</artifactId>
    <version>${flex-version}</version>
    <classifier>en_US</classifier>
    <type>rb.swc</type>
  </dependency>
  <dependency>
    <groupId>com.adobe.flex.framework</groupId>
    <artifactId>automation_dmv</artifactId>
    <version>${flex-version}</version>
    <type>swc</type>
    <scope>internal</scope>
  </dependency>
  <dependency>
    <groupId>com.adobe.flex.framework</groupId>
    <artifactId>automation_spark</artifactId>
    <version>${flex-version}</version>
    <type>swc</type>
    <scope>internal</scope>
  </dependency>
</dependencies>
      
Let us look deeper into <dependency>.  First, you need to remember that FlexMojos supports 6 scopes:
  • merged: this is the default value, when not defined will assume merged. That means SWC/SWF file will be bigger and self-sufficient. Same as -compiler.library-path
  • internal: all dependency content will be included on target SWC/SWF. Biggest compiled file. Same as -compiler.include-libraries
  • external: no dependency content will be included on target SWC/SWF. Smaller compiled file. Makes no sense to use this scope on SWF compilation. Same as -compiler.external-library-path
  • rsl: no dependency content will be inclued on SWC/SWF. But, SWF will have a reference to load it a runtime. Do not use on SWC compilation. Same as -runtime-shared-library-path
  • caching: same as RSL, but uses Adobe signed SWZ files.
  • test: libraries required to run tests. Same as -compiler.include-libraries, but at test template only!

As you may notice, I also include a dependency for RIATest agent:

<dependency>
  <groupId>com.riatest</groupId>
  <artifactId>riatestagent</artifactId>
  <version>4.6_B4404</version>
  <type>swc</type>
  <scope>internal</scope>
</dependency>

If you want, your Maven to understand this dependency you must manually install RIATest-agent to maven repository using next command from command line:

mvn install:install-file -DgeneratePom=true -Dpackaging=swc -DgroupId=com.riatest -Dversion=4.6_B4404 -DartifactId=riatestagent -Dfile=RIATestAgent46_B4404.swc

Now let us create our repositories for FlexMojos:

<pluginRepositories>
  <pluginRepository>
    <id>flex-mojos-repository</id>
    <url>http://repository.sonatype.org/content/groups/flexgroup</url>
    <releases>
      <enabled>true</enabled>
    </releases>
    <snapshots>
      <enabled>false</enabled>
    </snapshots>
  </pluginRepository>
</pluginRepositories>

<repositories>
  <repository>
    <id>flex-mojos-repository</id>
    <url>http://repository.sonatype.org/content/groups/flexgroup</url>
    <releases>
      <enabled>true</enabled>
    </releases>
    <snapshots>
      <enabled>false</enabled>
    </snapshots>
  </repository>
</repositories>

You can use link bellow to understand how it all works together and it will show you how to create libraries for internal access to all needed data of your Flex application: 


Next and final step is to build your swc file:

<build>
  <sourceDirectory>src/main/flex</sourceDirectory>
  <plugins>
    <plugin>
      <groupId>org.sonatype.flexmojos</groupId>
      <artifactId>flexmojos-maven-plugin</artifactId>
      <version>3.9</version>
      <extensions>true</extensions>
      <configuration>
            <warnings>
              <noConstructor>false</noConstructor>
            </warnings>
            <mergeResourceBundle>false</mergeResourceBundle>
            <targetPlayer>10.2.0</targetPlayer>
            <showWarnings>true</showWarnings>
            <linkReport>true</linkReport>
            <allowSourcePathOverlap>true</allowSourcePathOverlap>
            <enableMavenResourcesResolver>true</enableMavenResourcesResolver>
            <configFiles>
              <configFile>config-swf-version-11.xml</configFile>
            </configFiles>
      </configuration>
      <dependencies>
            <dependency>
              <groupId>com.adobe.flex</groupId>
              <artifactId>compiler</artifactId>
              <version>${flex-framework.version}</version>
              <type>pom</type>
            </dependency>
      </dependencies>
    </plugin>
  </plugins>
</build>

With dependencies:
<!-- DEPENDENCIES -->
<dependencies>
  <dependency>
    <groupId>com.adobe.flex.framework</groupId>
    <artifactId>flex-framework</artifactId>
    <version>${flex-framework.version}</version>
    <type>pom</type>
  </dependency>
  <dependency>
    <groupId>com.adobe.flex.framework</groupId>
    <artifactId>automation</artifactId>
    <version>${flex-framework.version}</version>
    <type>swc</type>
    <scope>internal</scope>
  </dependency>
  <dependency>
    <groupId>com.adobe.flex.framework</groupId>
    <artifactId>automation</artifactId>
    <version>${flex-framework.version}</version>
    <classifier>en_US</classifier>
    <type>rb.swc</type>
  </dependency>
  <dependency>
    <groupId>com.adobe.flex.framework</groupId>
    <artifactId>automation_agent</artifactId>
    <version>${flex-framework.version}</version>
    <type>swc</type>
    <scope>internal</scope>
  </dependency>
  <dependency>
    <groupId>com.adobe.flex.framework</groupId>
    <artifactId>automation_agent</artifactId>
    <version>${flex-framework.version}</version>
    <classifier>en_US</classifier>
    <type>rb.swc</type>
  </dependency>
  <dependency>
    <groupId>com.adobe.flex.framework</groupId>
    <artifactId>automation_dmv</artifactId>
    <version>${flex-framework.version}</version>
    <type>swc</type>
    <scope>internal</scope>
  </dependency>
  <dependency>
    <groupId>com.adobe.flex.framework</groupId>
    <artifactId>automation_spark</artifactId>
    <version>${flex-framework.version}</version>
    <type>swc</type>
    <scope>internal</scope>
  </dependency>
</dependencies>

Don’t forget to attach results to main project: 
<dependency>
  <groupId>com.myproject</groupId>
  <artifactId>myproject-flex-platform-automation</artifactId>
  <version>${flex-platform-version}</version>
  <type>swc</type>
  <scope>internal</scope>
</dependency>

That’s all for now, in my next tutorial I’ll show you how to test your Flex application using RIA Test agent.  

Authors: Yaroslav Klochnyk, Vasyl Boyko