Slide 1

Slide 1 text

No content

Slide 2

Slide 2 text

Image Processing Library

Slide 3

Slide 3 text

Image Processing Library Supports GIF animations

Slide 4

Slide 4 text

Image Processing Library Supports GIF animations Allows lot of configuration

Slide 5

Slide 5 text

Image Processing Library Supports GIF animations Allows lot of configuration Maintained by Googlers

Slide 6

Slide 6 text

Image Processing Library Supports GIF animations Allows lot of configuration Maintained by Googlers Open source @Github

Slide 7

Slide 7 text

No content

Slide 8

Slide 8 text

No content

Slide 9

Slide 9 text

No content

Slide 10

Slide 10 text

E F F E C T I V E GRADLE SCRIPTS FOR ANDROID PROJECTS

Slide 11

Slide 11 text

No content

Slide 12

Slide 12 text

https://github.com/babuasp2003/glide/tree/better_scripts

Slide 13

Slide 13 text

Item 1: Break your code!

Slide 14

Slide 14 text

1 module 1 package 1 java file

Slide 15

Slide 15 text

1 module 1 package few java files

Slide 16

Slide 16 text

1 module few packages more java files

Slide 17

Slide 17 text

few modules lot more packages many more java files

Slide 18

Slide 18 text

lot of modules lot more packages countless java files

Slide 19

Slide 19 text

Module ownership is a challenge

Slide 20

Slide 20 text

Module ownership is a challenge Code reviews became difficult

Slide 21

Slide 21 text

Module ownership is a challenge Code reviews became difficult Gradle takes forever to build

Slide 22

Slide 22 text

Create multiple smaller projects

Slide 23

Slide 23 text

Create multiple smaller projects Upload module aars to local maven

Slide 24

Slide 24 text

Create multiple smaller projects Upload module aars to local maven Reference dependencies remotely

Slide 25

Slide 25 text

Glide project

Slide 26

Slide 26 text

Only flickr stuff

Slide 27

Slide 27 text

Everything else

Slide 28

Slide 28 text

End structure

Slide 29

Slide 29 text

Item 2: Composite builds

Slide 30

Slide 30 text

No content

Slide 31

Slide 31 text

A composite build is simply a build that includes other builds.

Slide 32

Slide 32 text

A composite build is simply a build that includes other builds. settings.gradle

Slide 33

Slide 33 text

+ Compose multiple random builds

Slide 34

Slide 34 text

+ Compose multiple random builds + Will be useful for large projects

Slide 35

Slide 35 text

+ Compose multiple random builds + Will be useful for large projects - Only from Gradle version (3.x)

Slide 36

Slide 36 text

+ Compose multiple random builds + Will be useful for large projects - Only from Gradle version (3.x) - Not yet in Android Studio :(

Slide 37

Slide 37 text

Item 3: Declare Dependencies

Slide 38

Slide 38 text

Good old direct entries

Slide 39

Slide 39 text

Setting versions in root build.gradle

Slide 40

Slide 40 text

dependency.gradle build.gradle

Slide 41

Slide 41 text

+ Enable single place ver. update

Slide 42

Slide 42 text

+ Enable single place ver. update + Can use no-op lib for debugging

Slide 43

Slide 43 text

+ Enable single place ver. update + Can use no-op lib for debugging - Lib updates will not show up auto

Slide 44

Slide 44 text

Item 4: Secure passwords

Slide 45

Slide 45 text

Teams might work from diff sites

Slide 46

Slide 46 text

Teams might work from diff sites There could be freelancers

Slide 47

Slide 47 text

Teams might work from diff sites There could be freelancers Some might return from US

Slide 48

Slide 48 text

Load password from env. variables

Slide 49

Slide 49 text

Item 5: (Flavor)Dimension

Slide 50

Slide 50 text

No content

Slide 51

Slide 51 text

+ When new config needed (less)

Slide 52

Slide 52 text

+ When new config needed (less) + Can inherit basic properties

Slide 53

Slide 53 text

+ When new config needed (less) + Can inherit basic properties - Can increase build time

Slide 54

Slide 54 text

Exclude redundant combinations

Slide 55

Slide 55 text

Removed!

Slide 56

Slide 56 text

Item 6: Build Performance

Slide 57

Slide 57 text

Measure!

Slide 58

Slide 58 text

--profile

Slide 59

Slide 59 text

- Does not work for regular info - Some devs might have slow laptop

Slide 60

Slide 60 text

Build scan

Slide 61

Slide 61 text

Optimize it...

Slide 62

Slide 62 text

Dex options (ci vs dev)

Slide 63

Slide 63 text

Grade Properties (ci vs dev)

Slide 64

Slide 64 text

E F F E C T I V E GRADLE SCRIPTS FOR ANDROID PROJECTS

Slide 65

Slide 65 text

Item 7: Don’t use Gradle

Slide 66

Slide 66 text

Item 7: Buck build for Dev

Slide 67

Slide 67 text

OkBuck

Slide 68

Slide 68 text

+ Gradle plugin to gen. Buck rules

Slide 69

Slide 69 text

+ Gradle plugin to gen. Buck rules + Buck wrapper based on Gradle

Slide 70

Slide 70 text

+ Gradle plugin to gen. Buck rules + Buck wrapper based on Gradle + Many times faster than Gradle

Slide 71

Slide 71 text

+ Gradle plugin to gen. Buck rules + Buck wrapper based on Gradle + Many times faster than Gradle - Not supported by Google

Slide 72

Slide 72 text

as valuable as

Slide 73

Slide 73 text

THANKS Arun Babu A S P https://yourstory.com/2016/09/arun-babu-story/