Reader small image

You're reading from  Mastering Android Studio 3

Product typeBook
Published inAug 2017
Reading LevelIntermediate
Publisher
ISBN-139781786467447
Edition1st Edition
Languages
Right arrow
Author (1)
Kyle Mew
Kyle Mew
author image
Kyle Mew

Kyle Mew has been programming since the early '80s and has written for several technology websites. Also, he has written three radio plays and four other books on Android development.
Read more about Kyle Mew

Right arrow

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 page is locked
Previous PageNext Page
You have been reading a chapter from
Mastering Android Studio 3
Published in: Aug 2017Publisher: ISBN-13: 9781786467447

Author (1)

author image
Kyle Mew

Kyle Mew has been programming since the early '80s and has written for several technology websites. Also, he has written three radio plays and four other books on Android development.
Read more about Kyle Mew