You must have only one execution environment and this one must be set properly.
– To download the iOS Provisioning Profiles (Development) created.
If our platform target is only Android, then set your execution environment on computer where you are more comfortable. If you choose Windows computer, you’ll need to install Cygwin (select curl and zip packages in the install wizard).
So an summary for the very impatient. Configure your environment variables correctly and in terminal:
[text] # 1. Increment minor iOS version (0.1.0 to 0.2.0)
# 2. Increment build iOS version (37 to 38)
# 3. Generate release ipa
# 4. Upload to testflight
server:~ user$ ./gradlew ios:incrementMinorVersion ios:createIPA iOS:testflightUpload
[text] # 1. Decrement m
# 1. Increment minor android version (0.1.0 to 0.2.0)
# 2. Increment build android version (37 to 38)
# 3. Generate release apk
# 4. Upload to testfairy
server:~ user$ ./gradlew android:incrementMinorVersion android:assembleRelease android:testfairyUpload
Now we are going to see what’s behind the scene.
Automatic version control system
Based on Gradle in Action
We create a version.properties file for each project folder where we want to have version control system. In each build.gradle:
– We define Version class
– We create a configuration task using Version class to read the current state of version.properties. This one is executed always at the beginning because is a configuration task.
– We create 3 action tasks to increase versions: major, minor and patch. A four “private” task autoincrease build version in each packaging.
Version class computes a version string combining `major.minor.path` but each project use this differently:
– In AndroidManifest.xml android file modifies versionName. We also modifies in this one versionCode with current date plus current build.
– In robovm.properties iOS modifies app.version.
Automatic uploading of your distributions
I don’t complicate this final task; I use the upload API offered by these solutions:
On each build.gradle project I use an Exec task to execute a cURL for sending files using this API’s with different parameters defined into gradle.properties file.