Introduction‎ > ‎

Task reference


This reference provides description for all tasks accessible in Apphance Flow. To use Apphance Flow build system only single plugin needs to be applied: 'apphance-flow', but under the hood, for better clarity and organisation several plugins are implemented. Every task is assigned to a particular plugin and for better understanding, the documentation below follows this scheme.



You can find example projects for Android at our github page.
You can find example projects for iOS at our github page.

Common Tasks


Project Plugin


Name: Project Plugin

This is the base plugin which is applied to every project.

This plugin provides setup-related tasks. The tasks allow to generate new configuration or verify existing configuration.

Tasks

  • cleanFlow
    Cleans flow temporary folders.

  • copySources
    Copies all sources to temporary directories, where the variants will be built.

  • prepareSetup
    Runs wizard which gathers all information necessary for builds configuration. As a result (flow.properties) is created - this file is necesarry for Apphance Flow to run. Can be used in non-interactive mode '-Dnoninteractive' or '-Dni'.

Release Plugin


Name: Release Plugin

The plugin provides a set of release-related tasks. It enables creating image montage, zipped sources and sending release notification via email.

Tasks

  • buildSourcesZip
    Prepares file with zipped project directory.

  • prepareImageMontage
    Builds montage of all images found in the project

  • sendMailMessage
    Sends mail message.
    Requires mail.server, mail.port system (-D) properties or corresponding MAIL_SERVER, MAIL_PORT env variables (no authentication). It also uses certain properties to send mails: 'release.mail.from', release.mail.to' and 'release.mail.flags'. See configuration reference for more details.

Android Tasks


Android Plugin


Name: Android Plugin

Main android build plugin.
The plugin provides all the tasks needed to build android application. Among plugin tasks there are three static anchor tasks: 'buildAll', 'buildAllDebug' and 'buildAllRelease'. They actually don't do anything besides calling other build tasks. Build tasks are created dynamically based on available variants.

Tasks

  • buildAll
    Builds all variants

  • buildAllDebug
    Builds all debug variants

  • buildAllRelease
    Build all release variants

  • buildVariantName
    Builds buildVariantName

  • updateProject
    Updates project using android command line tool

Android Analysis Plugin


Name: Android Analysis Plugin

This plugin provides tasks for android project code analysis. When applied following analysis can be performed on project: PMD, Checkstyle, Findbugs, Lint and CPD.
Every analysis task has predefined default configuration but custom configurations can be provided for pmd, checkstyle and findbugs. Every analysis task generates reports in 'build/report' directory.

Tasks

  • check
    Runs all checks.

  • checkstyleMain
    Run Checkstyle analysis for main classes

  • checkstyleTest
    Run Checkstyle analysis for test classes

  • cpd
    Runs CPD (duplicated code) analysis on project

  • findbugsMain
    Run FindBugs analysis for main classes

  • findbugsTest
    Run FindBugs analysis for test classes

  • javadoc
    Generates Javadoc API documentation for the main source code.

  • lint
    Runs lint analysis on main variant of project

  • pmdMain
    Run PMD analysis for main classes

  • pmdTest
    Run PMD analysis for test classes

Android Apphance Plugin


Name: Android Apphance Plugin

Plugin for enabling Apphance (apphance.com) library in android project.
The plugin provides integration with Apphance service. It performs the following tasks: adding Apphance on-the-fly while building the application for configured variants, submitting the application to apphance at release time.
Adding Apphance is implemented according to library installation documentation: help.apphance.com

Tasks

  • addApphanceVariantName
    adding Apphance on-the-fly to VariantName variant

  • uploadVariantName
    Uploads apk to Apphance server. Then apk can be found at https://panel.apphance.com/

Android Release Plugin


Name: Android Release Plugin

Plugin that provides release functionality for android.

It provides basic release tasks that update version code and version name of the application while preparing the release and produces ready-to-use OTA (Over-The-Air) package (in flow-ota directory) that you can copy to appropriate directory on your web server and have ready-to-use, easily installable OTA version of your application

Tasks

  • prepareAvailableArtifactsInfo
    Generates release artifacts, this includes: mail message, QR code with installation link and installation HTML sites.

  • updateVersion
    Updates version stored in configuration file of the project - AndroidManifest.xml. Numeric version is set from 'version.code' system property (-D) or 'VERSION_CODE' environment variable property. String version is set from 'version.string' system property (-D) or 'VERSION_CODE' environment variable

Android Test Plugin


Name: Android Test Plugin

Plugin that provides test functionality for android project.

