Skip to content

Instantly share code, notes, and snippets.

@scottyab
Created September 17, 2018 10:51
Show Gist options
  • Save scottyab/7c4f0f687142721ffbf3f45cb6d4cdb5 to your computer and use it in GitHub Desktop.
Save scottyab/7c4f0f687142721ffbf3f45cb6d4cdb5 to your computer and use it in GitHub Desktop.
Example travis and Danger file to try and debug the apkanalyzer
language: android
jdk: oraclejdk8
sudo: required
before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/
cache:
directories:
- "$HOME/.gradle/caches/"
- "$HOME/.gradle/wrapper/"
- "$HOME/.rvm/"
android:
components:
- platform-tools
- tools
- build-tools-26.0.2
- android-26
- extra-google-google_play_services
- extra-google-m2repository
- extra-android-m2repository
- addon-google_apis-google-25
before_install:
- chmod +x team-props/release/release.sh
- rvm install 2.4.0
- yes | sdkmanager "platforms;android-27"
- yes | sdkmanager tools
before_script:
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64
> ./cc-test-reporter
- chmod +x ./cc-test-reporter
- "./cc-test-reporter before-build"
script:
- "./gradlew clean build"
- team-props/release/release.sh
- team-props/danger/upload_apk_size.sh
after_script:
- "../../../cc-test-reporter format-coverage -d -t jacoco ../../../build/reports/jacoco/jacocoTestProductionDebugUnitTestReport.xml"
- "../../../cc-test-reporter upload-coverage"
- bundle install --path $HOME/vendor/bundle/
- bundle exec danger
notifications:
slack: removed to post on githhub
on_success: change
on_failure: always
on_pull_requests: false
# Make it more obvious that a PR is a work in progress and shouldn't be merged yet
warn('PR is classed as Work in Progress') if github.pr_title.include? '[WIP]'
# Warn when there is a big PR
warn('Big PR') if git.lines_of_code > 500
# Apk Analyzer
apkanalyzer.apk_file = "app/build/outputs/apk/production/release/app-*-production-release.apk"
apkanalyzer.file_size
apkanalyzer.permissions
apkanalyzer.method_references
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment