You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by pa...@apache.org on 2016/07/10 11:01:38 UTC
groovy git commit: minor refactor: enhance japicmp slightly to
exclude modules
Repository: groovy
Updated Branches:
refs/heads/master 80f102db8 -> 057cf3661
minor refactor: enhance japicmp slightly to exclude modules
Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/057cf366
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/057cf366
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/057cf366
Branch: refs/heads/master
Commit: 057cf3661fcede9c7967d2d061dcc5ea527d6ca5
Parents: 80f102d
Author: paulk <pa...@asert.com.au>
Authored: Sun Jul 10 21:00:53 2016 +1000
Committer: paulk <pa...@asert.com.au>
Committed: Sun Jul 10 21:01:26 2016 +1000
----------------------------------------------------------------------
gradle/binarycompatibility.gradle | 69 ++++++++++++++++++----------------
1 file changed, 37 insertions(+), 32 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/groovy/blob/057cf366/gradle/binarycompatibility.gradle
----------------------------------------------------------------------
diff --git a/gradle/binarycompatibility.gradle b/gradle/binarycompatibility.gradle
index 44cdb7d..0847d72 100644
--- a/gradle/binarycompatibility.gradle
+++ b/gradle/binarycompatibility.gradle
@@ -32,6 +32,9 @@ buildscript {
classpath 'me.champeau.gradle:japicmp-gradle-plugin:0.1.1'
}
}
+// for comparing between versions with different modules, set excludeModules to differing modules, e.g.
+//def excludeModules = ['performance', 'groovy-macro']
+def excludeModules = []
task checkBinaryCompatibility {
description = 'Generates binary compatibility reports'
@@ -40,10 +43,12 @@ check.dependsOn(checkBinaryCompatibility)
if (JavaVersion.current().isJava7Compatible()) {
allprojects {
- apply plugin: 'me.champeau.gradle.japicmp'
+ if (!(project.name in excludeModules)) {
+ apply plugin: 'me.champeau.gradle.japicmp'
+ }
}
- def referenceMinorVersion = '2.4.2'
+ def referenceMinorVersion = '2.4.7'
def prettyPrint = { classOrMethod ->
"${Modifier.toString(classOrMethod.get()?.modifiers)} ${classOrMethod.get()?.longName}"
@@ -54,7 +59,8 @@ if (JavaVersion.current().isJava7Compatible()) {
def skipClass = { c ->
c.fullyQualifiedName =~ /\$[0-9]+$/ || // skip AIC
- c.fullyQualifiedName.startsWith('org.codehaus.groovy.runtime.dgm$') ||
+ c.fullyQualifiedName.startsWith('org.codehaus.groovy.runtime.dgm$') ||
+// c.fullyQualifiedName.startsWith('groovyjarjar') ||
c.fullyQualifiedName.contains('_closure')
}
def skipMethod = { c, m -> skipClass(c) || m.name =~ /access\$[0-9]+/ }
@@ -163,41 +169,40 @@ if (JavaVersion.current().isJava7Compatible()) {
}
allprojects {
+ if (!(project.name in excludeModules)) {
+ dependencies {
+ japicmp files(rootProject.jar.archivePath)
+ }
- dependencies {
- japicmp files(rootProject.jar.archivePath)
- }
-
- task japicmp(type: me.champeau.gradle.ArtifactJapicmpTask) {
- dependsOn replaceJarWithJarJar
- baseline = "org.codehaus.groovy:${project.name}:${referenceMinorVersion}@jar"
- to = jar.archivePath
- accessModifier = 'protected'
- onlyModified = true
- failOnModification = false
- txtOutputFile = file("$buildDir/reports/japi.txt")
-
- def htmlReportFile = file("${buildDir}/reports/binary-compat-${project.name}.html")
- inputs.file file("$configDir/$templateFile")
- inputs.file templateFile
- outputs.file htmlReportFile
-
- def model = [title : "Binary compatibility report for ${project.name}",
- project : project,
- baseline: baseline,
- archive : to.name]
- outputProcessor(reportGenerator.curry(model))
-
- doLast {
- htmlReportFile.withWriter('utf-8') { wrt ->
- engine.createTemplateByPath(templateFile).make(model).writeTo(wrt)
+ task japicmp(type: me.champeau.gradle.ArtifactJapicmpTask) {
+ dependsOn replaceJarWithJarJar
+ baseline = "org.codehaus.groovy:${project.name}:${referenceMinorVersion}@jar"
+ to = jar.archivePath
+ accessModifier = 'protected'
+ onlyModified = true
+ failOnModification = false
+ txtOutputFile = file("$buildDir/reports/japi.txt")
+
+ def htmlReportFile = file("${buildDir}/reports/binary-compat-${project.name}.html")
+ inputs.file file("$configDir/$templateFile")
+ inputs.file templateFile
+ outputs.file htmlReportFile
+
+ def model = [title : "Binary compatibility report for ${project.name}",
+ project : project,
+ baseline: baseline,
+ archive : to.name]
+ outputProcessor(reportGenerator.curry(model))
+
+ doLast {
+ htmlReportFile.withWriter('utf-8') { wrt ->
+ engine.createTemplateByPath(templateFile).make(model).writeTo(wrt)
+ }
}
}
-
}
}
-
allprojects {
tasks.withType(me.champeau.gradle.ArtifactJapicmpTask) { task ->
checkBinaryCompatibility.dependsOn(task)