Skip to content

Commit aa29ac3

Browse files
authored
Merge pull request #83 from thc202/japicmp-update
Update Gradle plugin for JApicmp
2 parents 3849e7a + 655bb30 commit aa29ac3

File tree

1 file changed

+14
-18
lines changed

1 file changed

+14
-18
lines changed

subprojects/zap-clientapi/zap-clientapi.gradle

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
plugins {
22
id "maven-publish"
33
id "signing"
4-
id "me.champeau.gradle.japicmp" version "0.2.6"
4+
id "me.champeau.gradle.japicmp" version "0.2.9"
55
id "org.owasp.dependencycheck" version "3.2.1"
66
}
77

@@ -25,29 +25,25 @@ jar {
2525
}
2626
}
2727

28-
configurations {
29-
japicmpBaseline
30-
}
31-
32-
dependencies {
33-
japicmpBaseline ("${project.group}:${project.name}:$versionBC") { force = true }
34-
}
35-
36-
dependencyCheck {
37-
skipConfigurations += "japicmpBaseline"
28+
File clientapiJar(version) {
29+
def oldGroup = group
30+
try {
31+
// https://discuss.gradle.org/t/is-the-default-configuration-leaking-into-independent-configurations/2088/6
32+
group = "virtual_group_for_japicmp"
33+
def conf = configurations.detachedConfiguration(dependencies.create("$oldGroup:$name:$version"))
34+
conf.transitive = false
35+
return conf.singleFile
36+
} finally {
37+
group = oldGroup
38+
}
3839
}
3940

4041
task japicmp(type: me.champeau.gradle.japicmp.JapicmpTask) {
4142
group 'verification'
4243
description "Checks artifacts' binary compatibility with latest (released) version '$versionBC'."
43-
// XXX Don't run by default with Java 9+, does not work (needs the module java.xml.bind).
44-
if (JavaVersion.current() == JavaVersion.VERSION_1_8) {
45-
check.dependsOn 'japicmp'
46-
}
47-
inputs.files(jar)
4844

49-
oldClasspath = configurations.japicmpBaseline
50-
newClasspath = configurations.runtimeClasspath + files(jar)
45+
oldClasspath = files(clientapiJar(versionBC))
46+
newClasspath = files(tasks.named(JavaPlugin.JAR_TASK_NAME).map { it.archivePath })
5147
onlyBinaryIncompatibleModified = true
5248
failOnModification = true
5349
ignoreMissingClasses = true

0 commit comments

Comments
 (0)