Extending Android Builds
Pragmatic Gradle and AGP Skills with Kotlin
Extending Android Builds (EAB) goes beyond Gradle configuration. It focuses on Gradle Plugin development that cooperates with AGP (Android Gradle Plugin) and related build tools such as AAPT2 (Android Asset Packaging Tool), KSP (Kotlin Symbol Processing) and bytecode manipulators with over 500+ pages. The primary language used in EAB is Kotlin.
With the help of multiple hands-on demos and case studies, you will learn how to craft Gradle plugins and tasks, how to integrate with the AGP APIs, and best practices for architecting, testing, and debugging Android builds. EAB explains not only "what" and "how", but also "why"—the art behind Gradle and AGP designs.
Featured by Gradle
- Featured in the official Gradle newsletter of the April 2024 issue and the May 2024 issue.
- Featured at KotlinConf 2024: The official Gradle booth recommended the book to the 3,000 attendees.
Visualized Architectures
AGP's evolution in last 5 years
Gradle Lifecycle
Plugin Classification
Real-World Case Studies
A Gradle Plugin for adding variant/version/git-commit-id/etc information to APK launcher icon.
An artifact repository to assist writing Gradle Plugins for Android build system.
A Gradle Plugin for Android BundleTool.
A Gradle Plugin for resolving AndroidManifest.xml merge conflicts
Be the First Book #1
Covering Gradle with Android Builds in Depth with Kotlin
Utilizing the AAPT2, KSP and Bytecode Manipulatros with Multiple Case Studies
Ranking #1 on Amazon Hot New Releases* (Category: Java, First Three Days)
After Reading It, You Can...
- Utilize the Kotlin language for both Gradle scripts and plugins.
- Author Gradle plugins/tasks with confidence while effectively interacting with AGP APIs and Gradle raw APIs.
- Monitor and modify various aspects of the Android build process, including resource files, source code, JVM bytecode, and even their combinations using AAPT2, Kotlin Symbol Processing (KSP), and multiple bytecode modifiers.
- Ensure that the plugin is both robust and low-cost to maintain, following the simple test pyramid.
- Adhere to the latest best practices in App architecture that align with many Gradle golden rules and offer extensibility for developers.
- Reduce the build time of the Android application and enhance the efficiency of their existing CI/CD workflows.
Table of Contents
- Chapter 1, Concepts and Little Handmade: Provides insight into Gradle and Android Gradle Plugin basics, alongside manual Android app creation.
- Chapter 2, Quick Start: Offers hands-on experience in structuring Gradle projects, understanding lifecycle, plugins, tasks, and creating a basic Gradle plugin for Slack notifications.
- Chapter 3, The Key of Extending Android Builds: Focuses on mastering Android Gradle Plugin's Variant and Artifact APIs for efficient and customizable builds.
- Chapter 4, Diving into the Gradle Raw APIs: Explores advanced Gradle raw API features like lifecycle hooks, lazy properties, task orchestration, and caching mechanisms.
- Chapter 5, Extension of Android Resources Build: Covers manipulation of Android resources through AGP Extensions, with insights into AAPT2 internals for optimized builds.
- Chapter 6, Extension of Source Code Build: Discusses manipulating source code through AGP Extensions and understanding Kotlin Symbol Processing (KSP) for code generation.
- Chapter 7, Extension of the JVM Bytecode Build: Explores JVM bytecode manipulation using AGP APIs and tools, including Aspect-oriented Programming (AOP) at the bytecode level.
- Chapter 8, Improving the Build Experience: Focuses on optimizing build experiences through analysis, performance tuning, and conditional plugin application.
To view a comprehensive TOC, please visit the books samples - TOC.
Is the Book Right for My Level
- Gradle: including a basic understanding of build scripts and dependency management.
- Android build process: including basic configuration of Android Gradle Plugin and regular build commands.
- Kotlin: basic syntax.
To make it specific, typical job roles for the primary readers are:
- 1 year experience (or above) as a Mobile Developers / Android Developers.
- 1 year experience (or above) as a Software Engineer and moved to a new role like Developer Experience (DX) Engineer / Developer Productivity Engineer / Release Engineer / Mobile Infrastructure Engineer / Tools & Foundation Engineer.
- Full-stack Java (or other JVM languages) Engineer / Full-stack Engineer who would like to try mobile development as well.
Overall, this book not only aids in mastering theoretical knowledge but also enhances practical skills, laying the groundwork for advancing to the next career level and opening up diverse professional pathways.
Ultimately, for beginner-level developers can take KOGE (open-soourced and free) as a preparatory material.
About Author
- El's Home Profile: https://2bab.com/
- X(Twitter): https://twitter.com/xx2bab/
- LinkedIn: https://linkedin.com/in/2bab/