1- buildscript {
2- repositories {
3- jcenter()
4- }
5-
6- dependencies {
7- // https://github.com/melix/japicmp-gradle-plugin/issues/36
8- classpath ' com.google.guava:guava:31.1-jre'
9- }
10- }
11-
121plugins {
132 id ' java'
143 id ' java-library'
154 id ' jacoco'
16- id ' me.champeau.gradle.japicmp' version ' 0.4.6'
175 id ' io.github.gradle-nexus.publish-plugin' version ' 2.0.0'
186}
197
@@ -27,61 +15,7 @@ version = getVersionFromFile()
2715group = GROUP
2816logger. lifecycle(" Using version ${ version} for ${ name} group $group " )
2917
30- import me.champeau.gradle.japicmp.JapicmpTask
31-
32- // project.afterEvaluate {
33- // def versions = project.ext.testInJavaVersions
34- // for (pluginJavaTestVersion in versions) {
35- // def taskName = "testInJava-${pluginJavaTestVersion}"
36- // tasks.register(taskName, Test) {
37- // def versionToUse = taskName.split("-").getAt(1) as Integer
38- // description = "Runs unit tests on Java version ${versionToUse}."
39- // project.logger.quiet("Test will be running in ${versionToUse}")
40- // group = 'verification'
41- // javaLauncher.set(javaToolchains.launcherFor {
42- // languageVersion = JavaLanguageVersion.of(versionToUse)
43- // })
44- // shouldRunAfter(tasks.named('test'))
45- // }
46- // tasks.named('check') {
47- // dependsOn(taskName)
48- // }
49- // }
50- //
51- // project.configure(project) {
52- // def baselineVersion = project.ext.baselineCompareVersion
53- // task('apiDiff', type: JapicmpTask, dependsOn: 'jar') {
54- // oldClasspath.from(files(getBaselineJar(project, baselineVersion)))
55- // newClasspath.from(files(jar.archiveFile))
56- // onlyModified = true
57- // failOnModification = true
58- // ignoreMissingClasses = true
59- // htmlOutputFile = file("$buildDir/reports/apiDiff/apiDiff.html")
60- // txtOutputFile = file("$buildDir/reports/apiDiff/apiDiff.txt")
61- // doLast {
62- // project.logger.quiet("Comparing against baseline version ${baselineVersion}")
63- // }
64- // }
65- // }
66- // }
67- //
68- // private static File getBaselineJar(Project project, String baselineVersion) {
69- // // Use detached configuration: https://github.com/square/okhttp/blob/master/build.gradle#L270
70- // def group = project.group
71- // try {
72- // def baseline = "${project.group}:${project.name}:$baselineVersion"
73- // project.group = 'virtual_group_for_japicmp'
74- // def dependency = project.dependencies.create(baseline + "@jar")
75- // return project.configurations.detachedConfiguration(dependency).files.find {
76- // it.name == "${project.name}-${baselineVersion}.jar"
77- // }
78- // } finally {
79- // project.group = group
80- // }
81- // }
82-
8318ext {
84- baselineCompareVersion = ' 1.5.0'
8519 testInJavaVersions = [17 , 21 ]
8620}
8721
0 commit comments