Currently Apphance Flow supports testing android app with Robolectric framework. Plugin adds one anchor task 'testAll' and 'testVariantName' tasks for each configured variant.

Tasks

  • testAll
    Run all android tests in all variants

  • testVariantName
    Runs Robolectric test on the project

iOS Tasks


IOS Plugin


Name: IOS Plugin

This is the main iOS plugin.

It provides all tasks necessary for building artifacts for the defined variants. Every variant has a related task, that is dynamically created during initialization of Apphance Flow. For 'DEVICE' and 'SIMULATOR' variants build task name is prefixed with 'archive' prefix, for 'FRAMEWORK' mode prefix for task name is 'framework'.

The following artifacts are be prepared with usage of iOS Plugin:
  • for 'DEVICE' mode variant:
    • zipped xcarchive
    • zipped dSYM files
    • zipped ahSYM files - special SYM format for apphance integration
    • ipa file
    • manifest file
    • mobileprovision file

  • for 'SIMULATOR' mode variant
    • dmg disk image with iPhone simulator dedicated application
    • dmg disk image with iPad simulator dedicated application

  • for 'FRAMEWORK' mode variant
    • ready-to-se framework file

Tasks

  • archiveAll
    Aggregate task, builds all 'DEVICE' and 'SIMULATOR' variants.

  • archiveAllDevice
    Aggregate task, builds all 'DEVICE' mode variants.

  • archiveAllSimulator
    Aggregate task, builds all 'SIMULATOR' mode variants.

  • archiveVariantName
    Invokes 'archive' action for the variant. From the result of the action xcarchive, distribution zip, dSYM, ahSYM, ipa, manifest and mobileprovision artifacts are prepared. All the artifacts are located under flow-ota.

  • copyMobileProvision
    Copies all *.mobileprovision files to user's provisioning profiles folder. While copying it checks if bundle identifier in mobileprovision file and in plist are same. If not an exception is thrown.

  • unlockKeyChain
    Unlocks key chain used while building projects. Requires osx.keychain.password and osx.keychain.location system (-D) properties or OSX_KEYCHAIN_PASSWORD and OSX_KEYCHAIN_LOCATION environment variables.

IOS Release Plugin


Name: IOS Release Plugin

This plugin provides simple release functionality.

It provides basic release tasks, allowing to upgrade version of the application (in *.plist files) while preparing the release. Most importantly however, it produces ready-to-use OTA (Over-The-Air) package (under 'flow-ota' directory). This folder contains all built artifacts (as well with HTML sites that present them) that can copied to appropriate directory on a web server and become ready-to-use, easily installable OTA version of the application.

Tasks

  • prepareAvailableArtifactsInfo
    Generates release artifacts, this includes: mail message, QR code with installation link and installation HTML sites.

  • updateVersion
    Updates version stored in configuration file of the project - plist. Numeric version is set from 'version.code' system property (-D) or 'VERSION_CODE' environment variable property. String version is set from 'version.string' system property (-D) or 'VERSION_CODE' environment variable.

IOS Apphance Plugin


Name: IOS Apphance Plugin

This plugin provides automatic source code integration of apphance framework and defines a task for uploading built artifacts (ipa, ahSYM and image montage) to 'apphance.com'. To upload artifacts apphance user and pass must be passed via flow.properties file, system (-D) properties or environment variables.

For more info visit: apphance.com.

No special task is defined for apphance integration. If apphance mode for particular variant is one of 'QA', 'SILENT' or 'PROD' source code will be modified before building the variant.

Automatic source integration does the following:
  • adds necessary frameworks to 'project.pbxproj' file
  • modifies the PCH file to include apphance framework headers
  • replaces all NSLog invocations with 'APHLog'
  • adds apphance session initialization when application starts

Tasks

  • uploadVariantName
    Uploads IPA, ahSYM and image montage files to 'apphance.com'.

IOS Test Plugin


Name: IOS Test Plugin

This plugin enables running ocunit compatible tests for chosen variants.

To enable this plugin following requirements must be fulfilled:
  • ios-sim must be installed
  • test targets must be enabled
For xcode version lower than 5.0 running tests is done by adding special shell script to build phase in project.pbxproj configuration file and then invoking 'build' action for particular target and configuration.

For xcode version higher or equal to 5.0 simply 'test' action is invoked for the specified variant.

Tasks

  • testAll
    Aggregate task, runs tests for all variants configured in 'ios.test.variants'.

  • testVariantName
    Builds variant and runs test against it.

Comments