SlideShare ist ein Scribd-Unternehmen logo
1 von 30
Downloaden Sie, um offline zu lesen
BUILDING ANDROID APPSBUILDING ANDROID APPS
WITH GRADLEWITH GRADLE
GREACH 2015, Madrid
René Gröschke
Principal Engineer Gradleware
INTRO, DEMO & FORECASTINTRO, DEMO & FORECAST
WHY A NEW BUILDWHY A NEW BUILD
SYSTEM?SYSTEM?
GRADLE 2.3GRADLE 2.3
RELEASED 16TH FEBRUARY 2015RELEASED 16TH FEBRUARY 2015
OLD ANDROID BUILDSOLD ANDROID BUILDS
Two (official) build mechanism
ADT (Eclipse based)
Ant
Maven
Customization?
Nothing in ADT
Manually hacking xml in ant scripts
REQUIREMENTS OF THEREQUIREMENTS OF THE
NEW BUILD SYSTEMNEW BUILD SYSTEM
Use same system for
CommandLine
CI Server
IDE
Support for application/library variants
Dependency Management
Provide a plugin ecosystem
WHY GRADLEWHY GRADLE
Allows custom DSL to express build logic
Very flexible for customization
Well integrated with CI ecosystem (Ant, Maven, Ivy, CI
server)
Allow User / 3Party tools to configure, extend and
customize the build process
Tooling API for IDE integration
...
GRADLE IN A NUTSHELLGRADLE IN A NUTSHELL
apply plugin:'java'
version = file("version.txt").text
task helloWorld << {
println "Hello World - version '$version'!"
}
THE ANDROID GRADLE PLUGINTHE ANDROID GRADLE PLUGIN
MINIMAL ANDROID BUILDMINIMAL ANDROID BUILD
plugins {
id 'com.android.application' version '1.1.+'
}
android {
compileSdkVersion 22
buildToolsVersion '22.0.1'
}
>gradle check assemble
>gradle build
THE ANDROID GRADLE PLUGINTHE ANDROID GRADLE PLUGIN
BASIC BUILD CUSTOMIZATIONBASIC BUILD CUSTOMIZATION
android {
compileSdkVersion 22
buildToolsVersion '22.0.1'
defaultConfig {
versionCode 12
versionName "2.0"
minSdkVersion 19
targetSdkVersion 22
multiDexEnabled = true
}
}
THE ANDROID GRADLE PLUGINTHE ANDROID GRADLE PLUGIN
REMEMBER, IT'S GROOVY!REMEMBER, IT'S GROOVY!
def calculateVersionName() {
...
}
android {
compileSdkVersion 22
buildToolsVersion '22.0.1'
defaultConfig {
versionName calculateVersionName()
}
}
BUILD TYPESBUILD TYPES
"controls how an app is built"
Customize app parameters
debuggable flag
native debug compilation flag
package suffix
debug signing
proguard options
2 default types (debug + release)
Source code + resources overlay
Custom dependencies
PRODUCT FLAVORSPRODUCT FLAVORS
"a way to generate several versions of the same app"
Customize app parameters
package name
min/targetSdkVersion
versionCodeName
signing info
Source code + resources overlay
Custom dependencies
BUILD VARIANTSBUILD VARIANTS
"a variant is always a flavor + a type"
debug release
free free-debug free-release
payed payed-debug payed-release
BUILD VARIANTS IIBUILD VARIANTS II
PRODUCT FLAVOR GROUPSPRODUCT FLAVOR GROUPS
debug release
free x86 free-x86-debug free-x86-release
ARM free-ARM-debug free-ARM-release
payed x86 payed-x86-debug payed-x86-release
ARM payed-ARM-debug payed-ARM-release
FLAVOR GROUPSFLAVOR GROUPS
flavorDimensions "group1", "group2"
productFlavors {
arm {
flavorDimension "group1"
}
x86 {
flavorDimension "group1"
}
free {
flavorDimension "group2"
}
pro {
flavorDimension "group2"
}
}
SOURCE CODE + RESOURCES OVERLAYSOURCE CODE + RESOURCES OVERLAY
~/dev/androidApp/src>tree
|____main
| |____java
| |____res
|____androidTest
| |____java
| |____res
|____free
| |____java
| |____res
|____debug
| |____java
~/dev/androidApp/src>
Build Type > Product Flavor > main
DEMO IDEMO I
VARIANTS IN ACTIONVARIANTS IN ACTION
BUILD CUSTOMIZATION IBUILD CUSTOMIZATION I
DEX CONFIGURATIONDEX CONFIGURATION
android {
dexOptions {
incremental true
preDexLibraries = false
jumboMode = false
}
}
BUILD CUSTOMIZATION IIBUILD CUSTOMIZATION II
AAPT CONFIGURATIONAAPT CONFIGURATION
android {
aaptOptions {
noCompress 'foo', 'bar'
ignoreAssetsPattern "!.svn:!.git:!.ds_store:!*.scc"
}
}
BUILD CUSTOMIZATION IIIBUILD CUSTOMIZATION III
AND MOREAND MORE
lint
java compile options
proguard
DEMO IIDEMO II
MANIPULATING TASKSMANIPULATING TASKS
TESTINGTESTING
no separate test project needed
variant aware tests
run against (all) connected devices
experimental unit test support (android build tools 1.1)
android {
// ...
testOptions {
unitTests.returnDefaultValues = true
}
}
PLENTY OF MORE THINGSPLENTY OF MORE THINGS
android libraries (aar)
vivid plugin ecosystem
crashlytics
roboelectrics
testfairy
instabug
...
UNDER CONSTRUCTIONUNDER CONSTRUCTION
NDK support
variant aware dependency management
significant performance improvements
LINKS AND POINTERSLINKS AND POINTERS
http://tools.android.com/tech-docs/new-build-
system/user-guide
https://groups.google.com/forum/#!forum/adt-dev
gradle.org
gradleware.com
https://github.com/breskeby/android-demo-app
Q&AQ&A
¡MUCHAS¡MUCHAS
GRACIAS!GRACIAS!
! @breskeby
" github.com/breskeby
# rene.groeschke@gradleware.com

