SlideShare uma empresa Scribd logo
1 de 14
Baixar para ler offline
Reid Baker
Gradle + Android
What it is + How to get up to speed
01
What is Gradle?
✤ Build system!
✤ Language independent!
✤ Flexible dependency
management !
✤ Built on Groovy!
✤ Future of android development
Why should you use Gradle?
✤ Easy setup with Gradle wrapper !
✤ Make builds faster!
✤ Separate editor and compiler!
✤ More control over your builds!
✤ Control build tools versions!
✤ Change properties!
✤ Manage dependencies
GradleWrapper
✤ No installation of gradle is needed after setting up !
✤ Sets your version of gradle and where to look for it!
✤ Works for *NIX and Windows!
✤ ./gradlew tasks will list what you can do
Faster you say?
✤ Incremental builds!
✤ Avoid work you don’t need easily ex. only lint debug
builds and proguard release builds!
✤ Set flags in settings.gradle to make gradle faster

org.gradle.daemon=true
Freedom to update
✤ IDE updates can’t break the build!
✤ Android tool updates can’t break the build!
✤ install<buildtype> will assemble your apk and install it to the
connected device!
✤ Dependencies are stored locally in the build directory
It is all about control
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.10.+'
}
}
apply plugin: ‘android’
!
repositories {
maven {
url “https://maven.vpn.etonreve.com/repo”
}
}
!
//Where should I find the android tools
//What version of the android tools
!
//Tell gradle to we want to use the
android plugin
!
//Where are the android dependancies
located
Control over your apk
android {
compileSdkVersion 17
buildToolsVersion "19.0.1"
!
sourceSets.main {
java.srcDirs = ['src']
res.srcDirs = ['res']
manifest.srcFile ‘AndroidManifest.xml’
}
!
buildTypes {
debug {
debuggable true //unnecessary
packageNameSuffix '.dev'
if (someVariable) {
signingConfig signingConfigs.release
}
}
<Other release types>
}
}
Dependency management
dependencies {
compile project(“:libraries:skitchkit-android")
!
compile ‘com.android.support:support-v4:19.0.+’
!
compile ('com.actionbarsherlock:actionbarsherlock:4.4.0@aar') {
exclude group: 'com.android.support', module: 'support-v4'
}
!
compile files('/Users/rbaker/dev/google-play-services.jar')
!
provided 'com.google.android.maps:maps:16_r2'
}
BuildTypes and BuildFlavors
Release Types!
✤ Ex. Debug, Beta, Release!
✤ Change package!
✤ Change signing key
Build flavors!
✤ Ex. Architecture, 

Free/Premium

Branding!
✤ Can be grouped !
✤ Can have different src
and res directories
Lets look at a real build file
Tips andTricks
✤ ./gradlew uninstall[flavor] will uninstall the previous version!
✤ Shorten commands with camel case ex.

./gradlew installAllArchEvernoteDebug

./gradlew iAAED!
!
!
✤ Handy command line arguments

--offline flag while building to not go to the server 

--refresh-dependencies to tell Gradle to fetch all new dependencies !
✤ Dependencies are cached for 24 hours but you can change how long

configurations.all {

resolutionStrategy.cacheDynamicVersionsFor 4, ‘hours’

}!
!
✤ .aar file is a zip. you can unzip it to see what’s inside.!
!
✤ Install the groovy shell to quickly verify that your groovy does what it is supposed to!
Additional Resources
✤ Start by watching this Google IO talk: http://
www.youtube.com/watch?v=LCJAgPkpmR0!
✤ Get up to speed with Groovy: http://groovy.codehaus.org/
Groovy+style+and+language+feature+guidelines+for+Java
+developers!
✤ Get up to speed with Gradle: http://fbflex.wordpress.com/
2013/05/01/12-new-things-i-learned-from-a-three-day-
gradle-training/!
✤ More info about resource merging  http://tools.android.com/
tech-docs/new-build-system/resource-merging
Thanks for coming
Follow me on twitter @reidbaker

Mais conteúdo relacionado

Mais procurados

Javaone - Gradle: Harder, Better, Stronger, Faster
Javaone - Gradle: Harder, Better, Stronger, Faster Javaone - Gradle: Harder, Better, Stronger, Faster
Javaone - Gradle: Harder, Better, Stronger, Faster Andres Almiray
 
A/B test your Android build setup with ASPoet
A/B test your Android build setup with ASPoetA/B test your Android build setup with ASPoet
A/B test your Android build setup with ASPoetBoris Farber
 
Golang start and tips
Golang start and tipsGolang start and tips
Golang start and tipsAaron King
 
Getting started with building your own standalone Gradle plugin
Getting started with building your own standalone Gradle pluginGetting started with building your own standalone Gradle plugin
Getting started with building your own standalone Gradle plugintobiaspreuss
 
Continuously Break The Android
Continuously Break The AndroidContinuously Break The Android
Continuously Break The AndroidHasan Hosgel
 
Introduction to Android Studio
Introduction to Android StudioIntroduction to Android Studio
Introduction to Android StudioMichael Pan
 
(Live) build and run golang web server on android.avi
(Live) build and run golang web server on android.avi(Live) build and run golang web server on android.avi
(Live) build and run golang web server on android.aviSeongJae Park
 
Intro to Flutter
Intro to FlutterIntro to Flutter
Intro to FlutterEason Pai
 
Google App Engine Developer - Day1
Google App Engine Developer - Day1Google App Engine Developer - Day1
Google App Engine Developer - Day1Simon Su
 
React Nativeアプリをリリースし続けるために、最初に行う8つの取り組み
React Nativeアプリをリリースし続けるために、最初に行う8つの取り組みReact Nativeアプリをリリースし続けるために、最初に行う8つの取り組み
React Nativeアプリをリリースし続けるために、最初に行う8つの取り組みYukiya Nakagawa
 
Android Studio 3 - Dependency-Aware Build Variants and Product Flavors
Android Studio 3 - Dependency-Aware Build Variants and Product FlavorsAndroid Studio 3 - Dependency-Aware Build Variants and Product Flavors
Android Studio 3 - Dependency-Aware Build Variants and Product FlavorsStefan Martynkiw
 
Intro to Flutter SDK
Intro to Flutter SDKIntro to Flutter SDK
Intro to Flutter SDKdigitaljoni
 
Improving the developer experience on OpenShift - devconf-india-18
Improving the developer experience on OpenShift - devconf-india-18Improving the developer experience on OpenShift - devconf-india-18
Improving the developer experience on OpenShift - devconf-india-18Jorge Morales
 
Introduction to React Native
Introduction to React NativeIntroduction to React Native
Introduction to React NativeWaqqas Jabbar
 

Mais procurados (20)

Javaone - Gradle: Harder, Better, Stronger, Faster
Javaone - Gradle: Harder, Better, Stronger, Faster Javaone - Gradle: Harder, Better, Stronger, Faster
Javaone - Gradle: Harder, Better, Stronger, Faster
 
A/B test your Android build setup with ASPoet
A/B test your Android build setup with ASPoetA/B test your Android build setup with ASPoet
A/B test your Android build setup with ASPoet
 
Golang start and tips
Golang start and tipsGolang start and tips
Golang start and tips
 
Why golang
Why golangWhy golang
Why golang
 
Android studio
Android studioAndroid studio
Android studio
 
Getting started with building your own standalone Gradle plugin
Getting started with building your own standalone Gradle pluginGetting started with building your own standalone Gradle plugin
Getting started with building your own standalone Gradle plugin
 
Continuously Break The Android
Continuously Break The AndroidContinuously Break The Android
Continuously Break The Android
 
Introduction to Android Studio
Introduction to Android StudioIntroduction to Android Studio
Introduction to Android Studio
 
(Live) build and run golang web server on android.avi
(Live) build and run golang web server on android.avi(Live) build and run golang web server on android.avi
(Live) build and run golang web server on android.avi
 
Intro to Flutter
Intro to FlutterIntro to Flutter
Intro to Flutter
 
Google Web Toolkit
Google Web ToolkitGoogle Web Toolkit
Google Web Toolkit
 
OOoEclipse talks now C++
OOoEclipse talks now C++OOoEclipse talks now C++
OOoEclipse talks now C++
 
Google App Engine Developer - Day1
Google App Engine Developer - Day1Google App Engine Developer - Day1
Google App Engine Developer - Day1
 
React Nativeアプリをリリースし続けるために、最初に行う8つの取り組み
React Nativeアプリをリリースし続けるために、最初に行う8つの取り組みReact Nativeアプリをリリースし続けるために、最初に行う8つの取り組み
React Nativeアプリをリリースし続けるために、最初に行う8つの取り組み
 
Android Made Simple
Android Made SimpleAndroid Made Simple
Android Made Simple
 
Android Studio 3 - Dependency-Aware Build Variants and Product Flavors
Android Studio 3 - Dependency-Aware Build Variants and Product FlavorsAndroid Studio 3 - Dependency-Aware Build Variants and Product Flavors
Android Studio 3 - Dependency-Aware Build Variants and Product Flavors
 
Building at a glance
Building at a glanceBuilding at a glance
Building at a glance
 
Intro to Flutter SDK
Intro to Flutter SDKIntro to Flutter SDK
Intro to Flutter SDK
 
Improving the developer experience on OpenShift - devconf-india-18
Improving the developer experience on OpenShift - devconf-india-18Improving the developer experience on OpenShift - devconf-india-18
Improving the developer experience on OpenShift - devconf-india-18
 
Introduction to React Native
Introduction to React NativeIntroduction to React Native
Introduction to React Native
 

Semelhante a Intro to Gradle + How to get up to speed

Moderne Android Builds mit Gradle
Moderne Android Builds mit GradleModerne Android Builds mit Gradle
Moderne Android Builds mit Gradleinovex GmbH
 
Mastering the NDK with Android Studio 2.0 and the gradle-experimental plugin
Mastering the NDK with Android Studio 2.0 and the gradle-experimental pluginMastering the NDK with Android Studio 2.0 and the gradle-experimental plugin
Mastering the NDK with Android Studio 2.0 and the gradle-experimental pluginXavier Hallade
 
An Introduction To Android
An Introduction To AndroidAn Introduction To Android
An Introduction To Androidnatdefreitas
 
Auf Augenhöhe mit Android Studio und Gradle
Auf Augenhöhe mit Android Studio und GradleAuf Augenhöhe mit Android Studio und Gradle
Auf Augenhöhe mit Android Studio und Gradleinovex GmbH
 
20170321 docker with Visual Studio 2017
20170321 docker with Visual Studio 201720170321 docker with Visual Studio 2017
20170321 docker with Visual Studio 2017Takayoshi Tanaka
 
Hacking the Codename One Source Code - Part IV - Transcript.pdf
Hacking the Codename One Source Code - Part IV - Transcript.pdfHacking the Codename One Source Code - Part IV - Transcript.pdf
Hacking the Codename One Source Code - Part IV - Transcript.pdfShaiAlmog1
 
Android Introduction
Android IntroductionAndroid Introduction
Android Introductionaswapnal
 
Getting Started with Android - OSSPAC 2009
Getting Started with Android - OSSPAC 2009Getting Started with Android - OSSPAC 2009
Getting Started with Android - OSSPAC 2009sullis
 
Android gradle-build-system-overview
Android gradle-build-system-overviewAndroid gradle-build-system-overview
Android gradle-build-system-overviewKevin He
 
Level Up Your Android Build -Droidcon Berlin 2015
Level Up Your Android Build -Droidcon Berlin 2015Level Up Your Android Build -Droidcon Berlin 2015
Level Up Your Android Build -Droidcon Berlin 2015Friedger Müffke
 
Cross-Platform Development using Angulr JS in Visual Studio
Cross-Platform Development using Angulr JS in Visual StudioCross-Platform Development using Angulr JS in Visual Studio
Cross-Platform Development using Angulr JS in Visual StudioMizanur Sarker
 
Android, Gradle & Dependecies
Android, Gradle & DependeciesAndroid, Gradle & Dependecies
Android, Gradle & DependeciesÉdipo Souza
 
Jakarta js meetup kudo
Jakarta js meetup kudoJakarta js meetup kudo
Jakarta js meetup kudoAgung Julisman
 
DevAssistant, Docker and You
DevAssistant, Docker and YouDevAssistant, Docker and You
DevAssistant, Docker and YouBalaBit
 
ID Android TechTalk Series #6 : Google Service and Gradle - Anton Nurdin Tuha...
ID Android TechTalk Series #6 : Google Service and Gradle - Anton Nurdin Tuha...ID Android TechTalk Series #6 : Google Service and Gradle - Anton Nurdin Tuha...
ID Android TechTalk Series #6 : Google Service and Gradle - Anton Nurdin Tuha...Dicoding
 
Exploring the power of Gradle in android studio - Basics & Beyond
Exploring the power of Gradle in android studio - Basics & BeyondExploring the power of Gradle in android studio - Basics & Beyond
Exploring the power of Gradle in android studio - Basics & BeyondKaushal Dhruw
 

Semelhante a Intro to Gradle + How to get up to speed (20)

Moderne Android Builds mit Gradle
Moderne Android Builds mit GradleModerne Android Builds mit Gradle
Moderne Android Builds mit Gradle
 
Gradle presentation
Gradle presentationGradle presentation
Gradle presentation
 
Hands on the gradle
Hands on the gradleHands on the gradle
Hands on the gradle
 
Mastering the NDK with Android Studio 2.0 and the gradle-experimental plugin
Mastering the NDK with Android Studio 2.0 and the gradle-experimental pluginMastering the NDK with Android Studio 2.0 and the gradle-experimental plugin
Mastering the NDK with Android Studio 2.0 and the gradle-experimental plugin
 
An Introduction To Android
An Introduction To AndroidAn Introduction To Android
An Introduction To Android
 
Auf Augenhöhe mit Android Studio und Gradle
Auf Augenhöhe mit Android Studio und GradleAuf Augenhöhe mit Android Studio und Gradle
Auf Augenhöhe mit Android Studio und Gradle
 
Android Studio und gradle
Android Studio und gradleAndroid Studio und gradle
Android Studio und gradle
 
20170321 docker with Visual Studio 2017
20170321 docker with Visual Studio 201720170321 docker with Visual Studio 2017
20170321 docker with Visual Studio 2017
 
Hacking the Codename One Source Code - Part IV - Transcript.pdf
Hacking the Codename One Source Code - Part IV - Transcript.pdfHacking the Codename One Source Code - Part IV - Transcript.pdf
Hacking the Codename One Source Code - Part IV - Transcript.pdf
 
iOS App Using cordova
iOS App Using cordovaiOS App Using cordova
iOS App Using cordova
 
Android Introduction
Android IntroductionAndroid Introduction
Android Introduction
 
Getting Started with Android - OSSPAC 2009
Getting Started with Android - OSSPAC 2009Getting Started with Android - OSSPAC 2009
Getting Started with Android - OSSPAC 2009
 
Android gradle-build-system-overview
Android gradle-build-system-overviewAndroid gradle-build-system-overview
Android gradle-build-system-overview
 
Level Up Your Android Build -Droidcon Berlin 2015
Level Up Your Android Build -Droidcon Berlin 2015Level Up Your Android Build -Droidcon Berlin 2015
Level Up Your Android Build -Droidcon Berlin 2015
 
Cross-Platform Development using Angulr JS in Visual Studio
Cross-Platform Development using Angulr JS in Visual StudioCross-Platform Development using Angulr JS in Visual Studio
Cross-Platform Development using Angulr JS in Visual Studio
 
Android, Gradle & Dependecies
Android, Gradle & DependeciesAndroid, Gradle & Dependecies
Android, Gradle & Dependecies
 
Jakarta js meetup kudo
Jakarta js meetup kudoJakarta js meetup kudo
Jakarta js meetup kudo
 
DevAssistant, Docker and You
DevAssistant, Docker and YouDevAssistant, Docker and You
DevAssistant, Docker and You
 
ID Android TechTalk Series #6 : Google Service and Gradle - Anton Nurdin Tuha...
ID Android TechTalk Series #6 : Google Service and Gradle - Anton Nurdin Tuha...ID Android TechTalk Series #6 : Google Service and Gradle - Anton Nurdin Tuha...
ID Android TechTalk Series #6 : Google Service and Gradle - Anton Nurdin Tuha...
 
Exploring the power of Gradle in android studio - Basics & Beyond
Exploring the power of Gradle in android studio - Basics & BeyondExploring the power of Gradle in android studio - Basics & Beyond
Exploring the power of Gradle in android studio - Basics & Beyond
 

Último

Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceanilsa9823
 

Último (20)

Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
 

Intro to Gradle + How to get up to speed

  • 1. Reid Baker Gradle + Android What it is + How to get up to speed
  • 2. 01 What is Gradle? ✤ Build system! ✤ Language independent! ✤ Flexible dependency management ! ✤ Built on Groovy! ✤ Future of android development
  • 3. Why should you use Gradle? ✤ Easy setup with Gradle wrapper ! ✤ Make builds faster! ✤ Separate editor and compiler! ✤ More control over your builds! ✤ Control build tools versions! ✤ Change properties! ✤ Manage dependencies
  • 4. GradleWrapper ✤ No installation of gradle is needed after setting up ! ✤ Sets your version of gradle and where to look for it! ✤ Works for *NIX and Windows! ✤ ./gradlew tasks will list what you can do
  • 5. Faster you say? ✤ Incremental builds! ✤ Avoid work you don’t need easily ex. only lint debug builds and proguard release builds! ✤ Set flags in settings.gradle to make gradle faster
 org.gradle.daemon=true
  • 6. Freedom to update ✤ IDE updates can’t break the build! ✤ Android tool updates can’t break the build! ✤ install<buildtype> will assemble your apk and install it to the connected device! ✤ Dependencies are stored locally in the build directory
  • 7. It is all about control buildscript { repositories { mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:0.10.+' } } apply plugin: ‘android’ ! repositories { maven { url “https://maven.vpn.etonreve.com/repo” } } ! //Where should I find the android tools //What version of the android tools ! //Tell gradle to we want to use the android plugin ! //Where are the android dependancies located
  • 8. Control over your apk android { compileSdkVersion 17 buildToolsVersion "19.0.1" ! sourceSets.main { java.srcDirs = ['src'] res.srcDirs = ['res'] manifest.srcFile ‘AndroidManifest.xml’ } ! buildTypes { debug { debuggable true //unnecessary packageNameSuffix '.dev' if (someVariable) { signingConfig signingConfigs.release } } <Other release types> } }
  • 9. Dependency management dependencies { compile project(“:libraries:skitchkit-android") ! compile ‘com.android.support:support-v4:19.0.+’ ! compile ('com.actionbarsherlock:actionbarsherlock:4.4.0@aar') { exclude group: 'com.android.support', module: 'support-v4' } ! compile files('/Users/rbaker/dev/google-play-services.jar') ! provided 'com.google.android.maps:maps:16_r2' }
  • 10. BuildTypes and BuildFlavors Release Types! ✤ Ex. Debug, Beta, Release! ✤ Change package! ✤ Change signing key Build flavors! ✤ Ex. Architecture, 
 Free/Premium
 Branding! ✤ Can be grouped ! ✤ Can have different src and res directories
  • 11. Lets look at a real build file
  • 12. Tips andTricks ✤ ./gradlew uninstall[flavor] will uninstall the previous version! ✤ Shorten commands with camel case ex.
 ./gradlew installAllArchEvernoteDebug
 ./gradlew iAAED! ! ! ✤ Handy command line arguments
 --offline flag while building to not go to the server 
 --refresh-dependencies to tell Gradle to fetch all new dependencies ! ✤ Dependencies are cached for 24 hours but you can change how long
 configurations.all {
 resolutionStrategy.cacheDynamicVersionsFor 4, ‘hours’
 }! ! ✤ .aar file is a zip. you can unzip it to see what’s inside.! ! ✤ Install the groovy shell to quickly verify that your groovy does what it is supposed to!
  • 13. Additional Resources ✤ Start by watching this Google IO talk: http:// www.youtube.com/watch?v=LCJAgPkpmR0! ✤ Get up to speed with Groovy: http://groovy.codehaus.org/ Groovy+style+and+language+feature+guidelines+for+Java +developers! ✤ Get up to speed with Gradle: http://fbflex.wordpress.com/ 2013/05/01/12-new-things-i-learned-from-a-three-day- gradle-training/! ✤ More info about resource merging  http://tools.android.com/ tech-docs/new-build-system/resource-merging
  • 14. Thanks for coming Follow me on twitter @reidbaker