Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Java-MVC-V2-Base-PR #154

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ jobs:
java-version: 8
- uses: gradle/gradle-build-action@a4cf152f482c7ca97ef56ead29bf08bcd953284c
with:
arguments: assemble apiDiff check jacocoTestReport --continue --console=plain
# arguments: assemble apiDiff check jacocoTestReport --continue --console=plain
arguments: assemble check jacocoTestReport --continue --console=plain
- uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d
with:
flags: unittests
Expand Down
60 changes: 30 additions & 30 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,40 +47,40 @@ project.afterEvaluate {
}
}

project.configure(project) {
def baselineVersion = project.ext.baselineCompareVersion
task('apiDiff', type: JapicmpTask, dependsOn: 'jar') {
oldClasspath.from(files(getBaselineJar(project, baselineVersion)))
newClasspath.from(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 ${baselineVersion}")
}
}
}
// project.configure(project) {
// def baselineVersion = project.ext.baselineCompareVersion
// task('apiDiff', type: JapicmpTask, dependsOn: 'jar') {
// oldClasspath.from(files(getBaselineJar(project, baselineVersion)))
// newClasspath.from(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 ${baselineVersion}")
// }
// }
// }
}

private static File getBaselineJar(Project project, String baselineVersion) {
// Use detached configuration: https://github.com/square/okhttp/blob/master/build.gradle#L270
def group = project.group
try {
def baseline = "${project.group}:${project.name}:$baselineVersion"
project.group = 'virtual_group_for_japicmp'
def dependency = project.dependencies.create(baseline + "@jar")
return project.configurations.detachedConfiguration(dependency).files.find {
it.name == "${project.name}-${baselineVersion}.jar"
}
} finally {
project.group = group
}
}
//private static File getBaselineJar(Project project, String baselineVersion) {
// // Use detached configuration: https://github.com/square/okhttp/blob/master/build.gradle#L270
// def group = project.group
// try {
// def baseline = "${project.group}:${project.name}:$baselineVersion"
// project.group = 'virtual_group_for_japicmp'
// def dependency = project.dependencies.create(baseline + "@jar")
// return project.configurations.detachedConfiguration(dependency).files.find {
// it.name == "${project.name}-${baselineVersion}.jar"
// }
// } finally {
// project.group = group
// }
//}

ext {
baselineCompareVersion = '1.5.0'
//baselineCompareVersion = '1.5.0'
testInJavaVersions = [8, 11, 17, 21]
}

Expand Down
Loading