All Projects → yrom → Shrinker

yrom / Shrinker

Licence: apache-2.0
Inline constant fields of android R class by asm and transform-api

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Shrinker

Japicmp Gradle Plugin
A Gradle plugin for JApicmp
Stars: ✭ 101 (-16.53%)
Mutual labels:  gradle
Springcloud Quickstart
spring cloud demo based on gradle.
Stars: ✭ 111 (-8.26%)
Mutual labels:  gradle
Okbuck
OkBuck is a gradle plugin that lets developers utilize the Buck build system on a gradle project.
Stars: ✭ 1,513 (+1150.41%)
Mutual labels:  gradle
Jenkins Pipeline Shared Libraries Gradle Plugin
Gradle plugin to help with build and test of Jenkins Pipeline Shared Libraries (see https://jenkins.io/doc/book/pipeline/shared-libraries/)
Stars: ✭ 103 (-14.88%)
Mutual labels:  gradle
Fastdex
🚀 加快 apk 的编译速度 🚀
Stars: ✭ 1,457 (+1104.13%)
Mutual labels:  gradle
Marklogic Data Hub
The MarkLogic Data Hub: documentation ==>
Stars: ✭ 113 (-6.61%)
Mutual labels:  gradle
Android Gradle Localization Plugin
Gradle plugin for generating localized string resources
Stars: ✭ 100 (-17.36%)
Mutual labels:  gradle
Anychart Android
AnyChart Android Chart is an amazing data visualization library for easily creating interactive charts in Android apps. It runs on API 19+ (Android 4.4) and features dozens of built-in chart types.
Stars: ✭ 1,762 (+1356.2%)
Mutual labels:  gradle
Gradle Build Properties Plugin
Keep your secrets secret. External build properties support for your Gradle scripts.
Stars: ✭ 110 (-9.09%)
Mutual labels:  gradle
Liquidrefreshlayout
Liquid Refresh Layout is a simple SwipeToRefresh library that helps you easily integrate SwipeToRefresh and performs simple clean liquid animation
Stars: ✭ 114 (-5.79%)
Mutual labels:  gradle
Spring Cloud Microservices Development
Spring Cloud Microservices Development.《Spring Cloud 微服务架构开发实战》
Stars: ✭ 106 (-12.4%)
Mutual labels:  gradle
Goomph
IDE as build artifact
Stars: ✭ 108 (-10.74%)
Mutual labels:  gradle
Godot
Keep track of how much time you spend on Gradle builds
Stars: ✭ 113 (-6.61%)
Mutual labels:  gradle
Gradle Changelog Plugin
Plugin for parsing and managing the Changelog in a "keep a changelog" style.
Stars: ✭ 102 (-15.7%)
Mutual labels:  gradle
Android Readthefuckingsourcecode
😜 记录日常的开发技巧,开发中遇到的技术重点、难点,各个知识点的总结,优质面试题等等。持续更新...
Stars: ✭ 1,665 (+1276.03%)
Mutual labels:  gradle
Drawablecolorchange
Android Library to dynamically change color of drawable.
Stars: ✭ 101 (-16.53%)
Mutual labels:  gradle
Iron
Fast and easy to use NoSQL data storage with RxJava support
Stars: ✭ 112 (-7.44%)
Mutual labels:  gradle
Gnag
A Gradle plugin that helps facilitate GitHub PR checking and automatic commenting of violations.
Stars: ✭ 120 (-0.83%)
Mutual labels:  gradle
Clojurephant
Clojure and Clojurescript support for Gradle
Stars: ✭ 118 (-2.48%)
Mutual labels:  gradle
Easy Rating Dialog
A plug and play ;) android library for displaying a "rate this app" dialog
Stars: ✭ 113 (-6.61%)
Mutual labels:  gradle

Shrinker

Shrinker will remove all R.class and R$**.class and all constant integer fields will be inlined by asm and transform-api.

I have post more details on my own blog (in Chinese), click here to check it out.

Usage

version You can get shrinker from jitpack

To apply shrinker to your android application:

Step1. Add it in your buildscript section of app's build.gradle

buildscript {
    repositories {
        //...
        maven { url 'https://jitpack.io' }
    }

    dependencies {
        classpath 'net.yrom:shrinker:0.2.9'
    }
}

Step2. Apply it after the Android plugin

apply plugin: 'com.android.application'
//...
apply plugin: 'net.yrom.shrinker'

NOTE that shrinker plugin requires android gradle build tools version at least 3.0.0 and it will be disabled if run in debug build.

Show case

There is a small test application which depends on so many support libraries, would show how many fields shrinked.

Run with shrinker:

./gradlew :test:assembleRelease -PENABLE_SHRINKER

Run with removeUnusedCode:

android {
    buildTypes {
        release {
            ...
            postprocessing {
                removeUnusedCode = true
            }
        }
    }
    ...
}

Content below counts by dexcount-gradle-plugin

options methods fields classes
origin 22164 14367 2563
shrinker 21979 7805 2392
removeUnusedCode 11338 6655 1296
shrinker & removeUnusedCode 11335 3302 1274

License

Copyright 2017 Yrom

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
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].