This is part of my automated build series. The aim is to automate a lot of the Cordova Background Service plugin process.
In this post, I'll be describing the build process for an individual version of the library.
During this post I will be demonstrating creating a Jenkins job to compile the library source into an Android library and save out the library for later use.
I'm using the following tools for this post:
I have a SVN repository for my library project. I use this repository during development. I only post to my GitHub repository once development has been completed and tested.
Within the SVN repository, the source is stored in an Android Library project and can be compiled using Eclipse.
The Jenkins job will be parameterized to allow it to be called repeatedly for different versions.
As such the following variables will defined in the job:
To create the job;
Add a Windows batch command to copy the relevant source code into my SOURCEPATH for later upload. I also collapse the src & aidl folders into one. The Ant build doesn't seem to cope with having the aidl files in a separate source folder. I'm sure that there is a better method of doing this (in the Ant build), but this works.
Add a Windows Powershell script to update the project to use the correct Cordova Version (note, I store all of the Cordova-x.x.x.jar files within the Android Project and thus the SVN repository The powershell script runs through the .classpath file of the Android project and links in the appropriate Cordova jar version.
Add an Execute Windows batch command to copy in the correct version of the BackgroundServicePlugin.java
Add an Execute Windows batch command to prepare the project
Add an "Invoke Ant" to build the library
Finally, add an Execute Windows batch command to copy the resulting library to the BUILDOUTPUTPATH for later use
This Job now allows me to automate the build of an individual version of the Background Service Plugin library.
On it's own this job is rather boring. It's power comes in later when combined with a controlling job which calls this job for each version that I want to build - but that comes later in part 5.