Do you speak
Gradle?
+Damian Mee
@meeDamian
So, what’s gradle?
● It’s a build system
● Based on Groovy
● Extensible (plugins!)
● Introduced to Android with Android St...
CHEERFUL OFFTOP
Developers in Belarus
can now publish
PAID APPS
to
Play Store
:-)
Variants
● Build Type (debug or release)
● Product Flavor (paid, free, whitelabel)
● Multi-APK Splits (ARM, x86, MIPS)
COM...
Enough bla bla bla
ProjectHome
|-- app
| |-- src
| | |-- main
| | | +-- java
| | | +-- res
| | | |-- AndroidManifest.xml
|...
ProjectHome
|-- app
| |-- src
| | |-- main
| | | +-- java
| | | +-- res
| | | |-- AndroidManifest.xml
| | |
| | +-- otherF...
ProjectHome
|-- app
| |-- src
| | |-- main
| | | +-- java
| | | +-- res
| | | |-- AndroidManifest.xml
| | |
| | +-- otherF...
ProjectHome
|-- app
| |-- src
| | |-- main
| | | +-- java
| | | +-- res
| | | |-- AndroidManifest.xml
| | |
| | +-- otherF...
|-- settings.gradle
include ‘:app’
include ‘:app’, ‘:FloatingLabel’
|-- settings.gradle (with library projects)
ProjectHome
+-- app
+-- FloatingLabel
|
|-- b...
ProjectHome
|-- app
| |-- src
| | |-- main
| | | +-- java
| | | +-- res
| | | |-- AndroidManifest.xml
| | |
| | +-- otherF...
ProjectHome
|-- app
| |-- src
| | |-- main
| | | +-- java
| | | +-- res
| | | |-- AndroidManifest.xml
| | |
| | +-- otherF...
|-- gradle.properties
STORE_FILE=/home/mee/dev/android/keys/datKey
STORE_PASSWORD=superSecretPassword
KEY_ALIAS=projecthom...
ProjectHome
|-- app
| |-- src
| | |-- main
| | | +-- java
| | | +-- res
| | | |-- AndroidManifest.xml
| | |
| | +-- otherF...
ProjectHome
|-- app
| |-- src
| | |-- main
| | | +-- java
| | | +-- res
| | | |-- AndroidManifest.xml
| | |
| | +-- otherF...
ProjectHome
|-- app
| |-- src
| | |-- main
| | | +-- java
| | | +-- res
| | | |-- AndroidManifest.xml
| | |
| | +-- otherF...
apply plugin: 'com.android.application'
android {
compileSdkVersion 'android-L'
buildToolsVersion "20.0"
defaultConfig {
a...
apply plugin: 'com.android.application'
android {
compileSdkVersion 'android-L'
buildToolsVersion "20.0"
defaultConfig {
a...
apply plugin: 'com.android.application'
android {
compileSdkVersion 'android-L'
buildToolsVersion "20.0"
defaultConfig {
a...
// ...
buildTypes {
release {
// here’s where signing code would go
}
}
productFlavors {
otherFlavor {
// flavor-specific ...
// ...
buildTypes {
release {
// here’s where signing code would go
}
}
productFlavors {
otherFlavor {
// flavor-specific ...
Shameless auto-promotion
meeDamian.com/post/publishing-with-gradle
goo.gl/zmlS10
// ...
buildTypes {
release {
// here’s where signing code would go
}
}
productFlavors {
otherFlavor {
// flavor-specific ...
// ...
buildTypes {
release {
// here’s where signing code would go
}
}
productFlavors {
otherFlavor {
// flavor-specific ...
// ...
buildTypes {
release {
// here’s where signing code would go
}
}
productFlavors {
otherFlavor {
// flavor-specific ...
// ...
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.google.android.gms:play-services:17.0...
// ...
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.google.android.gms:play-services:17.0...
// ...
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.google.android.gms:play-services:17.0...
// ...
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.google.android.gms:play-services:17.0...
// ...
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.google.android.gms:play-services:17.0...
Android Gradle plugin docs SUCK ;-(
But community rocks ;)
+Android Developer Tools
goo.gl/6a0aKP
+Tor Norbye
+Alex Ruiz
[...
Fin and Q&A
or
...
Fin and Q&A
or
Material Design
A little bit about
Material Design
● “paper” and “ink” based design language
● introduced with Android L-something
● cross-everything (mobile...
Leave teleportation for Star Trek
Keep things delightful
Structure information
Loads of beautifully crafted icons
Depth helps with comprehension
Interaction emits energy
google.com/design
Kick start
<style name="Theme.Awesome"
parent="@android:style/Theme.Material.Light.DarkActionBar">
</style>
values-v21/sty...
Remarks
● CardView and RecyclerView
● android:colorPrimary, android:colorAccent
● android:tintMode=””
Android Studio 0.8.1
Is now in Beta
New project structure view (soon)
API levels in wizard
Layout Editor (menu)
Layout Editor (different versions)
Typechecking to the resource system
Non-retarded emulators!
genymotion.com
Other, usual & gradual improvements
● Wear, TV & Glass now in wizard
● RTL layouts improvements
● Eclipse migrate process
...
+Damian Mee
@meeDamian
meeDamian.com/post/publishing-with-gradle
goo.gl/zmlS10
Gradle + Google I/O 2014 remarks
Upcoming SlideShare
Loading in …5
×

Gradle + Google I/O 2014 remarks

1,143 views

Published on

Published in: Mobile, Technology
0 Comments
5 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,143
On SlideShare
0
From Embeds
0
Number of Embeds
53
Actions
Shares
0
Downloads
25
Comments
0
Likes
5
Embeds 0
No embeds

No notes for slide
  • Collision, speedrun,
  • Can run on IDE, as well as on Build Server;
    New version of Android Studio (Beta, 0.8.1);
    Groovy is like Java;
    We can plug-in(to) any stage of a build process through tooling APIs
  • different sign
  • Move stuff Manifest -> gradle
  • Move stuff Manifest ->
  • consists of properties that are automatically parsed and provided in our build.gradle files
  • Move stuff Manifest ->
  • topmost build.gradle file;
    it’s boring, provided by IDE/AS;
  • A lot of things happen in this file
  • since 0.8.0 there’s new plugin’s naming nomenclature
  • no need to repeat the same stuff across different manifests
  • where you’d put your signing
  • optional (even when we’re using flavors)
    BuildConfig available as static variables in BuildConfig object
  • split it into multiple slides with animated examples:
    Buttons,
    progress bars,
    paper layouts,
    8dp grid,
    improved animation curves,
    webM -> gif: https://cloudconvert.org/webm-to-gif

    google.com/design/spec

    developer’s approch: https://www.youtube.com/watch?v=x5-ntYM_2UY
    http://developer.android.com/preview/material/get-started.html
  • It takes time for users to find around in a new view
  • Let’s just ignore support library altogether for now
  • colorPrimary, colorAccent, tintMode (generic icons transformed to requested color)
  • Gradle + Google I/O 2014 remarks

    1. 1. Do you speak Gradle? +Damian Mee @meeDamian
    2. 2. So, what’s gradle? ● It’s a build system ● Based on Groovy ● Extensible (plugins!) ● Introduced to Android with Android Studio ● No support for NDK (yet)
    3. 3. CHEERFUL OFFTOP Developers in Belarus can now publish PAID APPS to Play Store :-)
    4. 4. Variants ● Build Type (debug or release) ● Product Flavor (paid, free, whitelabel) ● Multi-APK Splits (ARM, x86, MIPS) COMING SOON
    5. 5. Enough bla bla bla ProjectHome |-- app | |-- src | | |-- main | | | +-- java | | | +-- res | | | |-- AndroidManifest.xml | | |-- otherFlavor | |-- build.gradle |-- build.gradle |-- gradle.properties |-- settings.gradle
    6. 6. ProjectHome |-- app | |-- src | | |-- main | | | +-- java | | | +-- res | | | |-- AndroidManifest.xml | | | | | +-- otherFlavor | | | |-- build.gradle | |-- build.gradle |-- gradle.properties |-- settings.gradle
    7. 7. ProjectHome |-- app | |-- src | | |-- main | | | +-- java | | | +-- res | | | |-- AndroidManifest.xml | | | | | +-- otherFlavor | | | |-- build.gradle | |-- build.gradle |-- gradle.properties |-- settings.gradle
    8. 8. ProjectHome |-- app | |-- src | | |-- main | | | +-- java | | | +-- res | | | |-- AndroidManifest.xml | | | | | +-- otherFlavor | | | |-- build.gradle | |-- build.gradle |-- gradle.properties |-- settings.gradle
    9. 9. |-- settings.gradle include ‘:app’
    10. 10. include ‘:app’, ‘:FloatingLabel’ |-- settings.gradle (with library projects) ProjectHome +-- app +-- FloatingLabel | |-- build.gradle |-- gradle.properties |-- settings.gradle
    11. 11. ProjectHome |-- app | |-- src | | |-- main | | | +-- java | | | +-- res | | | |-- AndroidManifest.xml | | | | | +-- otherFlavor | | | |-- build.gradle | |-- build.gradle |-- gradle.properties |-- settings.gradle
    12. 12. ProjectHome |-- app | |-- src | | |-- main | | | +-- java | | | +-- res | | | |-- AndroidManifest.xml | | | | | +-- otherFlavor | | | |-- build.gradle | |-- build.gradle |-- gradle.properties |-- settings.gradle
    13. 13. |-- gradle.properties STORE_FILE=/home/mee/dev/android/keys/datKey STORE_PASSWORD=superSecretPassword KEY_ALIAS=projecthome KEY_PASSWORD=unbreakabalePassword OUTPUT_DIR=/home/mee/dev/android/binaries/ProjectHome PARSE_KEY_PUBLISHER=NaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
    14. 14. ProjectHome |-- app | |-- src | | |-- main | | | +-- java | | | +-- res | | | |-- AndroidManifest.xml | | | | | +-- otherFlavor | | | |-- build.gradle | |-- build.gradle |-- gradle.properties |-- settings.gradle
    15. 15. ProjectHome |-- app | |-- src | | |-- main | | | +-- java | | | +-- res | | | |-- AndroidManifest.xml | | | | | +-- otherFlavor | | | |-- build.gradle | |-- build.gradle |-- gradle.properties |-- settings.gradle
    16. 16. ProjectHome |-- app | |-- src | | |-- main | | | +-- java | | | +-- res | | | |-- AndroidManifest.xml | | | | | +-- otherFlavor | | | |-- build.gradle | |-- build.gradle |-- gradle.properties |-- settings.gradle
    17. 17. apply plugin: 'com.android.application' android { compileSdkVersion 'android-L' buildToolsVersion "20.0" defaultConfig { applicationId 'pl.d30.goodnotes' minSdkVersion 15 targetSdkVersion 'L' versionCode 1 versionName '1.0' } // ...
    18. 18. apply plugin: 'com.android.application' android { compileSdkVersion 'android-L' buildToolsVersion "20.0" defaultConfig { applicationId 'pl.d30.goodnotes' minSdkVersion 15 targetSdkVersion 'L' versionCode 1 versionName '1.0' } // ...
    19. 19. apply plugin: 'com.android.application' android { compileSdkVersion 'android-L' buildToolsVersion "20.0" defaultConfig { applicationId 'com.meedamian.projecthome' minSdkVersion 15 targetSdkVersion 'L' versionCode 1 versionName '1.0' } // ...
    20. 20. // ... buildTypes { release { // here’s where signing code would go } } productFlavors { otherFlavor { // flavor-specific configuration, ex: buildConfigField "String", "PARSE_KEY", PARSE_KEY_PUBLISHER } } } // ...
    21. 21. // ... buildTypes { release { // here’s where signing code would go } } productFlavors { otherFlavor { // flavor-specific configuration, ex: buildConfigField "String", "PARSE_KEY", PARSE_KEY_PUBLISHER } } } // ...
    22. 22. Shameless auto-promotion meeDamian.com/post/publishing-with-gradle goo.gl/zmlS10
    23. 23. // ... buildTypes { release { // here’s where signing code would go } } productFlavors { otherFlavor { // flavor-specific configuration, ex: buildConfigField "String", "PARSE_KEY", PARSE_KEY_PUBLISHER } } } // ...
    24. 24. // ... buildTypes { release { // here’s where signing code would go } } productFlavors { otherFlavor { // flavor-specific configuration, ex: buildConfigField "String", "PARSE_KEY", PARSE_KEY_PUBLISHER } } } // ...
    25. 25. // ... buildTypes { release { // here’s where signing code would go } } productFlavors { otherFlavor { // flavor-specific configuration, ex: buildConfigField "String", "PARSE_KEY", PARSE_KEY_PUBLISHER } } } // ... BuildConfig.PARSE_KEY
    26. 26. // ... dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) compile 'com.google.android.gms:play-services:17.0.0' compile project(":FloatingLabel") compile files("libs/libraryName.jar") }
    27. 27. // ... dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) compile 'com.google.android.gms:play-services:17.0.0' compile project(":FloatingLabel") compile files("libs/libraryName.jar") }
    28. 28. // ... dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) compile 'com.google.android.gms:play-services:17.0.0' compile project(":FloatingLabel") compile files("libs/libraryName.jar") } gradleplease.appspot.com
    29. 29. // ... dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) compile 'com.google.android.gms:play-services:17.0.0' compile project(":FloatingLabel") compile files("libs/libraryName.jar") }
    30. 30. // ... dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) compile 'com.google.android.gms:play-services:17.0.0' compile project(":FloatingLabel") compile files("libs/libraryName.jar") }
    31. 31. Android Gradle plugin docs SUCK ;-( But community rocks ;) +Android Developer Tools goo.gl/6a0aKP +Tor Norbye +Alex Ruiz [gradle]
    32. 32. Fin and Q&A or ...
    33. 33. Fin and Q&A or Material Design A little bit about
    34. 34. Material Design ● “paper” and “ink” based design language ● introduced with Android L-something ● cross-everything (mobile, desktop, wear, etc) ● adds depth through shadows ● beautifully crafted (unlike this ugly presentation)
    35. 35. Leave teleportation for Star Trek
    36. 36. Keep things delightful
    37. 37. Structure information
    38. 38. Loads of beautifully crafted icons
    39. 39. Depth helps with comprehension
    40. 40. Interaction emits energy
    41. 41. google.com/design
    42. 42. Kick start <style name="Theme.Awesome" parent="@android:style/Theme.Material.Light.DarkActionBar"> </style> values-v21/styles.xml defaultConfig { targetSdkVersion 'L' } app/build.gradle
    43. 43. Remarks ● CardView and RecyclerView ● android:colorPrimary, android:colorAccent ● android:tintMode=””
    44. 44. Android Studio 0.8.1 Is now in Beta
    45. 45. New project structure view (soon)
    46. 46. API levels in wizard
    47. 47. Layout Editor (menu)
    48. 48. Layout Editor (different versions)
    49. 49. Typechecking to the resource system
    50. 50. Non-retarded emulators! genymotion.com
    51. 51. Other, usual & gradual improvements ● Wear, TV & Glass now in wizard ● RTL layouts improvements ● Eclipse migrate process ● etc...
    52. 52. +Damian Mee @meeDamian meeDamian.com/post/publishing-with-gradle goo.gl/zmlS10

    ×