SlideShare ist ein Scribd-Unternehmen logo
1 von 14
Downloaden Sie, um offline zu lesen
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

Weitere ähnliche Inhalte

Was ist angesagt?

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
 

Was ist angesagt? (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
 

Ähnlich wie 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
 

Ähnlich wie 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
 

Kürzlich hochgeladen

Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
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
 
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
 
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
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
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
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
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
 
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.
 
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
 
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
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
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
 
+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 Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 

Kürzlich hochgeladen (20)

Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
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 ...
 
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
 
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
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
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
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
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
 
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...
 
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
 
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
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
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
 
+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 Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
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
 
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
 

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