You can create Ant build scripts for Worklight® projects that contain applications
and adapters. By using these build scripts, you can automate your
mobile application builds.
Build script tasks
You can create build
scripts that use the following types of Ant tasks:
Type of Ant task |
Description |
Built in tasks from Apache Ant |
Includes tasks such as:- <echo>
- <report>
- <mkdir>
- <exec>
- <replaceregexp>
|
Tasks from IBM® Worklight |
These tasks perform the following actions:- Build hybrid applications and adapters, such as <app-builder> and <adapter-builder>. IBM Worklight provides a set of Ant tasks that
help you to build adapters and hybrid applications for your IBM Worklight Server.
- Build IBM Worklight web archive projects. IBM Worklight provides the <war-builder> Ant
task for building the Worklight project
WAR file.
|
Tasks from the Rational Team Concert™ Build
System Toolkit |
These tasks provide information to the build
results. Tasks include:- <startBuildActivity>
- <linkPublisher>
- <artifactPublisher>
|
Sample build script task flow
You can create
build scripts for Worklight projects
that contain different numbers of applications or adapters. The following
sample task flow describes the overall design of a build script for
a Worklight project that
has a single hybrid application and a single adapter.
- Use Ant <property> elements to set the properties.
- Use a hybrid target to build hybrid applications, adapters, and Worklight web archive projects.
The hybrid target contains the following actions:
- URLs that point to the Worklight Server
Console and the Application Center are published to either the Ant
build log or the Rational
Team Concert build results.
- The Worklight <app-builder> Ant
task builds the hybrid application.
- The resulting .wlapp file is stored in the
build output.
- The Worklight <adapter-builder> Ant
task builds the adapter.
- The resulting .adapter file is stored in
the build output.
- The Worklight <war-builder> Ant
task builds the Worklight web
archive project.
- The resulting WAR file is stored in the build output.
- Optional. If you use Rational Team Concert, you
can publish the .wlapp, .adapter,
and WAR files to the Rational
Team Concert build results.
- When you build an Android application, include the following actions
to build the native Android APK file:
- Run the android command-line tool from the
Android SDK to generate the Android build.xml file.
- Run the generated Android build.xml file
to build the APK file.
- Optional. Publish the Android APK file to the location where you
store your build output. For example, if you use Rational Team Concert, publish
the APK file to the Rational
Team Concert build results.
- When you build an iOS application, include the following actions
to build the native iOS IPA file:
- Run the xcodebuild command-line tool from the
Xcode SDK to build the iOS application.
- Run the xcrun command-line tools from the Xcode
SDK to package the iOS application into an IPA file.
- Optional. Publish the iOS IPA file to the location where you store
your build output. For example, if you use Rational Team Concert, publish
the IPA file to the Rational
Team Concert build results.
- Add your hybrid application, adapter, Worklight web archive project (WAR file),
and native application (Android APK file or iOS IPA file) to UrbanCode
Deploy as a new version.
Tip: You can have multiple hybrid
applications and adapters. If you have more than one hybrid application
or adapter, repeat calls to tasks to build the mobile artifacts, add
new property values, and then add the new artifacts to UrbanCode Deploy.