Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/f2prateek/gradle-android-javafmt-plugin
Augomagically format Java files (deprecated)
https://github.com/f2prateek/gradle-android-javafmt-plugin
Last synced: 21 days ago
JSON representation
Augomagically format Java files (deprecated)
- Host: GitHub
- URL: https://github.com/f2prateek/gradle-android-javafmt-plugin
- Owner: f2prateek
- License: apache-2.0
- Created: 2017-02-28T02:28:48.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-08-28T23:48:24.000Z (about 6 years ago)
- Last Synced: 2024-10-14T16:31:08.579Z (about 1 month ago)
- Language: Groovy
- Homepage:
- Size: 124 KB
- Stars: 58
- Watchers: 3
- Forks: 8
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.txt
Awesome Lists containing this project
README
Android Javafmt Plugin
=========================Deprecated: I recommend using https://github.com/diffplug/spotless
A plugin that formats your code using [google-java-format](https://github.com/google/google-java-format).
Usage
-----Apply the plugin in your `build.gradle`:
```groovy
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.f2prateek.javafmt:javafmt:0.1.6'
}
}apply plugin: 'com.f2prateek.javafmt'
```Run `./gradlew fmt` to format your files. This also runs when you call `./gradlew assemble`.
Run `./gradlew checkFmt` to verify your files are formatted. This also runs when you call `./gradlew check`.
Configuration
-----To use 4 space indents instead of 2 space indents add this to your `build.gradle`:
```groovy
javafmt {
style 'AOSP'
}
```By default google-java-format version 1.3 is used. To change that you can explicitly add it to your dependencies.
```groovy
dependencies {
javafmt "com.google.googlejavaformat:google-java-format:${version}"
}
```License
--------Copyright 2017 Prateek Srivastava
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 athttp://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.