This plugin enables us (aaa) to facilitate our internal test and release workflows by having a common, shared build setup.
-
Git versioning To support CI / CD you can leave
versionCodeandversionNameempty. It will use the amount of commits on the current branch as a version code andgit describefor a uniquely identifiable version name. -
BuildConfig.INTERNALIn addition toBuildConfig.DEBUGyou can useINTERNALfor setup test data, add shortcuts, or include debug options. These should be features that you want during development, that should not end up in any users hands. -
Build type
previewThis is a pre-release build type for testing. It should have the same setup asrelease, with the only difference that debugging is enabled. This lets you useBuildConfig.DEBUGfor logging purposes and other low-key features, while you can useBuildConfig.INTERNALfor more intrusive debug features. -
Shared debug key Projects will use a shared debug key with the path specified in your (global)
gradle.properties. This ensures the same signing configuration between developer machines. -
Release key setup from properties To have a reusable CI setup the release key can be specified using
releaseKeyStore_file,releaseKeyStore_password,releaseKeyStore_alias, andreleaseKeyStore_keyPassword. These can be set as gradle properties or specified by environment variables, e.g.ORG_GRADLE_PROJECT_releaseKeyStore_password. -
neverBuildReleaseThis option for flavors lets you exclude a flavor from release builds, e.g. your development or staging environments.productFlavors { development { ext.neverBuildRelease = true } } -
APK renaming We use a consistent naming for our artifacts:
{name}-{variant}{split}-vc{versionCode}-{versionName} -
AAB renaming We use a consistent naming for our artifacts:
{name}-{variant}-vc{versionCode}-{versionName} -
Exclude some common conflict files while with
packagingOptionsand prevent lint errors to break the build.
- have
gitinstalled and on your path - specify
keyStorein your globalgradle.propertieswith the path to a shared debug key