Skip to content

Commit f441357

Browse files
authored
Update README for v0.3
1 parent cdddc74 commit f441357

File tree

1 file changed

+28
-23
lines changed

1 file changed

+28
-23
lines changed

README.adoc

Lines changed: 28 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
= google-java-format-gradle-plugin
2-
:release-version: 0.2
3-
:default-google-java-format-version: 0.1-alpha
4-
:snapshot-version: 0.3-SNAPSHOT
2+
:release-version: 0.3
3+
:default-google-java-format-version: 1.0
4+
:snapshot-version: 0.4-SNAPSHOT
55

66

77
A https://github.com/gradle/gradle[Gradle] plugin that utilizes
@@ -55,11 +55,20 @@ $ ./gradlew verGJF
5555
[subs="attributes"]
5656
----
5757
googleJavaFormat {
58-
toolVersion '0.1-SNAPSHOT'
58+
toolVersion '1.1-SNAPSHOT'
5959
}
6060
----
6161

62-
* The predefined tasks `googleJavaFormat` and `verifyGoogleJavaFormat` by default process all `*.java` files found in the project or any subproject (except for files in a `buildDir`). If you want to exclude specific files from a predefined task you can use https://docs.gradle.org/2.0/javadoc/org/gradle/api/tasks/util/PatternFilterable.html[Ant-style exclude patterns].
62+
* Choose betweeen `'GOOGLE'` (default) and `'AOSP'` style by setting the style option (not supported in conjunction with `toolVersion` `v0.1-alpha`):
63+
+
64+
[source,groovy]
65+
----
66+
googleJavaFormat {
67+
options style: 'AOSP'
68+
}
69+
----
70+
71+
* The predefined tasks `googleJavaFormat` and `verifyGoogleJavaFormat` by default process all `*.java` files found in the project or any subproject (except for files in a `buildDir`). They are of type `https://docs.gradle.org/2.0/javadoc/org/gradle/api/tasks/SourceTask.html[SourceTask]` and can be configured accordingly. For example, if you want to exclude specific files from a predefined task you can use https://docs.gradle.org/2.0/javadoc/org/gradle/api/tasks/util/PatternFilterable.html[Ant-style exclude patterns].
6372
+
6473
[source,groovy]
6574
[subs="attributes"]
@@ -69,8 +78,19 @@ tasks.googleJavaFormat {
6978
exclude 'src/test/template_*'
7079
}
7180
----
81+
+
82+
You can also overwrite the default inputs and use your own rules (see `https://docs.gradle.org/current/userguide/working_with_files.html[Working With Files]`)
83+
+
84+
[source,groovy]
85+
[subs="attributes"]
86+
----
87+
tasks.verifyGoogleJavaFormat {
88+
setSource fileTree('subprojects')
89+
include '**/*.java'
90+
}
91+
----
7292

73-
* Define your own format or verification tasks, if the predefined ones don't suite you needs. Both task types `GoogleJavaFormat` and `VerifyGoogleJavaFormat` are subtypes of `https://docs.gradle.org/2.0/javadoc/org/gradle/api/tasks/SourceTask.html[SourceTask]` and can be configured accordingly. The task type `VerifyGoogleJavaFormat` also implements the interface `https://docs.gradle.org/2.0/javadoc/org/gradle/api/tasks/VerificationTask.html[VerificationTask]`.
93+
* Define your own format or verification tasks, if you need more than the predefined ones. The task type `VerifyGoogleJavaFormat` also implements the interface `https://docs.gradle.org/2.0/javadoc/org/gradle/api/tasks/VerificationTask.html[VerificationTask]`.
7494
+
7595
[source,groovy]
7696
----
@@ -91,6 +111,8 @@ task verifyFormatting(type: VerifyGoogleJavaFormat) {
91111
}
92112
----
93113

114+
115+
94116
== Snapshots
95117
On every push to the master branch https://travis-ci.org/[Travis] runs
96118
the tests and, if all tests pass, publishes the built artifact to
@@ -113,20 +135,3 @@ buildscript {
113135
}
114136
115137
apply plugin: 'com.github.sherter.google-java-format'
116-
----
117-
118-
=== New Features
119-
* Support for options:
120-
+
121-
[source,groovy]
122-
----
123-
googleJavaFormat {
124-
options <type>: <value>, <type>: <value>, ... // e.g. options style: 'AOSP'
125-
}
126-
----
127-
|===
128-
|option | possible values
129-
130-
|style
131-
|'GOOGLE', 'AOSP'
132-
|===

0 commit comments

Comments
 (0)