Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
札束でGradleのケツを叩く
Search
Ryo Sakaguchi
November 09, 2016
Programming
1
1.4k
札束でGradleのケツを叩く
Android app build speed can be made faster with $$$.
Ryo Sakaguchi
November 09, 2016
Tweet
Share
More Decks by Ryo Sakaguchi
See All by Ryo Sakaguchi
Android Architecture Componentsを使って、改善・効率化するAndroidアプリ開発
wakwak3125
0
1.2k
Test multiple APKs with Robolectric
wakwak3125
0
660
Clip, Elevation and ViewOutlineProvider
wakwak3125
1
1.1k
WebView as Fancy and effective View
wakwak3125
1
1.4k
ViewPager2をちょっとさわってみよう
wakwak3125
0
1.5k
年末だし、振り返るKotlin
wakwak3125
1
950
社内ライブラリのアップデートフロー
wakwak3125
4
3.5k
Wantedly Peopleのリリースフロー
wakwak3125
1
4.3k
KOINかわいいよ、KOIN
wakwak3125
0
820
Other Decks in Programming
See All in Programming
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
0
100
Ethereum_.pdf
nekomatu
0
460
ふかぼれ!CSSセレクターモジュール / Fukabore! CSS Selectors Module
petamoriken
0
150
CSC509 Lecture 11
javiergs
PRO
0
180
Snowflake x dbtで作るセキュアでアジャイルなデータ基盤
tsoshiro
2
520
Enabling DevOps and Team Topologies Through Architecture: Architecting for Fast Flow
cer
PRO
0
330
エンジニアとして関わる要件と仕様(公開用)
murabayashi
0
290
見せてあげますよ、「本物のLaravel批判」ってやつを。
77web
7
7.7k
광고 소재 심사 과정에 AI를 도입하여 광고 서비스 생산성 향상시키기
kakao
PRO
0
170
どうして僕の作ったクラスが手続き型と言われなきゃいけないんですか
akikogoto
1
120
AWS Lambdaから始まった Serverlessの「熱」とキャリアパス / It started with AWS Lambda Serverless “fever” and career path
seike460
PRO
1
260
Click-free releases & the making of a CLI app
oheyadam
2
110
Featured
See All Featured
Ruby is Unlike a Banana
tanoku
97
11k
The Power of CSS Pseudo Elements
geoffreycrofte
73
5.3k
RailsConf 2023
tenderlove
29
900
Keith and Marios Guide to Fast Websites
keithpitt
409
22k
How to train your dragon (web standard)
notwaldorf
88
5.7k
Making the Leap to Tech Lead
cromwellryan
133
8.9k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
KATA
mclloyd
29
14k
Music & Morning Musume
bryan
46
6.2k
Fireside Chat
paigeccino
34
3k
We Have a Design System, Now What?
morganepeng
50
7.2k
Typedesign – Prime Four
hannesfritz
40
2.4k
Transcript
ࡳଋͰGradleͷ έπΛୟ͍ͯΈͨ 2016/11/09 ୈ1ճελʔτΞοϓAndroidษڧձ @wakwak3125 from Lang-8, Inc
Ԛ͍λΠτϧͰ͢Έ·ͤΜ
About me. • ࡔޱ ྒ(͔͙ͪ͞Γΐ͏) • Ո۩ -> SIer ->
AndroidΞϓϦΤϯδχΞ • Θ͘Θ͘͞ΜͬͯݺΕͯ·͢ • ܲͱϏʔϧ͕͖Ͱ͢ • ࠓͷओ࠵ऀΛ͍͍͓ͤͯͨͩͯ͞Γ·͢
HiNative? • ޠֶ/จԽͷQ&AαʔϏε • ࣭͢ΔͱͦͷݴޠͷωΠςΟϰε ϐʔΧʔ͕͑ͯ͘Ε·͢ɻ • ͪΖΜແྉͰ͢
Example • ޠ͕ӳޠͰຊޠΛษڧ͍ͯ͠Δ Ϣʔβʔͷํ͕ɺʮ͜ͷຊޠͰࣗ વ͔ͳʁʯͱ͍͏༷ͳײ͡Ͱ࣭͠ ͍ͯ·͢ɻ • ͜ΕථܗࣜͰճ͕Ͱ͖ΔͷͰ ൃԻνΣοΫͳͲʹศརͰ͢ɻ
Ͱຊ…
AndroidϏϧυ͕͍ͱݴΘΕ·͢ΑͶ
࠷ۙiOS͔ΒAndroidʹҠͬͨ ࢲͷ༑ਓࣄ͋Δ͝ͱʹ
ʮͬͱૣ͘Ͱ͖Μͷʁʯ
ͱɺฉ͍ͯ͘Δ࢝Ͱ͢ɻ
ͱ͍͏ࣄͰɺϏϧυ࣌ؒΛߴԽ͢Δ Α͋͘ΔྫΛ·ͱΊͯΈ·ͨ͠ɻ
͔͜͜Βࢲͷݸਓͷڥͷ͓Ͱ͢ ྃ͝ঝ͍ͩ͘͞
Offline workʹ͢Δ
gradle.propertiesΛฤू͢Δ • org.gradle.daemon=true • σʔϞϯϓϩηεΛ͍·͢ • org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
• JVMͷҾʹϝϞϦΛͲΕ͘Β͍·ͰׂΓͯΔ͔Λ͜͜Ͱࢦఆ͢Δ • org.gradle.parallell=true • ฒྻϞʔυΛ༗ޮԽ • org.gradle.configureondemand=true • େ͖ͳϓϩδΣΫτͳͲͰ༗ޮͳ༷Ͱ͢ɻ gradle.properties 1/3
KotlinͷํՃͰ… • kotlin.incremantal=true • KotlinͰIncrementalϏϧυ͕༗ޮʹͳΓ·͢ɻ gradle.properties 2/3
AndroidStudio2.2Ͱ • android.enableBuildCache=true • ϏϧυΩϟογϡ͕༗ޮԽ͞ΕΔ༷Ͱ͢ɻ • ͦ͜·ͰͷޮՌͳ͍༷Ͱ͕͢ɺΕΔ͜ͱ͍ͬͯ ͖·͠ΐ͏తͳײ͡Ͱ͢ɻ gradle.properties 3/3
build.gradleΛฤू͢Δ android { … dexOptions { javaMaxHeapSize “2g” preDexLibraries true
} productFlavors { lollipop { // multidexڥͰ͔ͳΓૣ͘ͳΓ·͢ɻ minSdkVersion 21 } } }
ͱɺΑ͋͘ΔͭΛ· ͱΊͯΈ·ͨ͠ɻ
ͰϏϧυͯ͠Έ·͠ΐ͏ɻ
ϓϩδΣΫτ͜Μͳײ͡Ͱ͢ • Gradle 3.1 • Android Studio 2.2 • Kotlin1.0.4
Ϛγϯͪ͜Β • MacBook Pro 13 Early 2015 • Core i5
• RAM 8GB • SSD 256GB
લड़ͷઃఆΛԿ͠ͳ͍ ߹ͷ݁Ռͪ͜Β 1. 4 mins 32.036 secs 2. 3 mins
3.593 secs 3. 3 mins 13.68 secs 4. 2 mins 59.793 secs 5. 2 mins 49.458 secs
݁Ռͪ͜Β 1. 3 mins 39.298 secs 2. 1 mins 36.881
secs 3. 1 mins 33.334 secs 4. 1 mins 38.63 secs 5. 1 mins 36.758 secs
ૣ͘ɺɺɺͳΓ·ͨ͠Ͷʁ
͋͘·Ͱ૬ରతʹૣ͘ͳͬͨ ͷͰ͋Γɺීஈ͔Β͜Εͬ ͺΓগ͠ਏ͍Ͱ͢Ͷʁ
ಥવͰ͕͢͜͜Ͱฐࣾͷ ٻਓใΛݟͯΈ·͠ΐ͏
ڧͦ͏ͳ֎ࠃਓͷํ͕͍ࣸͬͯ·͢Ͷɻ ͏গ͠ݟͯΈ·͠ΐ͏ɻ
࡞ۀޮͷ্͕ΔͷʹͰ͖Δ͚ͩࢿ Λߦͳ͍ͬͯΔΑ͏Ͱ͢Ͷɻ
ͱ͍͏͜ͱͰ
͜ΜͳϚγϯΛ༻ҙͯ͠Β͍·ͨ͠ɻ ձࣾෛ୲࠷ߴο • iMac 5K Late2015 • Core i7(4GHz) •
RAM 64GB • SSD 512GB
build.gradleΛฤू͢Δ android { … dexOptions { javaMaxHeapSize “32g” preDexLibraries true
} productFlavors { lollipop { // multidexڥͰ͔ͳΓૣ͘ͳΓ·͢ɻ minSdkVersion 21 } } }
લड़ͷઃఆΛԿ͠ͳ͍ ߹ͷ݁Ռͪ͜Β 1. 1 mins 7.58 secs 2. 2 mins
51.058 secs 3. 1 mins 19.977 secs 4. 1 mins 5.356 secs 5. 37.249 secs
݁Ռͪ͜Β 1. 1 mins 10.933 secs 2. 20.561 secs 3.
19.172 secs 4. 20.31 secs 5. 18.745 secs
ૣ͘ͳΓ·ͨ͠Ͷʁ
݁ -> Ϗϧυ͓ۚͰૣ͘Ͱ͖Δ
͝੩ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠ɻ