Book Image

Gradle for Android

By : Kevin Pelgrims
Book Image

Gradle for Android

By: Kevin Pelgrims

Overview of this book

Table of Contents (16 chapters)
Gradle for Android
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Signing configurations


Before you can publish an app on Google Play or any other app store, you need to sign it with a private key. If you have a paid and free version or different apps for different clients, you need to sign every flavor with a different key. This is where signing configurations come in handy.

Signing configurations can be defined like this:

android {
    signingConfigs {
        staging.initWith(signingConfigs.debug)

        release {
            storeFile file("release.keystore")
            storePassword"secretpassword"
            keyAlias "gradleforandroid"
            keyPassword "secretpassword"
        }
    }
}

In this example, we create two different signing configurations.

The debug configuration is automatically set up by the Android plugin and makes use of a general keystore with a known password, so it is not necessary to create a signing configuration for this build type.

The staging configuration in the example uses initWith(), which copies all properties from...