-
Notifications
You must be signed in to change notification settings - Fork 50
/
build.gradle
154 lines (134 loc) · 3.9 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
145
146
147
148
149
150
151
152
153
154
plugins {
id 'java'
id 'signing'
id 'maven-publish'
id "com.diffplug.spotless" version "6.25.0"
id "com.github.spotbugs" version "6.0.26"
}
var javaToolchain = System.getenv('JAVA_TOOLCHAIN')
java {
// If running from CI, the tool chain will be present
if (javaToolchain != null) {
toolchain {
languageVersion = JavaLanguageVersion.of(javaToolchain)
}
}
}
compileJava {
if (javaToolchain != "8") {
options.release = 8
}
options.compilerArgs.add('-Xlint')
}
compileTestJava {
if (javaToolchain != "8") {
options.release = 8
}
options.compilerArgs.add('-Xlint')
}
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
// log
testImplementation 'org.slf4j:jul-to-slf4j:2.0.16'
testRuntimeOnly 'ch.qos.logback:logback-classic:1.3.14'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.11.3'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.11.3'
}
spotless {
java {
// remove when spotless moved to this Palantir version
palantirJavaFormat("2.38.0")
}
}
spotbugs {
ignoreFailures = false
showProgress = true
reportsDir = file("$buildDir/spotbugs")
}
spotbugsMain {
excludeFilter = file('spotbugs-exclude.xml')
reports {
html {
required = true
outputLocation = file("$buildDir/reports/spotbugs/spotbugs.html")
}
}
}
spotbugsTest {
excludeFilter = file('spotbugs-exclude-tests.xml')
reports {
html {
required = true
outputLocation = file("$buildDir/reports/spotbugs/spotbugsTest.html")
}
}
}
test {
useJUnitPlatform()
// override security properties enabling all options
systemProperty "java.security.properties", "java.security.override"
systemProperty "junit.jupiter.extensions.autodetection.enabled", "true"
}
javadoc {
exclude "tlschannel/impl"
exclude "tlschannel/util"
}
java {
withSourcesJar()
withJavadocJar()
}
// see tlschannel.AllocationTest for comment about this
task allocationTest(type: JavaExec) {
classpath = sourceSets.test.runtimeClasspath
mainClass = 'tlschannel.AllocationTest'
jvmArgs = ['-XX:+UnlockExperimentalVMOptions', '-XX:+UseEpsilonGC']
}
check.dependsOn allocationTest
publishing {
publications {
tlschannel(MavenPublication) {
groupId = 'com.github.marianobarrios'
artifactId = 'tls-channel'
version = '0.10.0-SNAPSHOT'
from components.java
pom {
name = 'TLS Channel'
description = 'A Java library that implements a ByteChannel interface over SSLEngine, ' +
'enabling easy-to-use (socket-like) TLS for Java applications. '
url = 'https://github.com/marianobarrios/tls-channel'
licenses {
license {
name = 'MIT License'
url = 'https://opensource.org/licenses/MIT'
}
}
developers {
developer {
name = 'Mariano Barrios'
email = '[email protected]'
}
}
scm {
connection = 'scm:[email protected]:marianobarrios/tlschannel.git'
developerConnection = 'scm:git:ssh://example.com/my-library.git'
url = 'scm:[email protected]:marianobarrios/tlschannel.git'
}
}
}
}
repositories {
maven {
url = 'https://oss.sonatype.org/service/local/staging/deploy/maven2/'
credentials {
username = project.findProperty('sonatypeUsername')
password = project.findProperty('sonatypePassword')
}
}
}
}
signing {
sign publishing.publications.tlschannel
}