1
- import net.ltgt.gradle.errorprone.errorprone
2
-
3
1
/* -
4
2
*
5
3
* Hedera Java SDK
@@ -23,7 +21,6 @@ import net.ltgt.gradle.errorprone.errorprone
23
21
plugins {
24
22
id(" java" )
25
23
id(" jacoco" )
26
- id(" net.ltgt.errorprone" )
27
24
id(" org.gradlex.java-module-dependencies" )
28
25
id(" com.hedera.gradle.base" )
29
26
id(" com.hedera.gradle.repositories" )
@@ -45,56 +42,26 @@ jvmDependencyConflicts {
45
42
consistentResolution.platform(" com.hedera.hashgraph:sdk-dependency-versions" )
46
43
}
47
44
48
- dependencies {
49
- // https://github.com/google/error-prone
50
- // https://errorprone.info/
51
- errorprone(" com.google.errorprone:error_prone_core:2.21.1" )
52
-
53
- // https://github.com/uber/NullAway
54
- errorprone(" com.uber.nullaway:nullaway:0.10.14" )
55
-
56
- // https://github.com/grpc/grpc-java-api-checker
57
- errorprone(" io.grpc:grpc-java-api-checker:1.1.0" )
58
- }
45
+ val deactivatedCompileLintOptions =
46
+ listOf (
47
+ " module" , // module not found when doing 'exports to ...'
48
+ " serial" , // serializable class ... has no definition of serialVersionUID
49
+ " processing" , // No processor claimed any of these annotations: ...
50
+ " try" , // auto-closeable resource ignore is never referenced... (AutoClosableLock)
51
+ " missing-explicit-ctor" , // class ... declares no explicit constructors
52
+ " removal" ,
53
+ " deprecation" ,
54
+ " overrides" , // overrides equals, but neither it ... overrides hashCode method
55
+ " unchecked" ,
56
+ " rawtypes" ,
57
+ " exports" ,
58
+ " dep-ann"
59
+ )
59
60
60
61
tasks.withType<JavaCompile >().configureEach {
61
62
options.encoding = " UTF-8"
62
-
63
- // Disable warnings because I'm tired of them :P
64
- options.isWarnings = false
65
-
66
- options.errorprone {
67
- // https://github.com/uber/NullAway
68
- warn(" NullAway" )
69
- option(" NullAway:AnnotatedPackages" , " com.hedera.hashgraph.sdk" )
70
- option(" NullAway:TreatGeneratedAsUnannotated" , " true" )
71
-
72
- // https://github.com/grpc/grpc-java-api-checker
73
- disable(" GrpcExperimentalApi" )
74
- warn(" GrpcInternal" )
75
-
76
- // Enable _all_ error prone checks then selectively disble
77
- // Checks that are default-disabled are enabled as warnings
78
- allDisabledChecksAsWarnings = true
79
- disable(" TryFailRefactoring" )
80
- disable(" ThrowSpecificExceptions" )
81
- disable(" FutureReturnValueIgnored" )
82
- disable(" FieldCanBeFinal" )
83
- disable(" Finally" )
84
- disable(" BooleanParameter" )
85
- disable(" ThreadJoinLoop" )
86
- disable(" UnnecessaryDefaultInEnumSwitch" )
87
- disable(" UngroupedOverloads" )
88
- disable(" InlineMeSuggester" )
89
-
90
- // Uncomment do disable Android + JDK7 checks
91
- // disable("Java7ApiChecker")
92
- // disable("AndroidJdkLibsChecker")
93
-
94
- // Ignore generated and protobuf code
95
- disableWarningsInGeneratedCode = true
96
- excludedPaths = " .*generated.*"
97
- }
63
+ options.compilerArgs.add(" -Werror" )
64
+ options.compilerArgs.add(" -Xlint:all,-" + deactivatedCompileLintOptions.joinToString(" ,-" ))
98
65
}
99
66
100
67
tasks.withType<AbstractArchiveTask >().configureEach {
0 commit comments