Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
7_ways_to_improve_your_gradle_build.pdf
Search
Tania Pinheiro
October 27, 2016
Programming
47
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
7_ways_to_improve_your_gradle_build.pdf
Talk from Droidcon London 2016
Tania Pinheiro
October 27, 2016
Other Decks in Programming
See All in Programming
KiroのSpecで「五目並べ」を作ってみる
satoshi256kbyte
1
380
Agents on Rails - Rails at Scale 2026
irinanazarova
0
560
最近”作らせてる” ローカルAIアプリの話
akit37
0
470
Herb in Rails 8.2: Your ERB views, now HTML-aware @ Kaigi on Rails 2026, Tokyo, Japan
marcoroth
2
220
The Rails Doctrine Decade
koic
2
590
Web Framework Benchmark Battle 2026, Any%
a_matsuda
2
2k
[Dev Group Paris Octobre 26] Agentforce, SIforce, Claudeforce, Slackbot… on s'y retrouve ?
nabondance
0
110
作って学ぶSpring BootのAuto Configuration / JJUG Night Seminar 2026-10-19
rshindo
0
140
R8 の設定見直しでアプリサイズ削減
andpad
0
220
contenteditable と日本語入力に向き合う
colorful12
0
200
phperだってパンチカードでコーディングしたい
o0h
PRO
0
330
ソニーのクラウド共通基盤の変遷とAI時代の開発スタイルに合わせた進化 / The Journey of Sony’s Common Cloud Platform and Its Evolution for AI-Native Development
kenjiyoneyama
0
270
Featured
See All Featured
YesSQL, Process and Tooling at Scale
rocio
174
15k
Optimising Largest Contentful Paint
csswizardry
37
4k
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.6k
It's Worth the Effort
3n
188
29k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
28
3.7k
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
340
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
940
The SEO identity crisis: Don't let AI make you average
varn
0
590
Statistics for Hackers
jakevdp
799
230k
Ten Tips & Tricks for a 🌱 transition
stuffmc
1
270
VelocityConf: Rendering Performance Case Studies
addyosmani
331
25k
Art, The Web, and Tiny UX
lynnandtonic
304
22k
Transcript
7 WAYS TO IMPROVE YOUR GRADLE BUILD Tania Pinheiro @tcmpinheiro
Droidcon London 2016
WHY? Automate tasks Customise the build to the current project
Integrate continuous delivery
#1 EXTRA PROPERTIES // app/build.gradle ext { applicationIdName = "com.example.myapplication"
minVersion = 16 targetVersion = 24 } android { compileSdkVersion targetVersion defaultConfig { applicationId applicationIdName minSdkVersion minVersion targetSdkVersion targetVersion } }
#1 EXTRA PROPERTIES // app/build.gradle ext { applicationIdName = "com.example.myapplication"
minVersion = 16 targetVersion = 24 } android { compileSdkVersion targetVersion defaultConfig { applicationId applicationIdName minSdkVersion minVersion targetSdkVersion targetVersion } }
#1 EXTRA PROPERTIES // app/build.gradle ext { applicationIdName = "com.example.myapplication"
minVersion = 16 targetVersion = 24 } android { compileSdkVersion targetVersion defaultConfig { applicationId applicationIdName minSdkVersion minVersion targetSdkVersion targetVersion } }
#2 APPLICATIONID // app/build.gradle android { defaultConfig { applicationId
applicationIdName } productFlavors { pro { applicationId applicationIdName + ".pro" } free { applicationId applicationIdName + ".free" } } buildTypes { debug { applicationIdSuffix ".debug" } } }
#2 APPLICATIONID // app/build.gradle android { defaultConfig { applicationId
applicationIdName } productFlavors { pro { applicationId applicationIdName + ".pro" } free { applicationId applicationIdName + ".free" } } buildTypes { debug { applicationIdSuffix ".debug" } } }
#2 APPLICATIONID // app/build.gradle android { defaultConfig { applicationId
applicationIdName } productFlavors { pro { applicationId applicationIdName + ".pro" } free { applicationId applicationIdName + ".free" } } buildTypes { debug { applicationIdSuffix ".debug" } } }
#2 APPLICATIONID // app/build.gradle android { defaultConfig { applicationId
applicationIdName } productFlavors { pro { applicationId applicationIdName + ".pro" } free { applicationId applicationIdName + ".free" } } buildTypes { debug { applicationIdSuffix ".debug" } } }
#2 APPLICATIONID // app/build.gradle android { defaultConfig { applicationId
applicationIdName } productFlavors { pro { applicationId applicationIdName + ".pro" } free { applicationId applicationIdName + ".free" } } buildTypes { debug { applicationIdSuffix ".debug" } } }
#3 APP NAME / ICON // app/build.gradle productFlavors { pro
{ applicationId applicationIdName + ".pro" resValue "string", "app_name", "App-Pro" manifestPlaceholders = [appIcon: "@mipmap/ic_launcher_pro"] } free { applicationId applicationIdName + ".free" resValue "string", "app_name", "App-Free" manifestPlaceholders = [appIcon: "@mipmap/ic_launcher_free"] } } // app/AndroidManifest.xml <application android:label=“@string/app_name” android:icon="${appIcon}" > </application>
#3 APP NAME / ICON // app/build.gradle productFlavors { pro
{ applicationId applicationIdName + ".pro" resValue "string", "app_name", "App-Pro" manifestPlaceholders = [appIcon: "@mipmap/ic_launcher_pro"] } free { applicationId applicationIdName + ".free" resValue "string", "app_name", "App-Free" manifestPlaceholders = [appIcon: "@mipmap/ic_launcher_free"] } } // app/AndroidManifest.xml <application android:label=“@string/app_name” android:icon="${appIcon}" > </application>
#3 APP NAME / ICON // app/build.gradle productFlavors { pro
{ applicationId applicationIdName + ".pro" resValue "string", "app_name", "App-Pro" manifestPlaceholders = [appIcon: "@mipmap/ic_launcher_pro"] } free { applicationId applicationIdName + ".free" resValue "string", "app_name", "App-Free" manifestPlaceholders = [appIcon: "@mipmap/ic_launcher_free"] } } // app/AndroidManifest.xml <application android:label=“@string/app_name” android:icon="${appIcon}" > </application>
#3 APP NAME / ICON // app/build.gradle productFlavors { pro
{ applicationId applicationIdName + ".pro" resValue "string", "app_name", "App-Pro" manifestPlaceholders = [appIcon: "@mipmap/ic_launcher_pro"] } free { applicationId applicationIdName + ".free" resValue "string", "app_name", "App-Free" manifestPlaceholders = [appIcon: "@mipmap/ic_launcher_free"] } } // app/AndroidManifest.xml <application android:label=“@string/app_name” android:icon="${appIcon}" > </application>
#4 CUSTOM SCRIPTS // scripts/dependencies.gradle ext { androidSupportVersion = '24.2.0'
presentationDependencies = [ appCompatSupport : "com.android.support:appcompat-v7:${androidSupportVersion}", designSupport : "com.android.support:design:${androidSupportVersion}" ] } // app/build.gradle apply from: '../scripts/dependencies.gradle' dependencies { compile presentationDependencies.appCompatSupport compile presentationDependencies.designSupport }
#4 CUSTOM SCRIPTS // scripts/dependencies.gradle ext { androidSupportVersion = '24.2.0'
presentationDependencies = [ appCompatSupport : "com.android.support:appcompat-v7:${androidSupportVersion}", designSupport : "com.android.support:design:${androidSupportVersion}" ] } // app/build.gradle apply from: '../scripts/dependencies.gradle' dependencies { compile presentationDependencies.appCompatSupport compile presentationDependencies.designSupport }
#4 CUSTOM SCRIPTS // scripts/dependencies.gradle ext { androidSupportVersion = '24.2.0'
presentationDependencies = [ appCompatSupport : "com.android.support:appcompat-v7:${androidSupportVersion}", designSupport : "com.android.support:design:${androidSupportVersion}" ] } // app/build.gradle apply from: '../scripts/dependencies.gradle' dependencies { compile presentationDependencies.appCompatSupport compile presentationDependencies.designSupport }
#4 CUSTOM SCRIPTS // scripts/dependencies.gradle ext { androidSupportVersion = '24.2.0'
presentationDependencies = [ appCompatSupport : "com.android.support:appcompat-v7:${androidSupportVersion}", designSupport : "com.android.support:design:${androidSupportVersion}" ] } // app/build.gradle apply from: '../scripts/dependencies.gradle' dependencies { compile presentationDependencies.appCompatSupport compile presentationDependencies.designSupport }
#4 CUSTOM SCRIPTS // scripts/dependencies.gradle ext { androidSupportVersion = '24.2.0'
presentationDependencies = [ appCompatSupport : "com.android.support:appcompat-v7:${androidSupportVersion}", designSupport : "com.android.support:design:${androidSupportVersion}" ] } // app/build.gradle apply from: '../scripts/dependencies.gradle' dependencies { compile presentationDependencies.appCompatSupport compile presentationDependencies.designSupport }
#5 BUILD TYPE TO RUN TESTS // app/build.gradle android
{ testBuildType ‘staging' }
#5 BUILD TYPE TO RUN TESTS // app/build.gradle android
{ testBuildType ‘staging' }
#6 SIGNING CREDENTIALS // app/build.gradle signingConfigs { release { if(file('deployment/keystore.properties').exists()){
def props = new Properties() props.load(new FileInputStream(file('deployment/keystore.properties'))) storeFile = file('../deployment/production_keystore.jks') storePassword = props['storePassword'] keyAlias = props['keyAlias'] keyPassword = props['keyPassword'] } } } // deployment/keystore.properties storePassword = storePassword keyAlias = keyAlias keyPassword = keyPassword
#6 SIGNING CREDENTIALS // app/build.gradle signingConfigs { release { if(file('deployment/keystore.properties').exists()){
def props = new Properties() props.load(new FileInputStream(file('deployment/keystore.properties'))) storeFile = file('../deployment/production_keystore.jks') storePassword = props['storePassword'] keyAlias = props['keyAlias'] keyPassword = props['keyPassword'] } } } // deployment/keystore.properties storePassword = storePassword keyAlias = keyAlias keyPassword = keyPassword
#6 SIGNING CREDENTIALS // app/build.gradle signingConfigs { release { if(file('deployment/keystore.properties').exists()){
def props = new Properties() props.load(new FileInputStream(file('deployment/keystore.properties'))) storeFile = file('../deployment/production_keystore.jks') storePassword = props['storePassword'] keyAlias = props['keyAlias'] keyPassword = props['keyPassword'] } } } // deployment/keystore.properties storePassword = storePassword keyAlias = keyAlias keyPassword = keyPassword
#6 SIGNING CREDENTIALS // app/build.gradle signingConfigs { release { if(file('deployment/keystore.properties').exists()){
def props = new Properties() props.load(new FileInputStream(file('deployment/keystore.properties'))) storeFile = file('../deployment/production_keystore.jks') storePassword = props['storePassword'] keyAlias = props['keyAlias'] keyPassword = props['keyPassword'] } } } // deployment/keystore.properties storePassword = storePassword keyAlias = keyAlias keyPassword = keyPassword
#7 CONTINUOUS DELIVERY Crashlytics for Beta Testers distribution
#7 CONTINUOUS DELIVERY Crashlytics for Beta Testers distribution Fastlane Supply
to upload to PlayStore supply --apk path/to/app.apk
WANT TO LEARN MORE?
WANT TO LEARN MORE? Gradle for Android and Java by
THANK YOU! Tania Pinheiro @tcmpinheiro