https://github.com/marcoRS/lint-cleaner-plugin
A Gradle Plugin that removes unused resources in Android projects.
https://github.com/marcoRS/lint-cleaner-plugin
Last synced: about 1 year ago
JSON representation
A Gradle Plugin that removes unused resources in Android projects.
- Host: GitHub
- URL: https://github.com/marcoRS/lint-cleaner-plugin
- Owner: marcoRS
- License: apache-2.0
- Created: 2014-08-20T01:20:27.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2019-02-04T00:08:29.000Z (over 7 years ago)
- Last Synced: 2024-11-03T02:32:58.308Z (over 1 year ago)
- Language: Groovy
- Homepage:
- Size: 246 KB
- Stars: 703
- Watchers: 24
- Forks: 107
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.txt
Awesome Lists containing this project
- awesome-android-ui - https://github.com/marcoRS/lint-cleaner-plugin
README
#Lint Cleaner Plugin
[](https://maven-badges.herokuapp.com/maven-central/com.droidtitan/lint-cleaner-plugin) [](https://android-arsenal.com/details/1/877)
Removes unused resources reported by Android lint including strings, colors and dimensions.
## Depracated
As of Android Studio 2.0+ you can use `Refactor -> Remove Unused Resources`

## Usage
Apply the plugin in your `build.gradle`:
```groovy
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.12.+'
classpath 'com.droidtitan:lint-cleaner-plugin:0.3.0'
}
}
apply plugin: 'android'
apply plugin: 'com.droidtitan.lintcleaner'
```
Finally, to remove unused resources use:
gradle lintClean
## Optional Configuration using DSL
```groovy
lintCleaner {
// Exclude specific files
exclude = ['com_crashlytics_export_strings.xml','config.xml']
// Ability to ignore all resource files. False by default.
ignoreResFiles = true
// Default path is build/outputs/lint-results.xml
lintXmlFilePath = 'path/to/lint-results.xml'
}
```