/
build.gradle
95 lines (82 loc) · 2.27 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
plugins {
id 'java'
id 'jacoco'
id 'com.auth0.gradle.oss-library.java'
}
logger.lifecycle("Using version ${version} for ${group}.${name}")
oss {
name "java jwt"
repository "java-jwt"
organization "auth0"
description "Java implementation of JSON Web Token (JWT)"
baselineCompareVersion "3.18.2"
developers {
auth0 {
displayName = "Auth0"
email = "oss@auth0.com"
}
lbalmaceda {
displayName = "Luciano Balmaceda"
email = "luciano.balmaceda@auth0.com"
}
hzalaz {
displayName = "Hernan Zalazar"
email = "hernan@auth0.com"
}
}
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(11)
}
}
compileJava {
exclude 'module-info.java'
// Required to be compatible with JDK 8+
options.compilerArgs = ['--release', "8"]
}
javadoc {
// Exclude internal implementation package from javadoc
excludes = ['com/auth0/jwt/impl', 'module-info.java']
}
dependencies {
implementation 'com.fasterxml.jackson.core:jackson-databind:2.13.2.2'
testImplementation 'org.bouncycastle:bcprov-jdk15on:1.60'
testImplementation 'junit:junit:4.12'
testImplementation 'net.jodah:concurrentunit:0.4.3'
testImplementation 'org.hamcrest:java-hamcrest:2.0.0.0'
testImplementation 'org.mockito:mockito-core:2.18.3'
}
jacocoTestReport {
reports {
xml.enabled = true
html.enabled = true
}
}
test {
testLogging {
events "skipped", "failed", "standardError"
exceptionFormat "short"
}
}
task compileModuleInfoJava(type: JavaCompile) {
classpath = files()
source = 'src/main/java/module-info.java'
destinationDir = compileJava.destinationDir
doLast {
def descriptor = new File(compileJava.destinationDir, 'module-info.class')
def dest = new File(compileJava.destinationDir, 'META-INF/versions/9')
ant.move file: descriptor, todir: dest
}
doFirst {
options.compilerArgs = [
'--release', '9',
'--module-path', compileJava.classpath.asPath
]
}
}
jar {
manifest.attributes('Multi-Release': 'true')
}
compileModuleInfoJava.dependsOn compileJava
classes.dependsOn compileModuleInfoJava