File tree 1 file changed +12
-0
lines changed
conventions/src/main/kotlin
1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,10 @@ fun findArtifact(version: String): File {
47
47
}
48
48
}
49
49
50
+ fun getMajorVersion (version : String ): Int {
51
+ return version.substringBefore(' .' ).toInt()
52
+ }
53
+
50
54
// generate the api diff report for any module that is stable
51
55
if (project.findProperty(" otel.stable" ) == " true" ) {
52
56
afterEvaluate {
@@ -66,6 +70,14 @@ if (project.findProperty("otel.stable") == "true") {
66
70
// the japicmp "old" version is either the user-specified one, or the latest release.
67
71
val apiBaseVersion: String? by project
68
72
val baselineVersion = apiBaseVersion ? : latestReleasedVersion
73
+ if (apiBaseVersion == null && apiNewVersion == null ) {
74
+ val baseMajor = getMajorVersion(baselineVersion)
75
+ val projectMajor = getMajorVersion(project.version as String )
76
+ // disable japicmp when project major version is behind major version of latest release,
77
+ // if that is the case we are building a patch for the previous release
78
+ enabled = projectMajor >= baseMajor
79
+ }
80
+
69
81
oldClasspath.from(
70
82
try {
71
83
files(findArtifact(baselineVersion))
You can’t perform that action at this time.
0 commit comments