Outline Gradle introduction Step by step tutorial Basic Dependency Sign / Proguard Variant Android Studio integration Q & A 3
Gradle 4
What is gradle ? Gradle is build automation evolved. Gradle can automate the building, testing, publishing, deployment and more of software packages or other types of projects such as generated static websites, generated documentation or indeed anything else. Gradle combines the power and exibility of Ant with the dependency management and conventions of Maven into a more effective way to build. Powered by a Groovy DSL and packed with innovation, Gradle provides a declarative way to describe all kinds of builds through sensible defaults. Gradle is quickly becoming the build system of choice for many open source projects, leading edge enterprises and legacy automation challenges. - http://www.gradle.org/ 5
.. short version An open source build system that combines the power of Ant & Maven 6
Why gradle ? Powerful Build System Declarative, Flexible Imperative customization Tooling API Build System Toolkit Plugins create own DSL,APIs, IDE integration Free / Open Source 7
tips Save your gradle.properties in ~/.gradle/ .. If you work alone 33
Proguard 34
35
Variant 36
Build variants Creating different versions of same application free/paid multi-apk BuildVariant = Build Type + Product Flavor 37
Product Flavors Denes a customized version of application build by the project Free / Paid Amazon / Play Store / blah store Same type as defaultCong 38
Survival guide Rule #1 Always backup your project. 47
Survival guide Rule #2 Dont import production code until 1.0 is out.. 48
Best practice ? Import modules manually pro short compile / AS startup time consider project with multiple libraries.. con no variant builds (ok for most people) 49
R U KIDDING ME ? 50
51
Basic 52
53
congurations 54
55
import.. 56
import.. 57
import.. 58
import.. 59
Piece of cake 60
Dependency 61
project layout 62
congurations 63
... errrrrr Dont recognize as library project No typo checking, no function reference, no ... But you can still build the project 64
duplicated name ? 65
try another way 66
errrrrrr 67
68
Rene project layout 69
working congurations 70
tips as simple as possible library/xxx_lib use : instead of / in path ugly, but runs ne 71
Local repository 72
What & Why ? Use aar instead of re-compiling everything aar: Binary distribution of an Android Library Project http://tools.android.com/tech-docs/new- build-system/aar-format Time is money DRY 73