Jdroid Android Application Plugin - maxirosson/jdroid-gradle-plugin GitHub Wiki

Tasks

Build Script Dependencies Task

Verify Missing Translations Between Locales Task

Verify Missing Translations Task

Prefix Verification Task

Copy APKs Task

Versioning

Versioning

The plugin will automatically generate the version code and version name (in the case of an application project) and the library version (in the case of an android library project) following some best practices. It will also force to follow the Semantic Versioning guidelines. You can read more about this here.

In order to configure the version, you need to define 2 properties before the plugin apply.

The following example will generate the version name "1.2.3-SNAPSHOT" and version code "150010203" in the case of an application project or the version "1.2.3-SNAPSHOT" in the case of an android library project.

version = '1.2.3'
ext.VERSION_CLASSIFIER = "SNAPSHOT"

apply plugin: 'com.jdroid.android.application'
// or apply plugin: 'com.jdroid.android.library'

Configuration

VERSION_CODE_PREFIX

The prefix used to generate the version code. Optional Integer. The default value is the minimum SDK version value.

VERSION_CODE_EXTRA_BIT

The extra bit used to generate the version code. Required Integer. The default value is 0

Environment configuration

You can create a gradle.properties file on the root of the project to override the local environment configuration

Release build type enabled

Enable/disable the release build type to reduce building times. The default value is false

RELEASE_BUILD_TYPE_ENABLED = true
Minimum SDK version

Override the minimum SDK version. For example, if you use 21, the build will use the native Multi DEX implementation, improving the build time. The default value is 16

MIN_SDK_VERSION = 21
Resource prefix

The resource's prefix assigned to the library. No default value.

RESOURCE_PREFIX = 'myprefix'
Resource files to skip validation

The string list of resource's file names to ignore when validating prefixes. No default value.

RESOURCE_FILES_TO_SKIP_PREFIX_VALIDATION = ["analytics.xml", "com_crashlytics_export_strings.xml"]
Strict Mode

Enable/disable the Strict Mode. The default value is false

STRICT_MODE_ENABLED = true
Local IP

Development environment IP. Used to execute requests against local servers.

LOCAL_IP = 10.101.102
Java Max Heap Size

Specifies the -Xmx value when calling dx. The default value is "3g".

JAVA_MAX_HEAP_SIZE = "4g"
Max process count

The maximum number of concurrent processes that can be used to dex. The default value is 1. Be aware that the number of concurrent process times the memory requirement represent the minimum amount of memory that will be used by the dx processes: Total Memory = MAX_PROCESS_COUNT * JAVA_MAX_HEAP_SIZE

MAX_PROCESS_COUNT = 2
Pre dex libraries

Whether to pre-dex libraries. This can improve incremental builds, but clean builds may be slower. The default value is true.

PRE_DEX_LIBRARIES = false
Dex in process

Whether to run the dx compiler as a separate process or inside the Gradle daemon JVM. Running dx in-process can greatly improve performance, but is still experimental. The default value is false.

DEX_IN_PROCESS = true
Incremental compilation

Whether java compilation should use Gradle's new incremental model. The default value is true.

INCREMENTAL_COMPILATION_ENABLED = false
Jack Enabled

Whether to use Jack for compilation. The default value is false.

JACK_ENABLED = true
Signing Store File

Path to the release signing keystore file. The default value is './debug.keystore'

STORE_FILE = '/path/to/store/file.keystore'
Signing Store Password

Release signing password. No default value.

STORE_PASSWORD = 'mypass'
Signing Key Alias

Release signing key alias. No default value.

KEY_ALIAS = 'myalias'
Signing Key Password

Release signing key password. No default value.

KEY_PASSWORD = 'mypass'
Ribbonizer Enabled

Whether to enable or not the Ribbonizer plugin. The default value is true.

RIBBONIZER_ENABLED = false
Build Time Config Enabled

Whether to enable or not build time timestamp constant on BuildConfig. Enabling this will affect Instant Run. The default value is false.

BUILD_TIME_CONFIG_ENABLED = true
Publish non default

Whether to publish artifacts for all configurations, not just the default one. The default value is true.

PUBLISH_NON_DEFAULT = false
Splits disabled

Disable the android.splits.abi and android.splits.density flags. Useful to reduce building times on development. The default value is false

SPLITS_DISABLED = true
PNG Crunching disabled

Disable the PNG crunching. Useful to reduce building times on development. The default value is false

PNG_CRUNCHING_DISABLED = true
Res Configs

Configure the android.defaultConfig.resConfigs. The default value is null

RES_CONFIGS = ['en', 'es']
Debug resConfigs

Configure the android.defaultConfig.resConfigs, overriding the RES_CONFIGS property. Define just one language to reduce building times on development. The default value is null

DEBUG_RES_CONFIGS = en
Compile SDK Version

Configure the android.compileSdkVersion.

ANDROID_COMPILE_SDK_VERSION = 26
Target SDK Version

Configure the android.targetSdkVersion.

ANDROID_TARGET_SDK_VERSION = 26
Build Tools Version

Configure the android.buildToolsVersion.

ANDROID_BUILD_TOOLS_VERSION = '26.0.1'