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
buck, okbuck そして okbazel
Search
Ryosuke Horie
March 23, 2017
0
670
buck, okbuck そして okbazel
Ryosuke Horie
March 23, 2017
Tweet
Share
More Decks by Ryosuke Horie
See All by Ryosuke Horie
GitHub Copilotは開発者の生産性をどれだけ上げるのか?ZOZOでの全社導入とその効果 / How Much Does GitHub Copilot Improve Developer Productivity? The Company-wide Implementation and Its Effects at ZOZO
horie1024
35
23k
ZOZOTOWNにおける開発生産性向上に関する取り組み / Initiatives to Improve Development Productivity at ZOZOTOWN
horie1024
8
5.9k
How does the Relay connect Android app development and Design?
horie1024
2
1.8k
既存画面の Jetpack Composeでの書き換え: FAANSでの事例紹介 / Case study of rewriting existing screens with Jetpack Compose
horie1024
0
1.6k
スキルマップを作った話 / Create a skills map
horie1024
3
4.4k
Miroを使った開発効率向上のための取り組み / Using Miro Efforts to Improve Development Efficiency
horie1024
0
2.3k
ktlintカスタムルールのパッケージ化と再利用/Package and reuse ktlint custom rules
horie1024
1
1.1k
Jetpack Benchmarkでの ViewのInflateパフォーマンスの可視化と改善 / The Jetpack Benchmark. Visualizing and improving View Inflate performance
horie1024
3
1.1k
ZOZOTOWNでの Dagger Hilt対応について/Migration to Dagger Hilt at ZOZOTOWN.
horie1024
1
2k
Featured
See All Featured
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
47
2.1k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
42
9.2k
Rebuilding a faster, lazier Slack
samanthasiow
79
8.7k
How STYLIGHT went responsive
nonsquared
95
5.2k
Fontdeck: Realign not Redesign
paulrobertlloyd
82
5.2k
Imperfection Machines: The Place of Print at Facebook
scottboms
265
13k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
26
2.1k
[RailsConf 2023] Rails as a piece of cake
palkan
52
4.9k
Fashionably flexible responsive web design (full day workshop)
malarkey
405
65k
Navigating Team Friction
lara
183
14k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
250
21k
Designing for Performance
lara
604
68k
Transcript
buck, okbuck ͦͯ͠ okbazel @Horie1024 2017/3/23 Gotanda.mobile #2 1
About Me • Ryosuke Horie @Horie1024 • VASILY,Inc. AndroidΤϯδχΞ •
ࡢ11݄ʹޒా • !ͱࣗಈԽ͕͖ • ࠷ۙࢠڙ͕ੜ·Ε·ͨ͠" 2
ࠓ͢༰ • AndroidͷϏϧυπʔϧʹ͍ͭͯͷ 3
AndroidͷϏϧυπʔϧ • 2017/3/23ݱࡏ Android StudioͰͷ։ൃ͕Ұൠత • Android Gradle Plugin •
Android StudioͷϏϧυγεςϜGradleϕʔε • Ϗϧυπʔϧͱͯ͠Gradle͕ඪ४ 4
GradleͰͷϏϧυ • Gradleڧྗ! • DSLͰͷϏϧυεΫϦϓτͷهड़ • ϚϧνϓϩδΣΫτͷϏϧυ • ॊೈͳґଘؔͷཧͳͲ •
͔͠͠Ϗϧυ͕͘ͳ͍" 5
ϏϧυΛߴԽ͢Δʹʁ! • Ξϓϩʔν2ͭ • ઃఆͷௐ • GradleҎ֎ͷϏϧυπʔϧͷར༻ 6
ઃఆͷௐ • ϓϩδΣΫτʹ߹Θͤͯνϡʔχϯά • How to decrease your Gradle build
time by 65%? • 10 Tips to Improve Your Gradle Build Time 7
GradleҎ֎ͷϏϧυπʔϧͷར༻ • Bazel • Buck 8
Bazel • Google͕։ൃ͍ͯ͠ΔϏϧυπʔϧ • Cookpad͞Μͷهࣄ͕Θ͔Γ͍͢ • http://techlife.cookpad.com/entry/introduce- bazel-build 9
Buck • Facebook͕։ൃɾ༻͍ͯ͠ΔϏϧυπʔϧ • ex-Googlers͕FacebookͰ࡞ͬͨΒ͍͠(Bazel Q&AΑΓ) • BuckBazelΑΓޙʹઃܭ • ಛ͕ҟͳΔͷͰGoogleBuckΛΘͳ͍(Bazel
Q&AΑΓ) 10
BazelͱBuckͷҧ͍ʁ! 11
Bazel features • Speed • Scalability • Flexibility • Correctness
• Reliability • Repeatability 12
Buck features • Speed up your builds • Add reproducibility
to your builds • Get correct incremental builds • Understand your dependencies • Integrate with your IDE 13
BazelͱBuckͷҧ͍ʁ! • ͲͪΒϏϧυ͕͍ͷ͕ചΓ • ϏϧυΛߴԽ͍ͨ͠ͷͰخ͍͠ • ಛ͕શମతʹࣅ͍ͯΔΑ͏ͳؾɾɾ • ϏϧυεΫϦϓτͷॻ͖ํࣅ͍ͯΔ 14
Bazel android_library rule sample android_library( name = "activities", srcs =
glob(["src/activities/*.java"]), custom_package = "com.google.bazel.example", manifest = "src/example/AndroidManifest.xml", resource_files = glob(["src/example/res/**"]), ) 15
Buck android_library rule sample android_library( name = 'lib', srcs =
glob(['*.java']), deps = [ '//android/resources:res', '//android/cxx:jni', ], visibility = [ '//android:demo-app', ], ) 16
BazelͱBuckͷҧ͍ʁ! • ͲͪΒϏϧυ͕͍ͷ͕ചΓ • શମతʹࣅ͍ͯΔ • ϏϧυεΫϦϓτͷॻ͖ํࣅ͍ͯΔ 17
BazelͱBuckͷҧ͍ʁ! • ͲͪΒϏϧυ͕͍ͷ͕ചΓ • શମతʹࣅ͍ͯΔ • ϏϧυεΫϦϓτͷॻ͖ํࣅ͍ͯΔ • ͲͪΒϏϧυͷઃఆ͕͍͠ 18
Ϗϧυͷઃఆਏ͍ • BazelɺBuckͷͲͪΒGradleͱൺֱͯ͠ཧղ͠ਏ͍ • Gradle͔ΒͷҠߦίετ⬆ • ϝϯς͢Δͷਏͦ͏ • ͦ͜Ͱొ͢Δͷ͕okbuck 19
okbuck • Uber͕։ൃ͍ͯ͠ΔGradle plugin • https://github.com/uber/okbuck • GradleϓϩδΣΫτͰBuckΛ׆༻͢Δͷ͕త • Gradle
wrapperϥΠΫͳBuck wrapperΛఏڙ • ./buckw build target 20
okbuck tasks • buckWrapper - Create buck wrapper • okbuck
- Generate BUCK files • okbuckClean - Delete configuration files generated by OkBuck • setupOkbuck - Setup okbuck cache and dependencies 21
Generate BUCK files • ./gradlew okbuckͰBUCKϑΝΠϧΛੜ • build.gradle͔ΒઃఆΛಡΈࠐΈࣗಈੜ 22
GradleͱBuckͷڞଘ • GradleϓϩδΣΫτͷߏΛม͑ͣʹBuckͱڞଘ • طଘͷϓϩδΣΫτͷಋೖ͕༰қ • ։ൃBuckɺϦϦʔεAPKGradleͰϏϧυͷΑ͏ͳ͍ํ 23
Ϗϧυൺֱ • okbuckαϯϓϧϓϩδΣΫτݕূ • 5ճΫϦʔϯϏϧυΛ࣮ߦͨ͠ฏۉ • Buck: ฏۉ 19.6s •
Gradle: ฏۉ 79.2s 24
okbuckͷ੍ • Buckͷ੍Λͦͷ··ड͚Δ • DataBindingඇαϙʔτ! • Kotlinඇαϙʔτ! • Facebookͷํʹࠨӈ͞ΕΔ 25
okbazelʁ 26
okbazel • okbuckͷrepositoryʹPull Request͕ग़͍ͯΔ • Experimental okbazel support #251 •
PRग़ͯ͠ΔͷBazelͷதͷਓΒ͍͠ • Ϛʔδ͞Ε͍ͯͳ͍ 27
okbazelͷ੍ • Bazelͷ੍Λͦͷ··ड͚Δ • DataBindingαϙʔτPR͕ग़͍ͯΔ • Add Android data binding
support • Kotlinαϙʔτݱঢ়Ͳ͏ͳΔ͔Θ͔Βͳ͍ • Google͕։ൃ͍ͯ͠Δͷେ͖͍ 28
·ͱΊ • okbuckΛར༻͢ΔͱGradleϓϩδΣΫτͰBuckΛར༻Մೳ • buckͰϏϧυ͘ͳΓͦ͏੍͕ͩ͋Δ • okbazel͕։ൃதͳͷͰظ! 29
͋Γ͕ͱ͏͍͟͝·ͨ͠ 30