Project Setup

Continuous Integration & Testing

Tests should run on Drone as part of the build process.

Steps to run on Drone:

build:
    image: registry.vokal.io/android
    volumes:
        - /home/ubuntu/android_build/android-sdk:/usr/local/android-sdk
        - /home/ubuntu/.android:/root/.android
    commands:
        - ./gradlew build deviceCheck
        - curl -sSL https://secure.vokal.io/new | sh
publish:
    script:
        image: vokal/drone-android-publish
        apiToken: $$hockeyApiToken
        path: app/build/outputs/apk/app-stage-debug.apk

(deviceCheck will test all variants on RATS, so you may want to specify something like ratsUploadmockDebug)

buildscript {
    ...
    dependencies {
        classpath 'com.android.tools.build:gradle:${latestBuildtoolsVersion}'
        classpath 'com.wmbest.gradle:rats:0.2.5'
    }
}

...

apply plugin: 'com.android.application'
apply plugin: 'com.wmbest.rats'

...

rats {
    server "https://vokalrats.ngrok.com"
    user ratsUser
    password ratsPass
    count 5
}

ratsUser=[insert user provided]
ratsPassword=[insert password provided]
buildTypes {
    debug {
        versionNameSuffix 'git log -1 --pretty=format:(%h)'.execute().text
    }
}

Artifactory Setup

artifactory_user=[insert user provided]
artifactory_passord=[insert password provided]
...
    jcenter()
    maven {
        url 'http://artifactory.vokal.io/artifactory/<repository>'
        credentials {
            username = "${artifactory_user}"
            password = "${artifactory_password}"
        }
    }