-
Notifications
You must be signed in to change notification settings - Fork 0
/
compatibility.gradle
61 lines (52 loc) · 1.96 KB
/
compatibility.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
import me.champeau.gradle.japicmp.JapicmpTask
buildscript {
dependencies {
classpath "me.champeau.gradle:japicmp-gradle-plugin:$versions.jApiCmp"
}
repositories {
gradlePluginPortal()
}
}
def compatibleVersion = '3.0.0-beta01'
def failIfIncompatible = true
subprojects { subproject ->
afterEvaluate {
if (!subproject.hasProperty('artifact'))
return
configurations {
baseline
latest
}
dependencies {
baseline("$publishedGroupId:$artifact:$compatibleVersion") {
transitive false
force true
for (module in subproject.ext.compatibility.excludedModules)
exclude module: module
}
latest(project(path: ":$project.name", configuration: 'releaseRuntimeElements')) {
for (module in subproject.ext.compatibility.excludedModules)
exclude module: module
}
}
subproject.apply plugin: 'me.champeau.gradle.japicmp'
task japicmp(type: JapicmpTask) {
oldClasspath = configurations.baseline.incoming.artifactView { config ->
config.attributes { container ->
container.attribute(Attribute.of("artifactType", String.class), "jar")
}
}.artifacts.artifactFiles
newClasspath = configurations.latest.incoming.artifactView { config ->
config.attributes { container ->
container.attribute(Attribute.of("artifactType", String.class), "jar")
}
}.artifacts.artifactFiles
onlyBinaryIncompatibleModified true
failOnModification failIfIncompatible
txtOutputFile = file("$buildDir/reports/japi.txt")
ignoreMissingClasses subproject.ext.compatibility.ignoreMissingClasses
}
check.dependsOn(japicmp)
build.dependsOn(check)
}
}