Weitere ähnliche Inhalte

Was ist angesagt?

OpenShift: Devops Made Easy
OpenShift: Devops Made EasyOpenShift: Devops Made Easy
OpenShift: Devops Made EasyBent Terp
 
Android 101 - Introduction to Android Development
Android 101 - Introduction to Android DevelopmentAndroid 101 - Introduction to Android Development
Android 101 - Introduction to Android DevelopmentAndy Scherzinger
 
Cloud Native Testing, 2020 Edition: A Modern Blueprint for Pre-production Tes...
Cloud Native Testing, 2020 Edition: A Modern Blueprint for Pre-production Tes...Cloud Native Testing, 2020 Edition: A Modern Blueprint for Pre-production Tes...
Cloud Native Testing, 2020 Edition: A Modern Blueprint for Pre-production Tes...OlyaSurits
 
Nextcloud Android Development Process
Nextcloud Android Development ProcessNextcloud Android Development Process
Nextcloud Android Development ProcessAndy Scherzinger
 
Exploring the GitHub Service Universe
Exploring the GitHub Service UniverseExploring the GitHub Service Universe
Exploring the GitHub Service UniverseBjörn Kimminich
 
Android studio&Gradle&Autotest
Android studio&Gradle&AutotestAndroid studio&Gradle&Autotest
Android studio&Gradle&Autotest毅 方
 
Introduction of Android Architecture
Introduction of Android ArchitectureIntroduction of Android Architecture
Introduction of Android ArchitectureBin Yang
 
An Introduction to Eclipse Che - Next-Gen Eclipse Java IDE
An Introduction to Eclipse Che - Next-Gen Eclipse Java IDEAn Introduction to Eclipse Che - Next-Gen Eclipse Java IDE
An Introduction to Eclipse Che - Next-Gen Eclipse Java IDEKubeAcademy
 
Eclipse Che : ParisJUG
Eclipse Che : ParisJUGEclipse Che : ParisJUG
Eclipse Che : ParisJUGFlorent BENOIT
 
Introduction to Eclipse Che / EclipseCon 2014
Introduction to Eclipse Che / EclipseCon 2014Introduction to Eclipse Che / EclipseCon 2014
Introduction to Eclipse Che / EclipseCon 2014Florent BENOIT
 
Professional iOS development
Professional iOS developmentProfessional iOS development
Professional iOS developmentAline Borges
 
NASA Space Apps
NASA Space AppsNASA Space Apps
NASA Space AppsJoe Kutner
 
Auckland Docker Meetup (July 2015) - DockerCon2015 lightningtalk
Auckland Docker Meetup (July 2015) - DockerCon2015 lightningtalkAuckland Docker Meetup (July 2015) - DockerCon2015 lightningtalk
Auckland Docker Meetup (July 2015) - DockerCon2015 lightningtalkPeter Sellars
 
