/
build.gradle
111 lines (89 loc) · 3.09 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
plugins {
id "net.ltgt.errorprone" version "3.1.0" apply false
// Gradle plugin to discover dependency updates
// <https://github.com/ben-manes/gradle-versions-plugin>
id "com.github.ben-manes.versions" version "0.48.0"
id "jacoco"
id "org.sonarqube" version "4.3.1.3277"
id "io.github.gradle-nexus.publish-plugin" version "1.3.0"
}
apply from: "./version.gradle"
allprojects {
apply plugin: "java"
apply plugin: "net.ltgt.errorprone"
sourceCompatibility = 17
targetCompatibility = 17
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
dependencies {
// https://github.com/google/error-prone
// https://errorprone.info/
errorprone "com.google.errorprone:error_prone_core:2.21.1"
// https://github.com/uber/NullAway
errorprone "com.uber.nullaway:nullaway:0.10.14"
// https://github.com/grpc/grpc-java-api-checker
errorprone "io.grpc:grpc-java-api-checker:1.1.0"
}
jacoco {
toolVersion = "0.8.8"
}
sonarqube {
properties {
property "sonar.projectKey", "hashgraph_hedera-sdk-java"
property "sonar.organization", "hashgraph"
property "sonar.host.url", "https://sonarcloud.io"
property "sonar.exclusions", "examples/**"
}
}
tasks.withType(Test) {
apply plugin: "jacoco"
}
tasks.withType(JavaCompile).configureEach {
options.encoding = "UTF-8"
// Disable warnings because I'm tired of them :P
options.warnings = false
options.errorprone {
// https://github.com/uber/NullAway
warn("NullAway")
option("NullAway:AnnotatedPackages", "com.hedera.hashgraph.sdk")
option("NullAway:TreatGeneratedAsUnannotated", "true")
// https://github.com/grpc/grpc-java-api-checker
disable("GrpcExperimentalApi")
warn("GrpcInternal")
// Enable _all_ error prone checks then selectively disble
// Checks that are default-disabled are enabled as warnings
allDisabledChecksAsWarnings = true
disable("TryFailRefactoring")
disable("ThrowSpecificExceptions")
disable("FutureReturnValueIgnored")
disable("FieldCanBeFinal")
disable("Finally")
disable("BooleanParameter")
disable("ThreadJoinLoop")
disable("UnnecessaryDefaultInEnumSwitch")
disable("UngroupedOverloads")
disable("InlineMeSuggester")
// Uncomment do disable Android + JDK7 checks
// disable("Java7ApiChecker")
// disable("AndroidJdkLibsChecker")
// Ignore generated and protobuf code
disableWarningsInGeneratedCode = true
excludedPaths = ".*generated.*"
}
}
}
nexusPublishing {
repositories {
sonatype {
}
}
}
tasks.register("showVersion") {
group = "versioning"
inputs.property("version", project.version)
doLast {
println(inputs.properties["version"])
}
}