File tree Expand file tree Collapse file tree 3 files changed +42
-11
lines changed Expand file tree Collapse file tree 3 files changed +42
-11
lines changed Original file line number Diff line number Diff line change @@ -63,6 +63,12 @@ Firebase Android libraries exercise all three types of tests recommended by the
63
63
Depending on the requirements of the specific project, some or all of these
64
64
tests may be used to support changes.
65
65
66
+ > :warning : ** Running tests with errorprone**
67
+ >
68
+ > To run with errorprone add ` withErrorProne ` to the command line, e.g.
69
+ >
70
+ > ` ./gradlew :<firebase-project>:check withErrorProne ` .
71
+
66
72
### Unit Testing
67
73
68
74
These are tests that run on your machine's local Java Virtual Machine (JVM). At
Original file line number Diff line number Diff line change @@ -43,12 +43,11 @@ buildscript {
43
43
}
44
44
45
45
apply from : ' sdkProperties.gradle'
46
+ apply from : " gradle/errorProne.gradle"
46
47
47
48
ext {
48
49
playServicesVersion = ' 16.0.1'
49
50
supportAnnotationsVersion = ' 28.0.0'
50
- errorproneVersion = ' 2.3.2'
51
- errorproneJavacVersion = ' 9+181-r4173-1'
52
51
googleTruthVersion = ' 0.45'
53
52
robolectricVersion = ' 4.1'
54
53
}
@@ -72,12 +71,7 @@ configure(subprojects) {
72
71
jcenter()
73
72
mavenLocal()
74
73
}
75
- apply plugin : ' net.ltgt.errorprone'
76
- dependencies {
77
- errorprone " com.google.errorprone:error_prone_core:$errorproneVersion "
78
- errorproneJavac " com.google.errorprone:javac:$errorproneJavacVersion "
79
74
80
- }
81
75
apply plugin : ' com.github.sherter.google-java-format'
82
76
googleJavaFormat {
83
77
toolVersion = ' 1.7'
@@ -99,10 +93,6 @@ configure(subprojects) {
99
93
exclude ' **/package-info.java'
100
94
}
101
95
102
- tasks. withType(JavaCompile ) {
103
- options. errorprone. excludedPaths = ' .*/build/generated/.*'
104
- }
105
-
106
96
apply plugin : " org.jlleitschuh.gradle.ktlint"
107
97
}
108
98
Original file line number Diff line number Diff line change
1
+ // Copyright 2020 Google LLC
2
+ //
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+
15
+ def isErrorProneRequested = getGradle(). getStartParameter(). getTaskNames(). contains(" withErrorProne" )
16
+
17
+ def errorproneVersion = ' 2.3.2'
18
+ def errorproneJavacVersion = ' 9+181-r4173-1'
19
+
20
+ if (isErrorProneRequested) {
21
+ configure(subprojects) {
22
+ apply plugin : ' net.ltgt.errorprone'
23
+ dependencies {
24
+ errorprone " com.google.errorprone:error_prone_core:$errorproneVersion "
25
+ errorproneJavac " com.google.errorprone:javac:$errorproneJavacVersion "
26
+
27
+ }
28
+ tasks. withType(JavaCompile ) {
29
+ options. errorprone. excludedPaths = ' .*/build/generated/.*'
30
+ }
31
+ }
32
+ }
33
+
34
+ // marker task to enable errorprone diagnostics.
35
+ task withErrorProne {}
You can’t perform that action at this time.
0 commit comments