From 59e0144fecdc2cbee6561a41ded4bc8bb3477c2b Mon Sep 17 00:00:00 2001 From: tanya-sinha_atko Date: Mon, 16 Sep 2024 09:50:42 +0530 Subject: [PATCH] removed oss extension --- build.gradle | 36 +++++++++++++----------------------- 1 file changed, 13 insertions(+), 23 deletions(-) diff --git a/build.gradle b/build.gradle index 0e5c2e31..b57ff2da 100644 --- a/build.gradle +++ b/build.gradle @@ -47,29 +47,19 @@ compileTestJava { } // Define or replace this method with the actual implementation -def getBaselineJar(Project project, String baselineVersion) { - file("${project.buildDir}/libs/${project.name}-${baselineVersion}.jar") -} - -project.afterEvaluate { - def lib = project.extensions.findByName('oss') - if (lib?.baselineCompareVersion) { - project.configure(project) { - task('apiDiff', type: JapicmpTask, dependsOn: 'jar') { - oldClasspath = files(getBaselineJar(project, lib.baselineCompareVersion)) - newClasspath = 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 ${lib.baselineCompareVersion}") - } - } - } - } else { - project.logger.warn("The 'oss' extension or 'baselineCompareVersion' property is not defined.") +def baselineJarPath = file("$buildDir/libs/baseline-version.jar") + + +task('apiDiff', type: JapicmpTask, dependsOn: 'jar') { + oldClasspath = files(baselineJarPath) + newClasspath = 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 ${lib.baselineCompareVersion}") } }