All Projects → gradle → Android Cache Fix Gradle Plugin

gradle / Android Cache Fix Gradle Plugin

Licence: apache-2.0
Gradle plugin to fix Android caching problems

Programming Languages

groovy
2714 projects

Projects that are alternatives of or similar to Android Cache Fix Gradle Plugin

React Prerendered Component
🤔Partial hydration and caching in a pre-suspense era
Stars: ✭ 141 (-6%)
Mutual labels:  cache
Image Comparison
Published on Maven Central and jCenter Java Library that compares 2 images with the same sizes and shows the differences visually by drawing rectangles. Some parts of the image can be excluded from the comparison. Can be used for automation qa tests.
Stars: ✭ 145 (-3.33%)
Mutual labels:  gradle
Cachego
Golang Cache component - Multiple drivers
Stars: ✭ 148 (-1.33%)
Mutual labels:  cache
Segmentedcontrol
Android SegmentedControl + multi row support
Stars: ✭ 143 (-4.67%)
Mutual labels:  gradle
Nuster
A high performance HTTP proxy cache server and RESTful NoSQL cache server based on HAProxy
Stars: ✭ 1,825 (+1116.67%)
Mutual labels:  cache
Buildjar
通用的打包jar gradle插件
Stars: ✭ 147 (-2%)
Mutual labels:  gradle
Java Ddd Skeleton
♨️ DDD in Java skeleton & examples. Course:
Stars: ✭ 140 (-6.67%)
Mutual labels:  gradle
Jstarcraft Core
目标是提供一个通用的Java核心编程框架,作为搭建其它框架或者项目的基础. 让相关领域的研发人员能够专注高层设计而不用关注底层实现. 涵盖了缓存,存储,编解码,资源,脚本,监控,通讯,事件,事务9个方面.
Stars: ✭ 150 (+0%)
Mutual labels:  cache
Gradle Pitest Plugin
Gradle plugin for PIT Mutation Testing
Stars: ✭ 144 (-4%)
Mutual labels:  gradle
Android Advanced Blueprint
Android进阶蓝图,各种新技术的体验demo,快速上手Data Binding,Data Binding Compiler V2,Android Architecture,Room等Android的黑科技
Stars: ✭ 148 (-1.33%)
Mutual labels:  gradle
Androidutillib
🔥 旨在打造一款属于Android开发的强大工具库:内置各种开发必备工具类、Dialog封装、组件重写等
Stars: ✭ 143 (-4.67%)
Mutual labels:  gradle
Ngx Cache
Cache utility for Angular
Stars: ✭ 144 (-4%)
Mutual labels:  cache
Infoq Mini Book
Template project for creating an InfoQ Mini-Book with Asciidoctor
Stars: ✭ 147 (-2%)
Mutual labels:  gradle
Kotlin Gradle Plugin Template
🐘 A template to let you started with custom Gradle Plugins + Kotlin in a few seconds
Stars: ✭ 141 (-6%)
Mutual labels:  gradle
Preferenceholder
SharedPreference usage made fun in Kotlin
Stars: ✭ 148 (-1.33%)
Mutual labels:  gradle
Olric
Distributed cache and in-memory key/value data store. It can be used both as an embedded Go library and as a language-independent service.
Stars: ✭ 2,067 (+1278%)
Mutual labels:  cache
Gradle Aem Plugin
Swiss army knife for Adobe Experience Manager related automation. Environment setup & incremental AEM application build which takes seconds, not minutes.
Stars: ✭ 145 (-3.33%)
Mutual labels:  gradle
Xupdateservice
Use Spring Boot easy build, Gradle build, and provide update service for XUpdate.(使用Spring Boot简易搭建,Gradle构建,为XUpdate提供更新服务)
Stars: ✭ 149 (-0.67%)
Mutual labels:  gradle
Strapi Middleware Cache
🔌 A cache middleware for https://strapi.io
Stars: ✭ 146 (-2.67%)
Mutual labels:  cache
Google Java Format Gradle Plugin
Stars: ✭ 147 (-2%)
Mutual labels:  gradle

Android cache fix Gradle plugin

CI Plugin Portal

Some Android plugin versions have issues with Gradle's build cache feature. When applied to an Android project this plugin applies workarounds for these issues based on the Android plugin and Gradle versions.

  • Supported Gradle versions: 5.4.1+
  • Supported Android Gradle Plugin versions: 3.5.4, 3.6.4, 4.0.1, 4.1.2, 4.2.0-beta05, 7.0.0-alpha08
  • Supported Kotlin versions: 1.3.70+