NASA Space Apps Expo
NASA Space Apps ExpoNASA Space Apps Expo
NASA Space Apps ExpoJoe Kutner
 
Eclipse Che - A Revolutionary IDE for Distributed & Mainframe Development
Eclipse Che - A Revolutionary IDE for Distributed & Mainframe DevelopmentEclipse Che - A Revolutionary IDE for Distributed & Mainframe Development
Eclipse Che - A Revolutionary IDE for Distributed & Mainframe DevelopmentDevOps.com
 
Arduino - Android Workshop Presentation
Arduino - Android Workshop PresentationArduino - Android Workshop Presentation
Arduino - Android Workshop PresentationHem Shrestha
 

Was ist angesagt? (20)

OpenShift: Devops Made Easy
OpenShift: Devops Made EasyOpenShift: Devops Made Easy
OpenShift: Devops Made Easy
 
Android 101 - Introduction to Android Development
Android 101 - Introduction to Android DevelopmentAndroid 101 - Introduction to Android Development
Android 101 - Introduction to Android Development
 
Cloud Native Testing, 2020 Edition: A Modern Blueprint for Pre-production Tes...
Cloud Native Testing, 2020 Edition: A Modern Blueprint for Pre-production Tes...Cloud Native Testing, 2020 Edition: A Modern Blueprint for Pre-production Tes...
Cloud Native Testing, 2020 Edition: A Modern Blueprint for Pre-production Tes...
 
Xiaojing_Gong
Xiaojing_GongXiaojing_Gong
Xiaojing_Gong
 
CASCON 2017 - OpenAPI v3
CASCON 2017 - OpenAPI v3CASCON 2017 - OpenAPI v3
CASCON 2017 - OpenAPI v3
 
Nextcloud Android Development Process
Nextcloud Android Development ProcessNextcloud Android Development Process
Nextcloud Android Development Process
 
Exploring the GitHub Service Universe
Exploring the GitHub Service UniverseExploring the GitHub Service Universe
Exploring the GitHub Service Universe
 
Android
AndroidAndroid
Android
 
Android studio&Gradle&Autotest
Android studio&Gradle&AutotestAndroid studio&Gradle&Autotest
Android studio&Gradle&Autotest
 
Introduction of Android Architecture
Introduction of Android ArchitectureIntroduction of Android Architecture
Introduction of Android Architecture
 
An Introduction to Eclipse Che - Next-Gen Eclipse Java IDE
An Introduction to Eclipse Che - Next-Gen Eclipse Java IDEAn Introduction to Eclipse Che - Next-Gen Eclipse Java IDE
An Introduction to Eclipse Che - Next-Gen Eclipse Java IDE
 
Eclipse Che : ParisJUG
Eclipse Che : ParisJUGEclipse Che : ParisJUG
Eclipse Che : ParisJUG
 
Introduction to Eclipse Che / EclipseCon 2014
Introduction to Eclipse Che / EclipseCon 2014Introduction to Eclipse Che / EclipseCon 2014
Introduction to Eclipse Che / EclipseCon 2014
 
Professional iOS development
Professional iOS developmentProfessional iOS development
Professional iOS development
 
NASA Space Apps
NASA Space AppsNASA Space Apps
NASA Space Apps
 
Auckland Docker Meetup (July 2015) - DockerCon2015 lightningtalk
Auckland Docker Meetup (July 2015) - DockerCon2015 lightningtalkAuckland Docker Meetup (July 2015) - DockerCon2015 lightningtalk
Auckland Docker Meetup (July 2015) - DockerCon2015 lightningtalk
 
Automating the Quality
Automating the QualityAutomating the Quality
Automating the Quality
 
NASA Space Apps Expo
NASA Space Apps ExpoNASA Space Apps Expo
NASA Space Apps Expo
 
Eclipse Che - A Revolutionary IDE for Distributed & Mainframe Development
Eclipse Che - A Revolutionary IDE for Distributed & Mainframe DevelopmentEclipse Che - A Revolutionary IDE for Distributed & Mainframe Development
Eclipse Che - A Revolutionary IDE for Distributed & Mainframe Development
 
Arduino - Android Workshop Presentation
Arduino - Android Workshop PresentationArduino - Android Workshop Presentation
Arduino - Android Workshop Presentation
 

Ähnlich wie Building android apps with Gradle (GREACH 2015)

