Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
[android] #5859 - added AWS gradle plugin + bitrise configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
tobrun committed Aug 16, 2016
1 parent e7149bb commit 9a14237
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 5 deletions.
31 changes: 31 additions & 0 deletions platform/android/MapboxGLAndroidSDKTestApp/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
apply plugin: 'android-sdk-manager'
apply plugin: 'com.android.application'
apply plugin: 'checkstyle'
apply plugin: 'devicefarm'

task accessToken {
def tokenFile = new File("MapboxGLAndroidSDKTestApp/src/main/res/values/developer-config.xml")
Expand Down Expand Up @@ -109,6 +110,36 @@ checkstyle {
showViolations true
}

devicefarm {

projectName "Mapbox GL Android" // required: Must already exists.
devicePool "sanity" // optional: Defaults to "Top Devices"

authentication {
accessKey AWS_ACCESS_KEY_ID_DEVICE_FARM
secretKey AWS_SECRET_ACCESS_KEY_DEVICE_FARM
}

// optional block, radios default to 'on' state, all parameters optional
devicestate {
///extraDataZipFile file("path/to/zip") // or ‘null’ if you have no extra data. Default is null.
//auxiliaryApps files(file("path/to/app"), file("path/to/app2")) // or ‘files()’ if you have no auxiliary apps. Default is an empty list.
wifi "on"
bluetooth "off"
gps "on"
nfc "on"
latitude 47.6204 // default
longitude -122.3491 // default
}

// Instrumentation
// optional filter "my-filter"
// See AWS Developer docs
instrumentation {

}
}

android.applicationVariants.all { variant ->
def name = variant.buildType.name
def checkstyle = project.tasks.create "checkstyle${name.capitalize()}", Checkstyle
Expand Down
36 changes: 36 additions & 0 deletions platform/android/bitrise.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
format_version: 1.0.0
default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git
trigger_map:
- pattern: devicefarmUpload
workflow: devicefarmUpload
- pattern: scheduled
workflow: scheduled
- pattern: "*"
Expand Down Expand Up @@ -79,3 +81,37 @@ workflows:
cd platform/android
./gradlew uploadArchives
devicefarmUpload:
steps:
- script:
title: Build
inputs:
- content: |-
#!/bin/bash
set -eu -o pipefail
curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -
sudo apt-get install -y pkg-config nodejs cmake
echo "AWS_ACCESS_KEY_ID_DEVICE_FARM=$AWS_ACCESS_KEY_ID_DEVICE_FARM
AWS_SECRET_ACCESS_KEY_DEVICE_FARM=$AWS_SECRET_ACCESS_KEY_DEVICE_FARM"
>> platform/android/MapboxGLAndroidSDK/gradle.properties
export BUILDTYPE=Release
make apackage
make android-generate-test
cd platform/android/
./gradlew devicefarmUpload
- slack:
title: Post to Slack
inputs:
- webhook_url: "$SLACK_HOOK_URL"
- channel: "#gl-bots"
- from_username: 'Bitrise Android'
- from_username_on_error: 'Bitrise Android'
- message: '<${BITRISE_BUILD_URL}|Build #${BITRISE_BUILD_NUMBER}>
for devicefarmUpload passed'
- message_on_error: '<${BITRISE_BUILD_URL}|Build #${BITRISE_BUILD_NUMBER}>
for devicefarmUpload failed'
- icon_url: https://bitrise-public-content-production.s3.amazonaws.com/slack/bitrise-slack-icon-128.png
- icon_url_on_error: https://bitrise-public-content-production.s3.amazonaws.com/slack/bitrise-slack-error-icon-128.png
6 changes: 1 addition & 5 deletions platform/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
repositories {
jcenter()
Expand All @@ -8,9 +6,7 @@ buildscript {
dependencies {
classpath 'com.android.tools.build:gradle:2.1.2'
classpath 'com.github.JakeWharton:sdk-manager-plugin:220bf7a88a7072df3ed16dc8466fb144f2817070'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.amazonaws:aws-devicefarm-gradle-plugin:1.2'
}
}

Expand Down

0 comments on commit 9a14237

Please sign in to comment.