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
versionCode
andversionName
empty. It will use the amount of commits on the current branch as a version code andgit describe
for a uniquely identifiable version name. -
BuildConfig.INTERNAL
In addition toBuildConfig.DEBUG
you can useINTERNAL
for 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
preview
This 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.DEBUG
for logging purposes and other low-key features, while you can useBuildConfig.INTERNAL
for 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
. -
neverBuildRelease
This 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
packagingOptions
and prevent lint errors to break the build.
- have
git
installed and on your path - specify
keyStore
in your globalgradle.properties
with the path to a shared debug key