-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathbuild.gradle.kts
50 lines (44 loc) · 1.63 KB
/
build.gradle.kts
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
import me.champeau.gradle.japicmp.JapicmpTask
plugins {
id("me.champeau.gradle.japicmp") version "0.4.2"
}
repositories {
mavenCentral()
}
tasks.register("test-everything") {
description = "Runs the tests of every subproject, for all Java versions."
for (subproject in subprojects) {
val testTasks = subproject.tasks.withType(Test::class)
dependsOn(testTasks)
}
}
tasks.register<JapicmpTask>("japicmp") {
val previousJars = fileTree("${rootProject.projectDir}/japicmp-previous-version").filter { it.extension == "jar" }
val newJars = files(
project(":core").tasks.named("jar"),
project(":hocon").tasks.named("jar"),
project(":json").tasks.named("jar"),
project(":toml").tasks.named("jar"),
project(":yaml").tasks.named("jar"),
)
oldClasspath.from(previousJars)
newClasspath.from(newJars)
htmlOutputFile = layout.buildDirectory.file("reports/japicmp.html")
onlyBinaryIncompatibleModified = true
failOnSourceIncompatibility = true
// Backward-compatible changes are OK.
// See https://github.com/siom79/japicmp/blob/master/japicmp/src/main/java/japicmp/model/JApiCompatibilityChange.java
val excludedChanges = japicmp.model.JApiCompatibilityChange.values().filter {
it.isSourceCompatible() && it.isBinaryCompatible()
}.map {
it.name
} + listOf("METHOD_NEW_DEFAULT")
val excludedClasses = listOf(
"com.electronwill.nightconfig.core.file.FileConfigBuilder",
"com.electronwill.nightconfig.core.file.CommentedFileConfigBuilder",
)
logger.info("japicmp excluded changes: $excludedChanges")
logger.info("japicmp excluded classes: $excludedClasses")
compatibilityChangeExcludes = excludedChanges
classExcludes = excludedClasses
}