Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Mastering Android Studio 3

You're reading from   Mastering Android Studio 3 Build Dynamic and Robust Android applications

Arrow left icon
Product type Paperback
Published in Aug 2017
Publisher
ISBN-13 9781786467447
Length 220 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Kyle Mew Kyle Mew
Author Profile Icon Kyle Mew
Kyle Mew
Arrow right icon
View More author details
Toc

Gradle build configurations

As the reader will have seen, Gradle scripts generally have a single project (or root) file and one or more module level files:

Gradle scripts

We are told not to edit this file in comments in the root script; unless we have configuration options common to all modules, this is best left as-is.

Module-level scripts are of far more interest to us and the following is a breakdown of a typical one.

The first line simply declares the use of the Gradle plugin:

apply plugin: 'com.android.application'

Next, Android-targeted API level and build tools versions are declared:

android { 
    compileSdkVersion 27 
    buildToolsVersion "27.0.0" 

The default configuration settings define elements of the Android manifest file, and editing them here will be automatically reflected in the manifest after the next build or sync, as follows:

defaultConfig...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime