-
Notifications
You must be signed in to change notification settings - Fork 44
Expand file tree
/
Copy pathbuild.gradle
More file actions
133 lines (115 loc) · 4.02 KB
/
build.gradle
File metadata and controls
133 lines (115 loc) · 4.02 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
buildscript {
repositories {
jcenter()
}
dependencies {
// https://github.com/melix/japicmp-gradle-plugin/issues/36
classpath 'com.google.guava:guava:31.1-jre'
}
}
plugins {
id 'java'
id 'java-library'
id 'jacoco'
id 'me.champeau.gradle.japicmp' version '0.4.1'
}
repositories {
mavenCentral()
}
apply from: rootProject.file('gradle/versioning.gradle')
version = getVersionFromFile()
group = GROUP
logger.lifecycle("Using version ${version} for ${name} group $group")
import me.champeau.gradle.japicmp.JapicmpTask
project.afterEvaluate {
def versions = project.ext.testInJavaVersions
for (pluginJavaTestVersion in versions) {
def taskName = "testInJava-${pluginJavaTestVersion}"
tasks.register(taskName, Test) {
def versionToUse = taskName.split("-").getAt(1) as Integer
description = "Runs unit tests on Java version ${versionToUse}."
project.logger.quiet("Test will be running in ${versionToUse}")
group = 'verification'
javaLauncher.set(javaToolchains.launcherFor {
languageVersion = JavaLanguageVersion.of(versionToUse)
})
shouldRunAfter(tasks.named('test'))
}
tasks.named('check') {
dependsOn(taskName)
}
}
// project.configure(project) {
// def baselineVersion = project.ext.baselineCompareVersion
// task('apiDiff', type: JapicmpTask, dependsOn: 'jar') {
// oldClasspath.from(files(getBaselineJar(project, baselineVersion)))
// newClasspath.from(files(jar.archiveFile))
// onlyModified = true
// failOnModification = true
// ignoreMissingClasses = true
// htmlOutputFile = file("$buildDir/reports/apiDiff/apiDiff.html")
// txtOutputFile = file("$buildDir/reports/apiDiff/apiDiff.txt")
// doLast {
// project.logger.quiet("Comparing against baseline version ${baselineVersion}")
// }
// }
// }
}
//private static File getBaselineJar(Project project, String baselineVersion) {
// // Use detached configuration: https://github.com/square/okhttp/blob/master/build.gradle#L270
// def group = project.group
// try {
// def baseline = "${project.group}:${project.name}:$baselineVersion"
// project.group = 'virtual_group_for_japicmp'
// def dependency = project.dependencies.create(baseline + "@jar")
// return project.configurations.detachedConfiguration(dependency).files.find {
// it.name == "${project.name}-${baselineVersion}.jar"
// }
// } finally {
// project.group = group
// }
//}
ext {
//baselineCompareVersion = '1.5.0'
testInJavaVersions = [8, 11, 17, 21]
}
jacocoTestReport {
reports {
xml.required = true
html.required = true
}
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}
compileJava {
sourceCompatibility '17'
targetCompatibility '17'
}
test {
useJUnitPlatform()
testLogging {
events "skipped", "failed"
exceptionFormat "short"
}
}
dependencies {
implementation 'jakarta.servlet:jakarta.servlet-api:6.0.0'
implementation 'org.apache.commons:commons-lang3:3.12.0'
implementation 'com.google.guava:guava-annotations:r03'
implementation 'commons-codec:commons-codec:1.15'
api 'com.auth0:auth0:1.45.1'
api 'com.auth0:java-jwt:3.19.4'
api 'com.auth0:jwks-rsa:0.22.1'
testImplementation 'org.bouncycastle:bcprov-jdk15on:1.64'
testImplementation 'org.hamcrest:java-hamcrest:2.0.0.0'
testImplementation 'org.hamcrest:hamcrest-core:1.3'
testImplementation 'org.mockito:mockito-core:4.11.0'
testImplementation 'org.junit.jupiter:junit-jupiter:5.8.1'
testImplementation 'org.springframework:spring-test:6.0.14'
testImplementation 'org.springframework:spring-web:6.0.14'
testImplementation 'com.squareup.okhttp3:okhttp:4.11.0'
}
apply from: rootProject.file('gradle/maven-publish.gradle')