Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Automatic Kotlin Lint with Pipeline and Danger
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Toru Furuya
December 12, 2017
110
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Automatic Kotlin Lint with Pipeline and Danger
Toru Furuya
December 12, 2017
More Decks by Toru Furuya
See All by Toru Furuya
How To Built Uranow Android App
torufuruya
0
73
Realm Academyのすすめ
torufuruya
0
50
iPhone XでのSafe AreaとWebコンテンツの表示制限について
torufuruya
0
110
Git subtree の導入
torufuruya
0
120
CI as Code の導入
torufuruya
0
54
Objective-Cのpropertyのこと
torufuruya
0
60
Getting Started Yeoman
torufuruya
0
50
Featured
See All Featured
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
570
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
Design in an AI World
tapps
1
350
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.5k
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
460
Prompt Engineering for Job Search
mfonobong
0
520
Faster Mobile Websites
deanohume
310
32k
Building Adaptive Systems
keathley
44
3.2k
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
600
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
1
580
Skip the Path - Find Your Career Trail
mkilby
1
260
Transcript
Automatic Kotlin Lint with Pipeline and Danger 2017.12.12 Toru Furuya
Motivation • メンバー全員Kotlin初心者でスタンダードを知らない • KotlinはJavaに比べていろいろな書き方ができる • プロダクト立ち上げ段階でPull Requestのdiffが多い • コードの書き方までレビューしてる時間がない
• アプリができあがってから見直しても後の祭り コードの静的解析くらいロボットにお願いしよう
Technologies • ktlint https://ktlint.github.io/ • Danger http://danger.systems/ruby/ • Jenkins Pipeline
https://jenkins.io/doc/book/pipeline/
Overall Flow ① ② ③ ④
Where I stumbled • “Unsupported major.minor version 52.0” • JenkinsのGUIで設定した環境変数がPipelineに反映されない
Unsupported major.minor version 52.0 FAILURE: Build failed with an exception.
* Where: Build file '/Users/jenkins/slave/workspace/lin_lint_with_danger_sample-37UQRG6OZVNIAO KNEBT2PGCXB45NC2DGDDSAFAOEJQ2T34JOTKUA/app/build.gradle' line: 1 * What went wrong: A problem occurred evaluating project ':app'. > java.lang.UnsupportedClassVersionError: com/android/build/gradle/AppPlugin : Unsupported major.minor version 52.0
• コンパイラのJDKのバージョンと実行環境のJVMのバージョンが異なる • Pipelineのstepにログを仕込んだら JAVA_HOME = 1.8.0 なのに javac =
1.7.0 だっ た • バージョンを合わせることで解決 Unsupported major.minor version 52.0
• JenkinsのGUIでJDKのPATHを設定 • Pipelineのtoolsディレクティブで利用するJDKを宣言 Jenkinsfile Unsupported major.minor version 52.0 pipeline
{ agent any tools { jdk 'jdk8' }
JenkinsのGUIで設定した環境変数が反映されない • 画像のように環境変数を設定してもビルドが失敗する
JenkinsのGUIで設定した環境変数が反映されない • GUIで設定してもJenkins Pipelineには影響しない • Pipelineのenvironmentディレクティブを利用することで解決 Jenkinsfile pipeline { agent
any environment { DANGER_GITHUB_HOST = 'xxxx.net' DANGER_GITHUB_API_BASE_URL = 'https://xxxx.net/api/v3' DANGER_GITHUB_API_TOKEN = credentials('DANGER_GITHUB_API_TOKEN') }
Deliverables
Fin