SlideShare ist ein Scribd-Unternehmen logo
1 von 78
Downloaden Sie, um offline zu lesen
Slaying bugs
w/ Gradle and Jenkins
David Kay
Wednesday, September 11, 13
Overview
• Gradle
• Jenkins
Wednesday, September 11, 13
Build Tools?
Wednesday, September 11, 13
Wednesday, September 11, 13
Wednesday, September 11, 13
Wednesday, September 11, 13
Wednesday, September 11, 13
Unless your name is John Carmack, you aren’t.
So what are we left with?
Wednesday, September 11, 13
Wednesday, September 11, 13
Wednesday, September 11, 13
WTF is ?
• New Build system
• Alternatives
• ant
• maven
• buck
Wednesday, September 11, 13
In other words...
Trust me,
Wednesday, September 11, 13
it’s awesome.
Wednesday, September 11, 13
Wednesday, September 11, 13
Vlad putin is not convinced
Build Tools
• ant
• maven
• buck
Wednesday, September 11, 13
Wednesday, September 11, 13
• Simple
• Mature
• Customizable
What’s Awesome:
Wednesday, September 11, 13
In other words, it’s like duct tape
Wednesday, September 11, 13
If you’re the kind of person to build a prom dress out of duct tape
Wednesday, September 11, 13
It’ll be a great fit
• Lots of work
• No dependency management
What Sucks:
Wednesday, September 11, 13
For me, too much work
Wednesday, September 11, 13
• Mature
• Comprehensive
• Dependency management
• Easy configuration
What’s Awesome:
Wednesday, September 11, 13
Wednesday, September 11, 13
• Massively complex
• Shitty integration with libproject / .aar
• Hard to fix
What Sucks:
Wednesday, September 11, 13
Buck
Wednesday, September 11, 13
Buck
What’s Awesome:
• SOOOO FAST
• Simple
• Easy to compartmentalize project
Wednesday, September 11, 13
Wednesday, September 11, 13
Buck
What Sucks:
• No dependency management
• No support for running tests on device
• Poor documentation
Wednesday, September 11, 13
And the winner is....
Wednesday, September 11, 13
And the winner is....
Wednesday, September 11, 13
HOV!
And the winner is....
Wednesday, September 11, 13
Basics
Wednesday, September 11, 13
Basics
• Built on Groovy
Wednesday, September 11, 13
Wednesday, September 11, 13
Wednesday, September 11, 13
Basics
• Built on Groovy
• gradle files are Groovy files
Wednesday, September 11, 13
So, uh, where were we...
Basics
• gradle files are Groovy files
def square(x) {
x * x
}
in your build file!
Wednesday, September 11, 13
Hello World
> gradle -q hello
Hello world!
task hello {
doLast {
println 'Hello world!'
}
}
build.gradle
how to run
Wednesday, September 11, 13
LAME
Wednesday, September 11, 13
Hello Java
> gradle assemble
apply plugin: 'java'
build.gradle
how to run
Wednesday, September 11, 13
Not Bad...
Wednesday, September 11, 13
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
Alright!
Wednesday, September 11, 13
Hello Android
src/
main/
res/
value/
layout/
...
java/
com/
...
test/
res/
....
src/
....
Directory Structure
Wednesday, September 11, 13
Multi-Project
include ':HelloGradle', ':vendor:volley'
settings.gradle
project-root/
Wednesday, September 11, 13
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
Test Tools
• Unit tests: Robolectric
• Integration/end-to-end: Robotium
Wednesday, September 11, 13
?Wednesday, September 11, 13
Wednesday, September 11, 13
?Wednesday, September 11, 13
Wednesday, September 11, 13
OKOK
How do we RUN the tests?
Wednesday, September 11, 13
Hello Android
> gradle assemble
# compile debug/release/test
> gradle check
# run all tests
how to run
Wednesday, September 11, 13
Wednesday, September 11, 13
Nice!
But how do we AUTOMATE it?
Wednesday, September 11, 13
Jenkins!!!
Wednesday, September 11, 13
like a certain other butler
Jenkins!!!
• Rock-solid
• Plugins
• Hackable/extensible
What’s Awesome:
Wednesday, September 11, 13
like a certain other butler
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.
Jenkins!!!
• First-time config
• Android Emulator :(
• Resource-intensive
What Sucks:
Wednesday, September 11, 13
Build System
Build Slaves
Wednesday, September 11, 13
Build System Ouput
S3 Bucket
Build Errors
Dev Team
Beta Testers
Wednesday, September 11, 13
Wednesday, September 11, 13
Pitfalls
• Headless Emulator
• Android Emulator / Xvnc delay
• -no-audio
Wednesday, September 11, 13
Wednesday, September 11, 13
Comprende!
Wednesday, September 11, 13
Comprende!
WTF?
Wednesday, September 11, 13
“How a programmer reads your resume” - Steve Hanov
http://stevehanov.ca/blog/resume_comic.png
Wednesday, September 11, 13
CheckStyle
Wednesday, September 11, 13
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
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?
Wednesday, September 11, 13
Bug Hunting
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
Build System
Build Slaves
Wednesday, September 11, 13
Build System Ouput
S3 Bucket
Build Errors
Dev Team
Beta Testers
Wednesday, September 11, 13
Thanks!
• http://bit.ly/gradle-jenkins for the code
Wednesday, September 11, 13
Recommended Reading
Android Gradle Plugin User Guide
Growing Object-Oriented Software, Guided By Tests
Wednesday, September 11, 13
Shameless Pitch
We build apps for iOS & Android
www.gargoyle.co
Wednesday, September 11, 13
Contact
David Y. Kay
@DavidYKay
dk@gargoyle.co
Wednesday, September 11, 13

Weitere ähnliche Inhalte

Ähnlich wie Slaying Bugs with Gradle and Jenkins

How I Learned To Stop Worrying & Love HTML5
How I Learned To Stop Worrying & Love HTML5How I Learned To Stop Worrying & Love HTML5
How I Learned To Stop Worrying & Love HTML5
Dale Cruse
 
Vinted life embetterment
Vinted life embettermentVinted life embetterment
Vinted life embetterment
Agile Lietuva
 
Kostentreiber bei der iOS-Entwicklung
Kostentreiber bei der iOS-EntwicklungKostentreiber bei der iOS-Entwicklung
Kostentreiber bei der iOS-Entwicklung
xrb
 
Design process
Design processDesign process
Design process
Tim Wright
 
Agileee 2013: Andrii Dzynia "How To Manage Testing in Agile World"
Agileee 2013: Andrii Dzynia "How To Manage Testing in Agile World"Agileee 2013: Andrii Dzynia "How To Manage Testing in Agile World"
Agileee 2013: Andrii Dzynia "How To Manage Testing in Agile World"
SCRUMguides
 

Ähnlich wie Slaying Bugs with Gradle and Jenkins (20)

Some simple tips for front-end performance in WordPress
Some simple tips for front-end performance in WordPressSome simple tips for front-end performance in WordPress
Some simple tips for front-end performance in WordPress
 
Cooking an Omelette with Chef
Cooking an Omelette with ChefCooking an Omelette with Chef
Cooking an Omelette with Chef
 
How I Learned To Stop Worrying & Love HTML5
How I Learned To Stop Worrying & Love HTML5How I Learned To Stop Worrying & Love HTML5
How I Learned To Stop Worrying & Love HTML5
 
Embedjs
EmbedjsEmbedjs
Embedjs
 
Vinted life embetterment
Vinted life embettermentVinted life embetterment
Vinted life embetterment
 
Atlassian User Group San Francisco - August 2013
Atlassian User Group San Francisco - August 2013Atlassian User Group San Francisco - August 2013
Atlassian User Group San Francisco - August 2013
 
San Francisco User Group Presentations: 28 Aug 2013
San Francisco User Group Presentations: 28 Aug 2013San Francisco User Group Presentations: 28 Aug 2013
San Francisco User Group Presentations: 28 Aug 2013
 
Android Design: Beyond the Guidelines
Android Design: Beyond the GuidelinesAndroid Design: Beyond the Guidelines
Android Design: Beyond the Guidelines
 
Kostentreiber bei der iOS Entwicklung
Kostentreiber bei der iOS EntwicklungKostentreiber bei der iOS Entwicklung
Kostentreiber bei der iOS Entwicklung
 
Kostentreiber bei der iOS-Entwicklung
Kostentreiber bei der iOS-EntwicklungKostentreiber bei der iOS-Entwicklung
Kostentreiber bei der iOS-Entwicklung
 
Multiplatform, Promises and HTML5
Multiplatform, Promises and HTML5Multiplatform, Promises and HTML5
Multiplatform, Promises and HTML5
 
Ruby meetup 7_years_in_testing
Ruby meetup 7_years_in_testingRuby meetup 7_years_in_testing
Ruby meetup 7_years_in_testing
 
TDD with LEGO at SDEC13
TDD with LEGO at SDEC13TDD with LEGO at SDEC13
TDD with LEGO at SDEC13
 
Internet primer or Internet for Dummies (for Filipino women)
Internet primer or Internet for Dummies (for Filipino women)Internet primer or Internet for Dummies (for Filipino women)
Internet primer or Internet for Dummies (for Filipino women)
 
Design process
Design processDesign process
Design process
 
5 Ways Thinking Content-first Will Save Your Butt
5 Ways Thinking Content-first Will Save Your Butt5 Ways Thinking Content-first Will Save Your Butt
5 Ways Thinking Content-first Will Save Your Butt
 
Orientacao a objetos e design patterns - Secomp Londrina
Orientacao a objetos e design patterns - Secomp LondrinaOrientacao a objetos e design patterns - Secomp Londrina
Orientacao a objetos e design patterns - Secomp Londrina
 
Agileee 2013: Andrii Dzynia "How To Manage Testing in Agile World"
Agileee 2013: Andrii Dzynia "How To Manage Testing in Agile World"Agileee 2013: Andrii Dzynia "How To Manage Testing in Agile World"
Agileee 2013: Andrii Dzynia "How To Manage Testing in Agile World"
 
DevOpsDay London Ben Hughes Security
DevOpsDay London Ben Hughes SecurityDevOpsDay London Ben Hughes Security
DevOpsDay London Ben Hughes Security
 
MongoTalk/Voyage
MongoTalk/VoyageMongoTalk/Voyage
MongoTalk/Voyage
 

Mehr von David Kay

App architecture101
App architecture101App architecture101
App architecture101
David Kay
 

Mehr von David Kay (6)

Cross platform native development in f#
Cross platform native development in f#Cross platform native development in f#
Cross platform native development in f#
 
How to Start a Med Device Startup From Your Garage - Vancouver Edition
How to Start a Med Device Startup From Your Garage - Vancouver EditionHow to Start a Med Device Startup From Your Garage - Vancouver Edition
How to Start a Med Device Startup From Your Garage - Vancouver Edition
 
Drag and Drop UI Development with React Native
Drag and Drop UI Development with React NativeDrag and Drop UI Development with React Native
Drag and Drop UI Development with React Native
 
Front-end God Mode with Reagent and Figwheel
Front-end God Mode with Reagent and FigwheelFront-end God Mode with Reagent and Figwheel
Front-end God Mode with Reagent and Figwheel
 
Intro to Apache Storm
Intro to Apache StormIntro to Apache Storm
Intro to Apache Storm
 
App architecture101
App architecture101App architecture101
App architecture101
 

Kürzlich hochgeladen

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 

Kürzlich hochgeladen (20)

08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 

Slaying Bugs with Gradle and Jenkins