Your SlideShare is downloading. ×
Slaying Bugs with Gradle and Jenkins
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Saving this for later?

Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime - even offline.

Text the download link to your phone

Standard text messaging rates apply

Slaying Bugs with Gradle and Jenkins

1,807
views

Published on

A comprehensive look at …

A comprehensive look at

From the New York Android Developers meetup

Published in: Technology, News & Politics

0 Comments
3 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,807
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
21
Comments
0
Likes
3
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Slaying bugs w/ Gradle and Jenkins David Kay Wednesday, September 11, 13
  • 2. Overview • Gradle • Jenkins Wednesday, September 11, 13
  • 3. Build Tools? Wednesday, September 11, 13
  • 4. Wednesday, September 11, 13
  • 5. Wednesday, September 11, 13
  • 6. Wednesday, September 11, 13
  • 7. Wednesday, September 11, 13 Unless your name is John Carmack, you aren’t. So what are we left with?
  • 8. Wednesday, September 11, 13
  • 9. Wednesday, September 11, 13
  • 10. Wednesday, September 11, 13
  • 11. WTF is ? • New Build system • Alternatives • ant • maven • buck Wednesday, September 11, 13 In other words...
  • 12. Trust me, Wednesday, September 11, 13
  • 13. it’s awesome. Wednesday, September 11, 13
  • 14. Wednesday, September 11, 13 Vlad putin is not convinced
  • 15. Build Tools • ant • maven • buck Wednesday, September 11, 13
  • 16. Wednesday, September 11, 13
  • 17. • Simple • Mature • Customizable What’s Awesome: Wednesday, September 11, 13 In other words, it’s like duct tape
  • 18. Wednesday, September 11, 13 If you’re the kind of person to build a prom dress out of duct tape
  • 19. Wednesday, September 11, 13 It’ll be a great fit
  • 20. • Lots of work • No dependency management What Sucks: Wednesday, September 11, 13 For me, too much work
  • 21. Wednesday, September 11, 13
  • 22. • Mature • Comprehensive • Dependency management • Easy configuration What’s Awesome: Wednesday, September 11, 13
  • 23. Wednesday, September 11, 13
  • 24. • Massively complex • Shitty integration with libproject / .aar • Hard to fix What Sucks: Wednesday, September 11, 13
  • 25. Buck Wednesday, September 11, 13
  • 26. Buck What’s Awesome: • SOOOO FAST • Simple • Easy to compartmentalize project Wednesday, September 11, 13
  • 27. Wednesday, September 11, 13
  • 28. Buck What Sucks: • No dependency management • No support for running tests on device • Poor documentation Wednesday, September 11, 13
  • 29. And the winner is.... Wednesday, September 11, 13
  • 30. And the winner is.... Wednesday, September 11, 13 HOV!
  • 31. And the winner is.... Wednesday, September 11, 13
  • 32. Basics Wednesday, September 11, 13
  • 33. Basics • Built on Groovy Wednesday, September 11, 13
  • 34. Wednesday, September 11, 13
  • 35. Wednesday, September 11, 13
  • 36. Basics • Built on Groovy • gradle files are Groovy files Wednesday, September 11, 13 So, uh, where were we...
  • 37. Basics • gradle files are Groovy files def square(x) { x * x } in your build file! Wednesday, September 11, 13
  • 38. Hello World > gradle -q hello Hello world! task hello { doLast { println 'Hello world!' } } build.gradle how to run Wednesday, September 11, 13
  • 39. LAME Wednesday, September 11, 13
  • 40. Hello Java > gradle assemble apply plugin: 'java' build.gradle how to run Wednesday, September 11, 13
  • 41. Not Bad... Wednesday, September 11, 13
  • 42. Hello Android buildscript { dependencies { classpath 'com.android.tools.build:gradle:0.5.6' } } apply plugin: 'android' android { compileSdkVersion 17 } build.gradle > gradle assemble how to run Wednesday, September 11, 13
  • 43. Alright! Wednesday, September 11, 13
  • 44. Hello Android src/ main/ res/ value/ layout/ ... java/ com/ ... test/ res/ .... src/ .... Directory Structure Wednesday, September 11, 13
  • 45. Multi-Project include ':HelloGradle', ':vendor:volley' settings.gradle project-root/ Wednesday, September 11, 13
  • 46. Dependencies ... dependencies { // from a local jar compile files('jackson.jar') // from maven central/etc compile 'com.jayway.android.robotium:robotium-solo:4.2' // from a library project compile project(':vendor:volley') } ... build.gradle Wednesday, September 11, 13
  • 47. Test Tools • Unit tests: Robolectric • Integration/end-to-end: Robotium Wednesday, September 11, 13
  • 48. ?Wednesday, September 11, 13
  • 49. Wednesday, September 11, 13
  • 50. ?Wednesday, September 11, 13
  • 51. Wednesday, September 11, 13
  • 52. OKOK How do we RUN the tests? Wednesday, September 11, 13
  • 53. Hello Android > gradle assemble # compile debug/release/test > gradle check # run all tests how to run Wednesday, September 11, 13
  • 54. Wednesday, September 11, 13
  • 55. Nice! But how do we AUTOMATE it? Wednesday, September 11, 13
  • 56. Jenkins!!! Wednesday, September 11, 13 like a certain other butler
  • 57. Jenkins!!! • Rock-solid • Plugins • Hackable/extensible What’s Awesome: Wednesday, September 11, 13 like a certain other butler
  • 58. Wednesday, September 11, 13 Won’t tell you stories about Burmese jewel bandits. ...but at least he won’t walk out on you to prove a point.
  • 59. Jenkins!!! • First-time config • Android Emulator :( • Resource-intensive What Sucks: Wednesday, September 11, 13
  • 60. Build System Build Slaves Wednesday, September 11, 13
  • 61. Build System Ouput S3 Bucket Build Errors Dev Team Beta Testers Wednesday, September 11, 13
  • 62. Wednesday, September 11, 13
  • 63. Pitfalls • Headless Emulator • Android Emulator / Xvnc delay • -no-audio Wednesday, September 11, 13
  • 64. Wednesday, September 11, 13
  • 65. Comprende! Wednesday, September 11, 13
  • 66. Comprende! WTF? Wednesday, September 11, 13
  • 67. “How a programmer reads your resume” - Steve Hanov http://stevehanov.ca/blog/resume_comic.png Wednesday, September 11, 13
  • 68. CheckStyle Wednesday, September 11, 13
  • 69. CheckStyle <module name="Checker"> <module name="TreeWalker"> <property name="tabWidth" value="2"/> <module name="Indentation"> <property name="caseIndent" value="2"/> <property name="basicOffset" value="2"/> </module> <module name="GenericWhitespace"/> <module name="AvoidStarImport"/> <module name="ConstantName"/> <module name="EmptyBlock"/> <module name="MemberName"/> <module name="ConstantName"/> <module name="MethodName"/> <module name="TypeName"/> </module> <module name="StrictDuplicateCode"> <property name="min" value="15"/> </module> </module> Wednesday, September 11, 13
  • 70. defaultConfig { versionName '0.1.1' versionCode System.env.BUILD_NUMBER ? "$System.env.BUILD_NUMBER".toInteger() : 2 } build.gradle Auto-build Number Wednesday, September 11, 13 Why is this relevant?
  • 71. Wednesday, September 11, 13 Bug Hunting
  • 72. defaultConfig { versionName '0.1.1' versionCode System.env.BUILD_NUMBER ? "$System.env.BUILD_NUMBER".toInteger() : 2 } build.gradle Auto-build Number Wednesday, September 11, 13
  • 73. Build System Build Slaves Wednesday, September 11, 13
  • 74. Build System Ouput S3 Bucket Build Errors Dev Team Beta Testers Wednesday, September 11, 13
  • 75. Thanks! • http://bit.ly/gradle-jenkins for the code Wednesday, September 11, 13
  • 76. Recommended Reading Android Gradle Plugin User Guide Growing Object-Oriented Software, Guided By Tests Wednesday, September 11, 13
  • 77. Shameless Pitch We build apps for iOS & Android www.gargoyle.co Wednesday, September 11, 13
  • 78. Contact David Y. Kay @DavidYKay dk@gargoyle.co Wednesday, September 11, 13