You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.adoc
+28-23Lines changed: 28 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
= 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
5
5
6
6
7
7
A https://github.com/gradle/gradle[Gradle] plugin that utilizes
@@ -55,11 +55,20 @@ $ ./gradlew verGJF
55
55
[subs="attributes"]
56
56
----
57
57
googleJavaFormat {
58
-
toolVersion '0.1-SNAPSHOT'
58
+
toolVersion '1.1-SNAPSHOT'
59
59
}
60
60
----
61
61
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].
63
72
+
64
73
[source,groovy]
65
74
[subs="attributes"]
@@ -69,8 +78,19 @@ tasks.googleJavaFormat {
69
78
exclude 'src/test/template_*'
70
79
}
71
80
----
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
+
----
72
92
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]`.
0 commit comments