lecture-2-android-dev.pdf
lecture-2-android-dev.pdflecture-2-android-dev.pdf
lecture-2-android-dev.pdfjakjak36
 
Android Studio簡介
Android Studio簡介Android Studio簡介
Android Studio簡介Walter Shi
 
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
 
Accessing Hardware on Android
Accessing Hardware on AndroidAccessing Hardware on Android
Accessing Hardware on AndroidGary Bisson
 
Student Developer Kit for Developing Applications
Student Developer Kit for Developing ApplicationsStudent Developer Kit for Developing Applications
Student Developer Kit for Developing ApplicationsSohailPathan28
 
SynapseIndia mobile apps deployment framework architecture
SynapseIndia mobile apps deployment framework architectureSynapseIndia mobile apps deployment framework architecture
SynapseIndia mobile apps deployment framework architectureSynapseindiappsdevelopment
 
Gradle-based Android Build System
Gradle-based Android Build SystemGradle-based Android Build System
Gradle-based Android Build Systemmoallemi
 
AWS Summit Singapore 2019 | Latest Trends for Cloud-Native Application Develo...
AWS Summit Singapore 2019 | Latest Trends for Cloud-Native Application Develo...AWS Summit Singapore 2019 | Latest Trends for Cloud-Native Application Develo...
AWS Summit Singapore 2019 | Latest Trends for Cloud-Native Application Develo...AWS Summits
 
WSO2Con US 2013 - Keynote: Developing Enterprise Apps In the Cloud
WSO2Con US 2013 - Keynote: Developing Enterprise Apps In the CloudWSO2Con US 2013 - Keynote: Developing Enterprise Apps In the Cloud
WSO2Con US 2013 - Keynote: Developing Enterprise Apps In the CloudWSO2
 
Gerrit linuxtag2011
Gerrit linuxtag2011Gerrit linuxtag2011
Gerrit linuxtag2011thkoch
 
PowerShell Inside Out: Applied .NET Hacking for Enhanced Visibility by Satosh...
PowerShell Inside Out: Applied .NET Hacking for Enhanced Visibility by Satosh...PowerShell Inside Out: Applied .NET Hacking for Enhanced Visibility by Satosh...
PowerShell Inside Out: Applied .NET Hacking for Enhanced Visibility by Satosh...CODE BLUE
 
Microsoft Tech Summit Switzerland 2019 - DOCKER + AZURE DEVOPS + KUBERNETES = ♥
Microsoft Tech Summit Switzerland 2019 - DOCKER + AZURE DEVOPS + KUBERNETES = ♥Microsoft Tech Summit Switzerland 2019 - DOCKER + AZURE DEVOPS + KUBERNETES = ♥
Microsoft Tech Summit Switzerland 2019 - DOCKER + AZURE DEVOPS + KUBERNETES = ♥Marc Müller
 
Android 110521210945-phpapp01
Android 110521210945-phpapp01Android 110521210945-phpapp01
Android 110521210945-phpapp01Mona AlRekabi
 
Getting started with the NDK
Getting started with the NDKGetting started with the NDK
Getting started with the NDKKirill Kounik
 
ANODE – Continuous Deployment with Node.js over Azure, Yosef Dinerstein
ANODE – Continuous Deployment with Node.js over Azure, Yosef DinersteinANODE – Continuous Deployment with Node.js over Azure, Yosef Dinerstein
ANODE – Continuous Deployment with Node.js over Azure, Yosef DinersteinDevOpsDays Tel Aviv
 

Ähnlich wie Building android apps with Gradle (GREACH 2015) (20)

lecture-2-android-dev.pdf
lecture-2-android-dev.pdflecture-2-android-dev.pdf
lecture-2-android-dev.pdf
 
Android
Android Android
Android
 
Android Studio簡介
Android Studio簡介Android Studio簡介
Android Studio簡介
 
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...
 
Accessing Hardware on Android
Accessing Hardware on AndroidAccessing Hardware on Android
Accessing Hardware on Android
 
Student Developer Kit for Developing Applications
Student Developer Kit for Developing ApplicationsStudent Developer Kit for Developing Applications
Student Developer Kit for Developing Applications
 
SynapseIndia mobile apps deployment framework architecture
SynapseIndia mobile apps deployment framework architectureSynapseIndia mobile apps deployment framework architecture
SynapseIndia mobile apps deployment framework architecture
 
Gradle-based Android Build System
Gradle-based Android Build SystemGradle-based Android Build System
Gradle-based Android Build System
 
Arm
ArmArm
Arm
 
