forked from marianobarrios/tls-channel
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
151 lines (135 loc) · 4.22 KB
/
build.gradle
File metadata and controls
151 lines (135 loc) · 4.22 KB
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
plugins {
id 'java'
id 'jvm-test-suite'
id 'signing'
id 'maven-publish'
id "com.diffplug.spotless" version "7.2.1"
id "com.github.spotbugs" version "6.4.2"
}
compileJava {
options.release = 8
// for some reason javac warns the previous option, disabling
options.compilerArgs.add('-Xlint:all,-options')
}
compileTestJava {
options.release = 8
// for some reason javac warns the previous option, disabling
options.compilerArgs.add('-Xlint:all,-options,-try')
}
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
// log
testImplementation 'org.slf4j:jul-to-slf4j:2.0.17'
testRuntimeOnly 'ch.qos.logback:logback-classic:1.3.14'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.13.4'
}
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")
}
}
}
var testJavaToolchain = System.getenv('TEST_JAVA_TOOLCHAIN')
testing {
suites {
test {
useJUnitJupiter()
targets {
all {
testTask.configure {
if (testJavaToolchain != null) {
javaLauncher.set(
javaToolchains.launcherFor {
languageVersion.set(JavaLanguageVersion.of(testJavaToolchain))
}
)
}
// 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 = 'marbar@gmail.com'
}
}
scm {
connection = 'scm:git@github.com:marianobarrios/tlschannel.git'
developerConnection = 'scm:git:ssh://example.com/my-library.git'
url = 'scm:git@github.com: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
}