Danger for Android

Danger for Android

Introduction to Danger for Android

6dd0483f1353a4a359e92633cfd65c64?s=128

Daichi Furiya (Wasabeef)

October 25, 2017
Tweet

Transcript

  1. 3.
  2. 5.
  3. 9.
  4. 10.
  5. 13.
  6. 16.

    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
  7. 17.

    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)
  8. 19.

    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/
  9. 20.
  10. 21.

    Execution // Single bundle exec danger // Multiple bundle exec

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