Skip to content

Commit

Permalink
removed oss extension
Browse files Browse the repository at this point in the history
  • Loading branch information
tanya732 committed Sep 16, 2024
1 parent 230bf51 commit 59e0144
Showing 1 changed file with 13 additions and 23 deletions.
36 changes: 13 additions & 23 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
}
}

Expand Down

0 comments on commit 59e0144

Please sign in to comment.