We only test against the latest patch versions of each minor version of Android Gradle Plugin. This means that although it may work perfectly well with an older patch version (say 3.6.2), we do not test against these older patch versions, so the latest patch version is the only version from that minor release that we technically support.

The Android cache fix plugin is compatible with the Gradle Configuration Cache when used in conjunction with Android Gradle Plugin 4.2.0 and above. Using the configuration cache with earlier versions of the Android Gradle Plugin is not supported.

Should I use this?

Take a look at the list of issues especially unresolved issues. If any of these apply to your project, you can use this plugin to solve them.

How can I discover issues?

You can discover issues by using the task input comparison tool in Gradle Enterprise. More information about how to diagnose cache misses here. You can compare the inputs of a build that seeds the build cache - typically CI - with a build that consumes from the build cache like a local developer build. If you discover an issue related to the Android Gradle Plugin, please file an issue in the Android Bug Tracker. You can also file an issue here and we can see if a workaround is possible.

Applying the plugin

This plugin should be applied anywhere the com.android.application or com.android.library plugins are applied. Typically, this can just be injected from the root project's build.gradle (change '2.2.0' to the latest version of the cache fix plugin here):

Groovy
plugins {
    id "org.gradle.android.cache-fix" version "2.2.0" apply false
}

subprojects {
    plugins.withType(com.android.build.gradle.BasePlugin) {
        project.apply plugin: "org.gradle.android.cache-fix"
    }
}
Kotlin
plugins {
    id("org.gradle.android.cache-fix") version "2.1.2" apply false
}

subprojects {
    plugins.withType<com.android.build.gradle.BasePlugin>() {
        apply(plugin = "org.gradle.android.cache-fix")
    }
}

Note that if you are currently exporting schemas with the Room annotation processor, you will need to change how you specify the output directory according to the instructions here.

List of issues

You can take a look at the list of issues that the plugin fixes by looking at the classes in org.gradle.android.workarounds. It contains a number of Workaround implementations annotated with @AndroidIssue. The Javadoc has a short description of the problem, and the annotation gives information about when the problem was introduced, what is the first version of the Android plugin that fixes it, and there's a link to the issue on Android's issue tracker:

/**
 * Fix {@link org.gradle.api.tasks.compile.CompileOptions#getBootClasspath()} introducing relocatability problems for {@link AndroidJavaCompile}.
 */
@AndroidIssue(introducedIn = "3.0.0", fixedIn = "3.1.0-alpha06", link = "https://issuetracker.google.com/issues/68392933")
static class AndroidJavaCompile_BootClasspath_Workaround implements Workaround {
    // ...
}

Unresolved Issues

The following caching issues are fixed by the cache fix plugin but unresolved in any current or upcoming preview release of the Android Gradle Plugin as of 21.08.2020.

Please star them if you are experiencing them in your project.

Implementation Notes

RoomSchemaLocationWorkaround

Most of the workarounds in this plugin should apply to your project without any changes. However, one workaround requires some extra configuration. The Room schema location workaround allows you to specify an output directory for Room schema exports without breaking caching for your Java and/or Kapt tasks where the annotation processor has been configured. There are various issues with how this annotation processor works (see https://issuetracker.google.com/issues/132245929 and https://issuetracker.google.com/issues/139438151) which this workaround attempts to mitigate. However, in order to do so in a manageable way, it imposes some restrictions:

  • The schema export directory must be configured via the "room" project extension instead of as an explicit annotation processor argument. If an explicit annotation processor argument is provided, an exception will be thrown, instructing the user to configure it via the extension:
Groovy
room {
    schemaLocationDir = file("roomSchemas")
}
Kotlin
room {
    schemaLocationDir.set(file("roomSchemas"))
}
  • There can only be a single schema export directory for the project - you cannot configure variant-specific export directories. Schemas exported from different variants will be merged in the directory specified in the "room" extension.

MergeNativeLibsWorkaround, StripDebugSymbols, MergeJavaResources

It has been observed that caching the MergeNativeLibsTask, StripDebugSymbols, and MergeJavaResources tasks rarely provide any significant positive avoidance savings. In fact, the frequently provide negative savings, especially when fetched from a remote cache node. As such, these workarounds actually disable caching for these tasks.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].