Hi there,
I’m trying to automate my Android project distribution and I’m using Crashalytics Beta for that. From their support page it is a pretty easy task:
f you want to distribute your app via Gradle, make sure you’re on version 1.11.4 or higher of the Gradle tool and run the following command:
gradle assembleRelease crashlyticsUploadDistributionRelease
Groups:
ext.betaDistributionGroupAliases="my-best-testers"
So basically we need 2 similar tasks (e.g. buildAndDistributeToTeam
and buildAndDistributeToCustomer
) where we’ll set different group for crashlytics (groups are created on their server). In each task we need to perform:
clean
assembleRelease
- set group either to Developer-Distribution or Customer-Distribution
- run
crashlyticsUploadDistributionRelease
I want to do it using different tasks because then I can select task on http://ship.io CI. I have 2 jobs there and each job will build different task.
I hope my setup is clear. So what we do:
- we have 2 custom build types:
buildTypes {
customerRelease {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.main
ext.betaDistributionGroupAliases = "Customer-Distribution"
}
developerRelease {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.main
ext.betaDistributionGroupAliases = "Developer-Distribution"
}
}
and then we have:
task buildAndDistributeToCustomer(dependsOn: clean, assembleRelease, crashlyticsUploadDistributionRelease) << {
println "Built and Sent to customer"
}
task buildAndDistributeToTeam(dependsOn: clean, assembleRelease, crashlyticsUploadDistributionRelease) << {
println "Built and Sent to team"
}
tasks.whenTaskAdded { task ->
if (task.name == 'buildAndDistributeToCustomer') {
task.dependsOn customerRelease
}
if (task.name == 'buildAndDistributeToTeam') {
task.dependsOn developerRelease
}
}
If I’m trying to build one of my custom tasks I have:
FAILURE: Build failed with an exception.
* Where:
Build file '/b/d20150703-570-a606v4/my-project-android/app/build.gradle' line: 80
* What went wrong:
A problem occurred evaluating project ':app'.
> Could not find property 'crashlyticsUploadDistributionRelease' on project ':app'.
Line 80 is the line where I define task buildAndDistributeToCustomer
Do you have any ideas how to make it work?