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
default
flavor dimension is created - The
applicationIsSuffix
of each flavor (exceptprod
) is set to.{flavor}
- Enable the generation of the
BuildConfig
class - Adds a boolean flag
IS_FLAVOR_<FLAVOR_NAME>
to theBuildConfig
for each flavor - Configures the
release
buildType to enable ProGuard - Ensures that R8 full mode is either disabled or explicitly enabled
- Excludes
META-INF/*.version
packaging resources fromrelease
builds - Sets the
sourceCompatibility
andtargetCompatibility
to Java 17 - Sets the Kotlin
jvmTarget
to Java 17 - Sets the
isAbortOnError
flag 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.properties
file in the module or project rootreadProperty(propertyName)
for nullable propertiesreadPropertyWithDefault(propertyName, defaultValue)
for non-nullable properties
plugins {
id("ch.ubique.gradle.preset") version "8.7.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.