forked from marianobarrios/tls-channel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
165 lines (146 loc) · 4.68 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
155
156
157
158
159
160
161
162
163
164
165
plugins {
id 'java'
id 'scala'
id 'signing'
id 'maven-publish'
id "com.diffplug.spotless" version "6.11.0"
// pinned version due to https://github.com/spotbugs/spotbugs/issues/2041
id "com.github.spotbugs" version "5.0.13"
}
compileJava {
if (JavaVersion.current().ordinal() > JavaVersion.VERSION_1_8.ordinal()) {
options.compilerArgs.addAll(['--release', '8', '-Xlint'])
}
}
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
// log
implementation 'org.slf4j:slf4j-api:2.0.6'
testRuntimeOnly 'ch.qos.logback:logback-classic:1.3.4'
testImplementation 'org.scala-lang:scala3-library_3:3.2.2'
testImplementation 'com.typesafe.scala-logging:scala-logging_3:3.9.5'
// pinned due to netty-tcnative-boringssl-static being pinned
testImplementation 'io.netty:netty-buffer:4.1.73.Final'
testImplementation 'io.netty:netty-handler:4.1.73.Final'
// pinned: https://github.com/netty/netty-tcnative/issues/716
testRuntimeOnly 'io.netty:netty-tcnative-boringssl-static:2.0.47.Final'
// required by ScalaTest
testRuntimeOnly 'com.vladsch.flexmark:flexmark-all:0.64.0'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.2'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.2'
}
spotless {
java {
palantirJavaFormat()
}
scala {
scalafmt('3.5.9').configFile('.scalafmt.conf')
}
}
// There are some compatibility issues with spotless older Java versions,
// but we don't need to cross-do style checks anyway
if (JavaVersion.current().ordinal() < JavaVersion.VERSION_17.ordinal()) {
tasks.findByName("spotlessScala").enabled(false)
tasks.findByName("spotlessJava").enabled(false)
}
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")
}
}
}
compileScala {
options.compilerArgs = [
"-language:implicitConversions",
"-Xlint",
"-deprecation",
"-Xfatal-warnings"
]
}
test {
useJUnitPlatform()
// override security properties enabling all options
systemProperty "java.security.properties", "java.security.override"
}
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']
}
if (JavaVersion.current().ordinal() >= JavaVersion.VERSION_11.ordinal()) {
check.dependsOn allocationTest
}
publishing {
publications {
tlschannel(MavenPublication) {
groupId = 'com.github.marianobarrios'
artifactId = 'tls-channel'
version = '0.7.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
}