AWS Summit Singapore 2019 | Latest Trends for Cloud-Native Application Develo...
AWS Summit Singapore 2019 | Latest Trends for Cloud-Native Application Develo...AWS Summit Singapore 2019 | Latest Trends for Cloud-Native Application Develo...
AWS Summit Singapore 2019 | Latest Trends for Cloud-Native Application Develo...
 
WSO2Con US 2013 - Keynote: Developing Enterprise Apps In the Cloud
WSO2Con US 2013 - Keynote: Developing Enterprise Apps In the CloudWSO2Con US 2013 - Keynote: Developing Enterprise Apps In the Cloud
WSO2Con US 2013 - Keynote: Developing Enterprise Apps In the Cloud
 
Dockercon 2018 EU Updates
Dockercon 2018 EU Updates Dockercon 2018 EU Updates
Dockercon 2018 EU Updates
 
Gerrit linuxtag2011
Gerrit linuxtag2011Gerrit linuxtag2011
Gerrit linuxtag2011
 
PowerShell Inside Out: Applied .NET Hacking for Enhanced Visibility by Satosh...
PowerShell Inside Out: Applied .NET Hacking for Enhanced Visibility by Satosh...PowerShell Inside Out: Applied .NET Hacking for Enhanced Visibility by Satosh...
PowerShell Inside Out: Applied .NET Hacking for Enhanced Visibility by Satosh...
 
Microsoft Tech Summit Switzerland 2019 - DOCKER + AZURE DEVOPS + KUBERNETES = ♥
Microsoft Tech Summit Switzerland 2019 - DOCKER + AZURE DEVOPS + KUBERNETES = ♥Microsoft Tech Summit Switzerland 2019 - DOCKER + AZURE DEVOPS + KUBERNETES = ♥
Microsoft Tech Summit Switzerland 2019 - DOCKER + AZURE DEVOPS + KUBERNETES = ♥
 
Android 110521210945-phpapp01
Android 110521210945-phpapp01Android 110521210945-phpapp01
Android 110521210945-phpapp01
 
Demystifying Docker101
Demystifying Docker101Demystifying Docker101
Demystifying Docker101
 
Demystifying Docker
Demystifying DockerDemystifying Docker
Demystifying Docker
 
Getting started with the NDK
Getting started with the NDKGetting started with the NDK
Getting started with the NDK
 
ANODE – Continuous Deployment with Node.js over Azure, Yosef Dinerstein
ANODE – Continuous Deployment with Node.js over Azure, Yosef DinersteinANODE – Continuous Deployment with Node.js over Azure, Yosef Dinerstein
ANODE – Continuous Deployment with Node.js over Azure, Yosef Dinerstein
 

Kürzlich hochgeladen

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.
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
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
 
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
 
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
 
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
 
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
 
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
 
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
 
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
 
+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
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
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
 
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
 
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.
 

Kürzlich hochgeladen (20)

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 ...
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
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
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
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
 
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...
 
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...
 
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
 
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
 
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
 
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
 
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
 
+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...
 
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
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
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
 
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
 
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...
 

