This gradle plugin applies a preset of configurations we use at Ubique to an Android project.
The following configurations are applied by this plugin:
- A
defaultflavor dimension is created - The
applicationIdSuffixof each flavor (exceptprod) is set to.{flavor} - Enable the generation of the
BuildConfigclass - Adds a boolean flag
IS_FLAVOR_<FLAVOR_NAME>to theBuildConfigfor each flavor - Configures the
releasebuildType to enable ProGuard - Ensures that R8 full mode is either disabled or explicitly enabled
- Excludes
META-INF/*.versionpackaging resources fromreleasebuilds - Sets the
sourceCompatibilityandtargetCompatibilityto Java 17 - Sets the Kotlin
jvmTargetto Java 17 - Sets the Kotlin compiler flag
-Xannotation-default-target=param-property - Sets the
abortOnErrorflag of thelintoptions to false
In addition to automatically applying a preset configuration, this plugin also provides a few utility functions for usage in build scripts:
- Methods to read a property from either the project properties or a
local.propertiesfile in the module or project rootreadProperty(propertyName)for nullable propertiesreadPropertyWithDefault(propertyName, defaultValue)for non-nullable properties
plugins {
id("ch.ubique.gradle.preset") version "9.0.0"
}The major and minor version goes in lockstep with the Android Gradle Plugin, also see Releases.
Create a Release,
setting the Tag to the desired version prefixed with a v.
Each release on Github will be deployed to Maven Central.