Submit Search
Upload
Gradle Android Build System Guide
•
0 likes
•
606 views
AI-enhanced title
D
Dicoding
Follow
ID Android TechTalk Series #6 : Google Service and Gradle - Anton Nurdin Tuhadiansyah
Read less
Read more
Technology
Slideshow view
Report
Share
Slideshow view
Report
Share
1 of 60
Download now
Download to read offline
Recommended
I/O Extended (GDG Bogor) - Andrew Kurniadi
I/O Extended (GDG Bogor) - Andrew Kurniadi
Dicoding
High Performance NodeJS
High Performance NodeJS
Dicoding
Gradle presentation
Gradle presentation
Oriol Jiménez
Gradle,the new build system for android
Gradle,the new build system for android
zhang ghui
Gradle
Gradle
Return on Intelligence
Android presentation - Gradle ++
Android presentation - Gradle ++
Javier de Pedro López
Gradle by Example
Gradle by Example
Eric Wendelin
Gradle 3.0: Unleash the Daemon!
Gradle 3.0: Unleash the Daemon!
Eric Wendelin
Recommended
I/O Extended (GDG Bogor) - Andrew Kurniadi
I/O Extended (GDG Bogor) - Andrew Kurniadi
Dicoding
High Performance NodeJS
High Performance NodeJS
Dicoding
Gradle presentation
Gradle presentation
Oriol Jiménez
Gradle,the new build system for android
Gradle,the new build system for android
zhang ghui
Gradle
Gradle
Return on Intelligence
Android presentation - Gradle ++
Android presentation - Gradle ++
Javier de Pedro López
Gradle by Example
Gradle by Example
Eric Wendelin
Gradle 3.0: Unleash the Daemon!
Gradle 3.0: Unleash the Daemon!
Eric Wendelin
How to create an Angular builder
How to create an Angular builder
Maurizio Vitale
Gradle : An introduction
Gradle : An introduction
Nibodha Technologies
PuppetConf 2016: Docker, Mesos, Kubernetes and...Puppet? Don't Panic! – Deep...
PuppetConf 2016: Docker, Mesos, Kubernetes and...Puppet? Don't Panic! – Deep...
Puppet
PROMAND 2014 project structure
PROMAND 2014 project structure
Alexey Buzdin
Introduction to Kubernetes with demo
Introduction to Kubernetes with demo
Opsta
Gradle - time for a new build
Gradle - time for a new build
Igor Khotin
Gradle - the Enterprise Automation Tool
Gradle - the Enterprise Automation Tool
Izzet Mustafaiev
Android Jetpack + Coroutines: To infinity and beyond
Android Jetpack + Coroutines: To infinity and beyond
Ramon Ribeiro Rabello
Vue.js Use Cases
Vue.js Use Cases
GlobalLogic Ukraine
[Image Results] Java Build Tools: Part 2 - A Decision Maker's Guide Compariso...
[Image Results] Java Build Tools: Part 2 - A Decision Maker's Guide Compariso...
ZeroTurnaround
How we can do Multi-Tenancy on Kubernetes
How we can do Multi-Tenancy on Kubernetes
Opsta
Making the Most of Your Gradle Builds
Making the Most of Your Gradle Builds
Egor Andreevich
React nativebeginner1
React nativebeginner1
Oswald Campesato
Griffon: Re-imaging Desktop Java Technology
Griffon: Re-imaging Desktop Java Technology
James Williams
Overview of Android Infrastructure
Overview of Android Infrastructure
Alexey Buzdin
An Introduction to Gradle for Java Developers
An Introduction to Gradle for Java Developers
Kostas Saidis
Gradle Introduction
Gradle Introduction
Dmitry Buzdin
Introduction to gradle
Introduction to gradle
NexThoughts Technologies
Gradle
Gradle
Jadson Santos
Get Hip with JHipster - GIDS 2019
Get Hip with JHipster - GIDS 2019
Matt Raible
Continuous Integration & Continuous Delivery on Android - Nur Rendra Toro Sin...
Continuous Integration & Continuous Delivery on Android - Nur Rendra Toro Sin...
Dicoding
Talkshow - Android N & I/O Update
Talkshow - Android N & I/O Update
Dicoding
More Related Content
What's hot
How to create an Angular builder
How to create an Angular builder
Maurizio Vitale
Gradle : An introduction
Gradle : An introduction
Nibodha Technologies
PuppetConf 2016: Docker, Mesos, Kubernetes and...Puppet? Don't Panic! – Deep...
PuppetConf 2016: Docker, Mesos, Kubernetes and...Puppet? Don't Panic! – Deep...
Puppet
PROMAND 2014 project structure
PROMAND 2014 project structure
Alexey Buzdin
Introduction to Kubernetes with demo
Introduction to Kubernetes with demo
Opsta
Gradle - time for a new build
Gradle - time for a new build
Igor Khotin
Gradle - the Enterprise Automation Tool
Gradle - the Enterprise Automation Tool
Izzet Mustafaiev
Android Jetpack + Coroutines: To infinity and beyond
Android Jetpack + Coroutines: To infinity and beyond
Ramon Ribeiro Rabello
Vue.js Use Cases
Vue.js Use Cases
GlobalLogic Ukraine
[Image Results] Java Build Tools: Part 2 - A Decision Maker's Guide Compariso...
[Image Results] Java Build Tools: Part 2 - A Decision Maker's Guide Compariso...
ZeroTurnaround
How we can do Multi-Tenancy on Kubernetes
How we can do Multi-Tenancy on Kubernetes
Opsta
Making the Most of Your Gradle Builds
Making the Most of Your Gradle Builds
Egor Andreevich
React nativebeginner1
React nativebeginner1
Oswald Campesato
Griffon: Re-imaging Desktop Java Technology
Griffon: Re-imaging Desktop Java Technology
James Williams
Overview of Android Infrastructure
Overview of Android Infrastructure
Alexey Buzdin
An Introduction to Gradle for Java Developers
An Introduction to Gradle for Java Developers
Kostas Saidis
Gradle Introduction
Gradle Introduction
Dmitry Buzdin
Introduction to gradle
Introduction to gradle
NexThoughts Technologies
Gradle
Gradle
Jadson Santos
Get Hip with JHipster - GIDS 2019
Get Hip with JHipster - GIDS 2019
Matt Raible
What's hot
(20)
How to create an Angular builder
How to create an Angular builder
Gradle : An introduction
Gradle : An introduction
PuppetConf 2016: Docker, Mesos, Kubernetes and...Puppet? Don't Panic! – Deep...
PuppetConf 2016: Docker, Mesos, Kubernetes and...Puppet? Don't Panic! – Deep...
PROMAND 2014 project structure
PROMAND 2014 project structure
Introduction to Kubernetes with demo
Introduction to Kubernetes with demo
Gradle - time for a new build
Gradle - time for a new build
Gradle - the Enterprise Automation Tool
Gradle - the Enterprise Automation Tool
Android Jetpack + Coroutines: To infinity and beyond
Android Jetpack + Coroutines: To infinity and beyond
Vue.js Use Cases
Vue.js Use Cases
[Image Results] Java Build Tools: Part 2 - A Decision Maker's Guide Compariso...
[Image Results] Java Build Tools: Part 2 - A Decision Maker's Guide Compariso...
How we can do Multi-Tenancy on Kubernetes
How we can do Multi-Tenancy on Kubernetes
Making the Most of Your Gradle Builds
Making the Most of Your Gradle Builds
React nativebeginner1
React nativebeginner1
Griffon: Re-imaging Desktop Java Technology
Griffon: Re-imaging Desktop Java Technology
Overview of Android Infrastructure
Overview of Android Infrastructure
An Introduction to Gradle for Java Developers
An Introduction to Gradle for Java Developers
Gradle Introduction
Gradle Introduction
Introduction to gradle
Introduction to gradle
Gradle
Gradle
Get Hip with JHipster - GIDS 2019
Get Hip with JHipster - GIDS 2019
Viewers also liked
Continuous Integration & Continuous Delivery on Android - Nur Rendra Toro Sin...
Continuous Integration & Continuous Delivery on Android - Nur Rendra Toro Sin...
Dicoding
Talkshow - Android N & I/O Update
Talkshow - Android N & I/O Update
Dicoding
ID Android TechTalk Series #6 : Google Service and Gradle - Ibnu Sina Wardy
ID Android TechTalk Series #6 : Google Service and Gradle - Ibnu Sina Wardy
Dicoding
I/O Extended (GDG Bogor) - Narenda Wicaksono
I/O Extended (GDG Bogor) - Narenda Wicaksono
Dicoding
Menjadi Tuan Rumah di Negeri Sendiri - Fauzil Hamdi (CEO The Wali)
Menjadi Tuan Rumah di Negeri Sendiri - Fauzil Hamdi (CEO The Wali)
Dicoding
Produktif dalam Membangun Game - Adam Ardisasmita (Arsakids)
Produktif dalam Membangun Game - Adam Ardisasmita (Arsakids)
Dicoding
Mencari Genre Game yang Sesuai Passion - Cipto Adiguno (Ekuator Games)
Mencari Genre Game yang Sesuai Passion - Cipto Adiguno (Ekuator Games)
Dicoding
ID Android TechTalk Series #6 : Google Service and Gradle - Andrew Kurniadi
ID Android TechTalk Series #6 : Google Service and Gradle - Andrew Kurniadi
Dicoding
ID Developer Elite
ID Developer Elite
Dicoding
Sidiq Permana - Building For The Next Billion Users
Sidiq Permana - Building For The Next Billion Users
Dicoding
Yoza Aprilio - We must design
Yoza Aprilio - We must design
Dicoding
ID Android Dev Talk - Observer Pattern, Event Bus Usage, Firebase & Geofire
ID Android Dev Talk - Observer Pattern, Event Bus Usage, Firebase & Geofire
Dicoding
Agus Hamonangan - Sejarah Android, Penetrasi/Pertumbungan, dan Peluang Smartp...
Agus Hamonangan - Sejarah Android, Penetrasi/Pertumbungan, dan Peluang Smartp...
Dicoding
I/O Extended (GDG Bogor) - Sidiq Permana
I/O Extended (GDG Bogor) - Sidiq Permana
Dicoding
Agate Presentation at Gedebuk Coy!
Agate Presentation at Gedebuk Coy!
Gedebuk.org
Develop a Game - And interact with your Community | by Two Pi Team
Develop a Game - And interact with your Community | by Two Pi Team
Two Pi Team
About indonesia Game Industry - Agate Studio
About indonesia Game Industry - Agate Studio
Arief Widhiyasa
Indonesia Game Ecosystem Outlook 2017
Indonesia Game Ecosystem Outlook 2017
Ricky Setiawan
Rendra Toro - Model View Presenter
Rendra Toro - Model View Presenter
Dicoding
Introduction to Android - Seminar
Introduction to Android - Seminar
Akshay Sharma
Viewers also liked
(20)
Continuous Integration & Continuous Delivery on Android - Nur Rendra Toro Sin...
Continuous Integration & Continuous Delivery on Android - Nur Rendra Toro Sin...
Talkshow - Android N & I/O Update
Talkshow - Android N & I/O Update
ID Android TechTalk Series #6 : Google Service and Gradle - Ibnu Sina Wardy
ID Android TechTalk Series #6 : Google Service and Gradle - Ibnu Sina Wardy
I/O Extended (GDG Bogor) - Narenda Wicaksono
I/O Extended (GDG Bogor) - Narenda Wicaksono
Menjadi Tuan Rumah di Negeri Sendiri - Fauzil Hamdi (CEO The Wali)
Menjadi Tuan Rumah di Negeri Sendiri - Fauzil Hamdi (CEO The Wali)
Produktif dalam Membangun Game - Adam Ardisasmita (Arsakids)
Produktif dalam Membangun Game - Adam Ardisasmita (Arsakids)
Mencari Genre Game yang Sesuai Passion - Cipto Adiguno (Ekuator Games)
Mencari Genre Game yang Sesuai Passion - Cipto Adiguno (Ekuator Games)
ID Android TechTalk Series #6 : Google Service and Gradle - Andrew Kurniadi
ID Android TechTalk Series #6 : Google Service and Gradle - Andrew Kurniadi
ID Developer Elite
ID Developer Elite
Sidiq Permana - Building For The Next Billion Users
Sidiq Permana - Building For The Next Billion Users
Yoza Aprilio - We must design
Yoza Aprilio - We must design
ID Android Dev Talk - Observer Pattern, Event Bus Usage, Firebase & Geofire
ID Android Dev Talk - Observer Pattern, Event Bus Usage, Firebase & Geofire
Agus Hamonangan - Sejarah Android, Penetrasi/Pertumbungan, dan Peluang Smartp...
Agus Hamonangan - Sejarah Android, Penetrasi/Pertumbungan, dan Peluang Smartp...
I/O Extended (GDG Bogor) - Sidiq Permana
I/O Extended (GDG Bogor) - Sidiq Permana
Agate Presentation at Gedebuk Coy!
Agate Presentation at Gedebuk Coy!
Develop a Game - And interact with your Community | by Two Pi Team
Develop a Game - And interact with your Community | by Two Pi Team
About indonesia Game Industry - Agate Studio
About indonesia Game Industry - Agate Studio
Indonesia Game Ecosystem Outlook 2017
Indonesia Game Ecosystem Outlook 2017
Rendra Toro - Model View Presenter
Rendra Toro - Model View Presenter
Introduction to Android - Seminar
Introduction to Android - Seminar
Similar to Gradle Android Build System Guide
Hands on the gradle
Hands on the gradle
Kostiantyn Zghirovskyi
Android 101 - Introduction to Android Development
Android 101 - Introduction to Android Development
Andy Scherzinger
Android Applications Development: A Quick Start Guide
Android Applications Development: A Quick Start Guide
Sergii Zhuk
Hello, Android Studio 3.2 & Android App Bundle @ I/O Extended Bangkok 2018
Hello, Android Studio 3.2 & Android App Bundle @ I/O Extended Bangkok 2018
Somkiat Khitwongwattana
Android gradle-build-system-overview
Android gradle-build-system-overview
Kevin He
lecture-2-android-dev.pdf
lecture-2-android-dev.pdf
jakjak36
01 02 - introduction - adroid stack
01 02 - introduction - adroid stack
Siva Kumar reddy Vasipally
Deploying artifacts to archiva
Deploying artifacts to archiva
allanh0526
Android app development lesson 1
Android app development lesson 1
Kalluri Vinay Reddy
Android Studio簡介
Android Studio簡介
Walter Shi
Android
Android
Lina Shamiah
Android Development
Android Development
John Mark ジョンマーク
Android session-1-sajib
Android session-1-sajib
Hussain Behestee
3. Android Architecture.pptx
3. Android Architecture.pptx
HarshiniB11
Android dev o_auth
Android dev o_auth
lzongren
Notes Unit2.pptx
Notes Unit2.pptx
MIT Autonomous Aurangabad
Android
Android
Nirav Ranpara
Android Basic
Android Basic
Nirav Ranpara
Android installation guide
Android installation guide
magicshui
Getting started with the NDK
Getting started with the NDK
Kirill Kounik
Similar to Gradle Android Build System Guide
(20)
Hands on the gradle
Hands on the gradle
Android 101 - Introduction to Android Development
Android 101 - Introduction to Android Development
Android Applications Development: A Quick Start Guide
Android Applications Development: A Quick Start Guide
Hello, Android Studio 3.2 & Android App Bundle @ I/O Extended Bangkok 2018
Hello, Android Studio 3.2 & Android App Bundle @ I/O Extended Bangkok 2018
Android gradle-build-system-overview
Android gradle-build-system-overview
lecture-2-android-dev.pdf
lecture-2-android-dev.pdf
01 02 - introduction - adroid stack
01 02 - introduction - adroid stack
Deploying artifacts to archiva
Deploying artifacts to archiva
Android app development lesson 1
Android app development lesson 1
Android Studio簡介
Android Studio簡介
Android
Android
Android Development
Android Development
Android session-1-sajib
Android session-1-sajib
3. Android Architecture.pptx
3. Android Architecture.pptx
Android dev o_auth
Android dev o_auth
Notes Unit2.pptx
Notes Unit2.pptx
Android
Android
Android Basic
Android Basic
Android installation guide
Android installation guide
Getting started with the NDK
Getting started with the NDK
Recently uploaded
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
Malak Abu Hammad
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
Puma Security, LLC
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
Pooja Nehwal
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
Scott Keck-Warren
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
soniya singh
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
HostedbyConfluent
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
XfilesPro
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
shyamraj55
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
Delhi Call girls
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
null - The Open Security Community
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
Padma Pradeep
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
Delhi Call girls
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
Sinan KOZAK
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
Pixlogix Infotech
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
carlostorres15106
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
AndikSusilo4
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
Ridwan Fadjar
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
Deakin University
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
Recently uploaded
(20)
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Gradle Android Build System Guide
1.
Anton Nurdin T Senior
Software Engineer, Xendit anton46.com DEEP UNDERSTANDING ABOUT
2.
What is Gradle?
3.
Android Build System
4.
Android Build System ant Maven Gradle SBT buck
5.
Build Process
6.
7.
Multi-Language Resource/Code Generation Platform Diversity
8.
Why Gradle? 1. Powerful
Build System - Declarative, Flexible - Imperative Customization - Tooling API 2. Build System Toolkit - Plugins create own DSL, APIs, IDE integration 3. Free/Open Source
9.
Structure Settings File - settings.gradle
10.
Structure Settings File - settings.gradle Top-level
Build File
11.
Top-level Build File buildscript
{ repositories { jcenter() } dependencies { classpath 'com.android.tools.build:gradle:2.0.0' } } allprojects { repositories { jcenter() } } build.gradle
12.
Structure Settings File - settings.gradle Top-level
Build File
13.
Structure Settings File - settings.gradle Top-level
Build File Module-level Build File
14.
apply plugin: 'com.android.application' android
{ compileSdkVersion 23 buildToolsVersion "23.0.3" defaultConfig { ... } buildTypes { ... } productFlavors { ... } } dependencies { ... } Module-level Build File build.gradle
15.
Gradle Tasks assemble check build clean assemble +
check assembleDebug + assembleRelease connectedCheck deviceCheck
16.
COSTUMIZATION
17.
Basic Customization android { compileSdkVersion
23 buildToolsVersion "23.0.3" defaultConfig { minSdkVersion 15 targetSdkVersion 23 versionCode 1 versionName "1.0" } } build.gradle
18.
Basic Customization def getVersionCode()
{ def code = ... return code; } android { defaultConfig { versionCode getVersionCode() ... } } build.gradle
19.
Basic Customization android { defaultConfig
{ applicationId “com.example.app” minSdkVersion 15 targetSdkVersion 23 versionCode 1 versionName "1.0" applicationVariants.all { variant -> variant.outputs.each { output -> def file = output.outputFile def fileName = file.name.replace(".apk", "-v" + versionName + "-c" + versionCode + ".apk") output.outputFile = new File(file.parentFile, fileName) } } } } build.gradle
20.
Basic Customization app-debug-v1.0-c1.apk app-release-v1.0-c1.apk
21.
Build Types - Build
/ Packaging customization • Debuggable flag • ProGuard • Signing Configuration • Source / Resource Overlay - Debug and release prebuilt
22.
Build Types android { buildTypes
{ debug { applicationIdSuffix '.debug' versionNameSuffix '-DEBUG' } beta { applicationIdSuffix '.beta' versionNameSuffix '-BETA' } } } build.gradle
23.
Build Types :
Source Folder src/main/AndroidManifest.xml src/main/java src/main/resource src/main/res src/main/assets src/main/aidl src/main/rs src/main/jni src/debug/... src/release/... src/beta/... src/androidTest/java src/androidTest/resource src/androidTest/res src/androidTest/assets src/androidTest/aidl src/androidTest/rs src/androidTest/jni
24.
Gradle Tasks assemble check build clean assemble +
check assembleDebug + assembleRelease + assembleBeta connectedCheck deviceCheck
25.
Signing Configuration android { signingConfigs
{ release { storeFile file('<name>.keystore') keyAlias 'keyAlias' keyPassword 'keyPassword' storePassword 'storePassword' } } } build.gradle
26.
Debuggable Release Builds android
{ signingConfigs { debugRelease.intiWith(buildTypes.release) debugRelease { debuggable true applicationIdSuffix '.debugrelease' signingConfig signingConfigs.debug } } } build.gradle
27.
DEPENDENCIES
28.
Dependency Scope: Java
Projects compile runtime testCompile testRuntime
29.
Dependency Scope: Android
Projects compile runtime testCompile testRuntime compile package androidTestCompile androidTestPackage
30.
Local Dependencies android { ... } dependencies
{ compile fileTree(dir: 'libs', include: ['*.jar']) } build.gradle
31.
Remote Dependencies repositories {
jcenter() } android { ... } dependencies { compile 'com.android.support:appcompat-v7:23.2.1' } build.gradle
32.
Multi-Project Setup settings.gradle include ':app' include
':libraries:lib1' include ':libraries:lib2' MyProject/ | settings.gradle + app/ | build.gradle + libraries/ + lib1/ | build.gradle + lib2/ | build.gradle
33.
Project Dependencies android { ... } dependencies
{ compile project(‘:libraries:lib1’) } build.gradle
34.
Android Library Project apply
plugin: 'com.android.library' android { compileSdkVersion 23 buildToolsVersion '23.0.1' } build.gradle
35.
Android Library - Binary
Bundle (.aar) • Uploadable to repositories - Support for • assets • Proguard rules • Custom Lint rules • . . .
36.
BUILD VARIANTS
37.
Product Flavors - Different
versions of the same application • Paid vs Free • Multi-APK support in Google Play - Different Dimension(s) than BuildTypes
38.
Android Library Project android
{ productFlavors { flavour1 { applicationId "com.example.flavour1" minSdkVersion 16 } flavour2 { applicationId "com.example.flavour2" } } } build.gradle
39.
Build Types :
Source Folder src/main/AndroidManifest.xml src/main/java src/main/resource src/main/res src/main/assets src/main/aidl src/main/rs src/main/jni src/androidTest/java src/androidTest/resource src/androidTest/res src/androidTest/assets src/androidTest/aidl src/androidTest/rs src/androidTest/jni src/debug/... src/release/... src/beta/... src/flavor1/... src/androidTestFlavor1/...
40.
Variant = Build
Type + Product Flavor(s) No Flavors : debug release - debug release - - -
41.
Variant = Build
Type + Product Flavor(s) No Flavors : debug release - debug release - - - With Flavors : debug release Flavor1 Flavor1Debug Flavor1Release Flavor2 Flavor2Debug Flavor2Release
42.
Build Variants :
Source Code Multiple source folders, single output src/main/java src/debug/java src/free/java
43.
Build Variants :
Resource Overlays src/main/res src/debug/res src/free/res
44.
Build Variants :
Signing Configuration Priority Order android.defaultConfig.signingConfig android.buildTypes.release.signingConfig android.productFlavors.free.signingConfig
45.
Build Variants :
Package Name Overlays + Suffix android.defaultConfig.packageName android.productFlavors.free.signingConfig + android.buildTypes.debug.packageNameSuffix src/main/AndroidManifest.xml
46.
Build Variants :
Proguard android { ... buildTypes { release { minifyEnabled true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } productFlavors { flavor2 { proguardFile 'flavor2-rules.pro' } } } build.gradle
47.
Res / Code
Generation buildConfigField resValue
48.
build.gradle android { buildTypes { debug
{ buildConfigField "String", "SERVER_URL", '"http://staging.example.co"' resValue "string", "facebook_app_id", '"12345678910' ... } release { buildConfigField "String", "SERVER_URL", '"https://example.co"' resValue "string", "facebook_app_id", '"0987654321' ... } } } Res / Code Generation
49.
PERFORMACE
50.
GRADLE IS FAST
51.
GRADLE IS FAST 200
Projects grade clean assemble —-parallel 7s
52.
• Android Studio
IDE (Android Tooling Team) • Gradle Android Plugin (Android Tooling Team) • Gradle Flatform (Gradle Team) • Android Tooling (Android Platform Team) Toolchain
53.
BOTLENECK
54.
Clean Install (61.9s) 1%8% 46%
27% 3% 14% Install (8.89s) After Dexing (2.06s) Dex (16.67s) Pre-Dex (28.54s) Before Dexing (5.04) Configuration (0.65)
55.
Install After Code Change
(33.31s) 2% 15% 50% 6% 27% Install (8.89s) After Dexing (2.06s) Dex (16.67s) Before Dexing (5.04s) Configuration (0.65s)
56.
PRE-DEXING DEXING
57.
Hint • Enable the
Gradle daemon and parallel build dexOptions { incremental true } • Incremental dexing ~/.gradle/gradle.properties org.gradle.daemon=true org.gradle.parallel=true org.gradle.jvmargs=-Xmx1024m org.gradle.java.home=/path/to/jvm • Offline Mode • Separate project into modules
58.
https://source.android.com/ source/jack.html Jack Compiler
59.
http://gradle.org/training/
60.
Anton Nurdin T Senior
Software Engineer, Xendit anton46.com THANK YOU
Download now