Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Danger for Android

Danger for Android

Introduction to Danger for Android

Daichi Furiya (Wasabeef)

October 25, 2017
Tweet

More Decks by Daichi Furiya (Wasabeef)

Other Decks in Programming

Transcript

  1. Dangerfile for PR # WIP warn("Work in Progress") if github.pr_title.include?

    “WIP" # BIG PR warn("Big PR > 1000") if git.lines_of_code > 1000 # NO ASSIGN has_assignee = github.pr_json[assignee] != nil warn("No Assign", sticky: false) unless has_assignee
  2. Dangerfile for Android Lint # Android Lint android_lint.gradle_task = "app:lint"

    android_lint.report_file = “path/lint-results.xml” android_lint.filtering = true android_lint.lint(inline_mode: true)
  3. Gradle for configurations { ktlint } dependencies { ktlint 'com.github.shyiko:ktlint:0.10.0'

    } task ktlint(type: Exec) { commandLine 'java', '-cp', configurations.ktlint.join(System.getProperty('path.separator')), 'com.github.shyiko.ktlint.Main', '--reporter=checkstyle', 'src/**/*.kt' def outputDirectory = "$buildDir/reports" def outputFile = "${outputDirectory}/ktlint-report.xml" ignoreExitValue = true doFirst { new File(outputDirectory).mkdirs() standardOutput = new FileOutputStream(outputFile) } } https://ktlint.github.io/
  4. Execution // Single bundle exec danger // Multiple bundle exec

    danger --dangerfile="app/Dangerfile" --danger_id=1 bundle exec danger --dangerfile="tv/Dangerfile" --danger_id=2