Building android apps with Gradle (GREACH 2015)

  • 1.
  • 2. BUILDING ANDROID APPSBUILDING ANDROID APPS WITH GRADLEWITH GRADLE GREACH 2015, Madrid René Gröschke Principal Engineer Gradleware
  • 3. INTRO, DEMO & FORECASTINTRO, DEMO & FORECAST
  • 4. WHY A NEW BUILDWHY A NEW BUILD SYSTEM?SYSTEM?
  • 5. GRADLE 2.3GRADLE 2.3 RELEASED 16TH FEBRUARY 2015RELEASED 16TH FEBRUARY 2015
  • 6. OLD ANDROID BUILDSOLD ANDROID BUILDS Two (official) build mechanism ADT (Eclipse based) Ant Maven Customization? Nothing in ADT Manually hacking xml in ant scripts
  • 7. REQUIREMENTS OF THEREQUIREMENTS OF THE NEW BUILD SYSTEMNEW BUILD SYSTEM Use same system for CommandLine CI Server IDE Support for application/library variants Dependency Management Provide a plugin ecosystem
  • 8. WHY GRADLEWHY GRADLE Allows custom DSL to express build logic Very flexible for customization Well integrated with CI ecosystem (Ant, Maven, Ivy, CI server) Allow User / 3Party tools to configure, extend and customize the build process Tooling API for IDE integration ...
  • 9. GRADLE IN A NUTSHELLGRADLE IN A NUTSHELL apply plugin:'java' version = file("version.txt").text task helloWorld << { println "Hello World - version '$version'!" }
  • 10. THE ANDROID GRADLE PLUGINTHE ANDROID GRADLE PLUGIN MINIMAL ANDROID BUILDMINIMAL ANDROID BUILD plugins { id 'com.android.application' version '1.1.+' } android { compileSdkVersion 22 buildToolsVersion '22.0.1' } >gradle check assemble >gradle build
  • 11. THE ANDROID GRADLE PLUGINTHE ANDROID GRADLE PLUGIN BASIC BUILD CUSTOMIZATIONBASIC BUILD CUSTOMIZATION android { compileSdkVersion 22 buildToolsVersion '22.0.1' defaultConfig { versionCode 12 versionName "2.0" minSdkVersion 19 targetSdkVersion 22 multiDexEnabled = true } }
  • 12. THE ANDROID GRADLE PLUGINTHE ANDROID GRADLE PLUGIN REMEMBER, IT'S GROOVY!REMEMBER, IT'S GROOVY! def calculateVersionName() { ... } android { compileSdkVersion 22 buildToolsVersion '22.0.1' defaultConfig { versionName calculateVersionName() } }
  • 13. BUILD TYPESBUILD TYPES "controls how an app is built" Customize app parameters debuggable flag native debug compilation flag package suffix debug signing proguard options 2 default types (debug + release) Source code + resources overlay Custom dependencies
  • 14. PRODUCT FLAVORSPRODUCT FLAVORS "a way to generate several versions of the same app" Customize app parameters package name min/targetSdkVersion versionCodeName signing info Source code + resources overlay Custom dependencies
  • 15. BUILD VARIANTSBUILD VARIANTS "a variant is always a flavor + a type" debug release free free-debug free-release payed payed-debug payed-release
  • 16. BUILD VARIANTS IIBUILD VARIANTS II PRODUCT FLAVOR GROUPSPRODUCT FLAVOR GROUPS debug release free x86 free-x86-debug free-x86-release ARM free-ARM-debug free-ARM-release payed x86 payed-x86-debug payed-x86-release ARM payed-ARM-debug payed-ARM-release
  • 17. FLAVOR GROUPSFLAVOR GROUPS flavorDimensions "group1", "group2" productFlavors { arm { flavorDimension "group1" } x86 { flavorDimension "group1" } free { flavorDimension "group2" } pro { flavorDimension "group2" } }
  • 18. SOURCE CODE + RESOURCES OVERLAYSOURCE CODE + RESOURCES OVERLAY ~/dev/androidApp/src>tree |____main | |____java | |____res |____androidTest | |____java | |____res |____free | |____java | |____res |____debug | |____java ~/dev/androidApp/src> Build Type > Product Flavor > main
  • 19. DEMO IDEMO I VARIANTS IN ACTIONVARIANTS IN ACTION
  • 20. BUILD CUSTOMIZATION IBUILD CUSTOMIZATION I DEX CONFIGURATIONDEX CONFIGURATION android { dexOptions { incremental true preDexLibraries = false jumboMode = false } }
  • 21. BUILD CUSTOMIZATION IIBUILD CUSTOMIZATION II AAPT CONFIGURATIONAAPT CONFIGURATION android { aaptOptions { noCompress 'foo', 'bar' ignoreAssetsPattern "!.svn:!.git:!.ds_store:!*.scc" } }
  • 22. BUILD CUSTOMIZATION IIIBUILD CUSTOMIZATION III AND MOREAND MORE lint java compile options proguard
  • 23. DEMO IIDEMO II MANIPULATING TASKSMANIPULATING TASKS
  • 24. TESTINGTESTING no separate test project needed variant aware tests run against (all) connected devices experimental unit test support (android build tools 1.1) android { // ... testOptions { unitTests.returnDefaultValues = true } }
  • 25. PLENTY OF MORE THINGSPLENTY OF MORE THINGS android libraries (aar) vivid plugin ecosystem crashlytics roboelectrics testfairy instabug ...
  • 26. UNDER CONSTRUCTIONUNDER CONSTRUCTION NDK support variant aware dependency management significant performance improvements
  • 27. LINKS AND POINTERSLINKS AND POINTERS http://tools.android.com/tech-docs/new-build- system/user-guide https://groups.google.com/forum/#!forum/adt-dev gradle.org gradleware.com https://github.com/breskeby/android-demo-app
  • 29.