/
build.gradle
144 lines (120 loc) · 3.03 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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
plugins {
id 'java-library'
id 'jacoco'
id 'maven-publish'
id 'signing'
alias(libs.plugins.nexus)
alias(libs.plugins.versions)
alias(libs.plugins.errorprone)
alias(libs.plugins.eclipse)
}
group = 'com.github.tonivade'
ext.isReleaseVersion = !version.endsWith("SNAPSHOT")
jacoco {
toolVersion = '0.8.11'
}
repositories {
mavenLocal()
mavenCentral()
maven {
url = 'https://oss.sonatype.org/content/repositories/snapshots'
}
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
withJavadocJar()
withSourcesJar()
}
compileJava {
options.compilerArgs << '-Xlint:unchecked'
options.compilerArgs << '-Xlint:rawtypes'
options.release = 21
}
compileTestJava {
options.compilerArgs << '-Xlint:unchecked'
options.compilerArgs << '-Xlint:rawtypes'
options.release = 21
}
tasks.withType(JavaCompile) {
if (!name.toLowerCase().contains("test")) {
options.errorprone {
check("NullAway", net.ltgt.gradle.errorprone.CheckSeverity.ERROR)
option("NullAway:AnnotatedPackages", "com.github.tonivade.purecfg")
option("NullAway:SuggestSuppressions", "true")
}
} else {
options.errorprone.enabled = false
}
}
test {
useJUnitPlatform()
reports.html.required = true
}
dependencies {
errorprone libs.nullaway
errorprone libs.errorprone
annotationProcessor libs.purefunProcessor
api libs.purefunFree
implementation libs.purefunMonad
implementation libs.purefunEffect
runtimeOnly libs.purefunInstances
implementation libs.tomlj
testImplementation libs.purecheck
testImplementation libs.junitJupiter
testImplementation libs.junitRunner
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
pom {
name = 'PureCFG'
description = 'Pure Functional Configuration Library'
url = 'https://github.com/tonivade/purecfg'
inceptionYear = '2020'
scm {
url = 'https://github.com/tonivade/purecfg'
connection = 'scm:https://github.com/tonivade/purecfg.git'
developerConnection = 'scm:git://github.com/tonivade/purecfg.git'
}
licenses {
license {
name = 'The MIT License (MIT)'
url = 'https://github.com/tonivade/purecfg/blob/master/LICENSE'
distribution = 'repo'
}
}
developers {
developer {
id = 'tonivade'
name = 'Antonio Muñoz'
email = 'antoniogmc@gmail.com'
}
}
}
}
}
}
signing {
sign publishing.publications.mavenJava
}
tasks.withType(Sign) {
onlyIf { isReleaseVersion }
}
nexusPublishing {
repositories {
sonatype {
stagingProfileId = '19a96b937cdb5'
username = project.findProperty('nexusUsername')
password = project.findProperty('nexusPassword')
}
}
clientTimeout = Duration.ofSeconds(300)
connectTimeout = Duration.ofSeconds(60)
transitionCheckOptions {
maxRetries.set(40)
delayBetween.set(java.time.Duration.ofMillis(3000))
}
}