Permalink
Browse files

remove 1.7 checks from build files

Related to commit 06e5fc0, minimum build version now set to 1.7.
  • Loading branch information...
1 parent 136108e commit 1c10e3474aadbaadcf91153fbf06d2861691a584 @jwagenleitner jwagenleitner committed Sep 9, 2016
Showing with 135 additions and 157 deletions.
  1. +0 −10 build.gradle
  2. +130 −132 gradle/binarycompatibility.gradle
  3. +4 −11 gradle/docs.gradle
  4. +1 −4 settings.gradle
View
@@ -252,22 +252,12 @@ sourceSets {
}.visit { details ->
exclude "groovy/ui/$details.path"
}
- if (!JavaVersion.current().isJava7Compatible()) {
- exclude '**/indy/*'
- exclude '**/v7/*'
- exclude '**/vm7/*'
- }
}
groovy {
srcDirs = [
'src/main',
"$generatedDirectory/src/main"
]
- if (!JavaVersion.current().isJava7Compatible()) {
- exclude '**/indy/*'
- exclude '**/v7/*'
- exclude '**/vm7/*'
- }
}
resources {
srcDirs = ['src/main', 'src/tools', 'src/resources']
@@ -41,176 +41,174 @@ task checkBinaryCompatibility {
}
check.dependsOn(checkBinaryCompatibility)
-if (JavaVersion.current().isJava7Compatible()) {
- allprojects {
- if (!(project.name in excludeModules)) {
- apply plugin: 'me.champeau.gradle.japicmp'
- }
+allprojects {
+ if (!(project.name in excludeModules)) {
+ apply plugin: 'me.champeau.gradle.japicmp'
}
+}
- def referenceMinorVersion = '2.4.7'
+def referenceMinorVersion = '2.4.7'
- def prettyPrint = { classOrMethod ->
- "${Modifier.toString(classOrMethod.get()?.modifiers)} ${classOrMethod.get()?.longName}"
- }
+def prettyPrint = { classOrMethod ->
+ "${Modifier.toString(classOrMethod.get()?.modifiers)} ${classOrMethod.get()?.longName}"
+}
- def prettyPrintMethodWithReturnType = { method ->
- "${Modifier.toString(method.get()?.modifiers)} ${method.get()?.returnType.name} ${method.get()?.name}${javassist.bytecode.Descriptor.toString(method.get()?.signature)}"
- }
+def prettyPrintMethodWithReturnType = { method ->
+ "${Modifier.toString(method.get()?.modifiers)} ${method.get()?.returnType.name} ${method.get()?.name}${javassist.bytecode.Descriptor.toString(method.get()?.signature)}"
+}
- def reportGenerator = { model ->
- outputProcessor {
+def reportGenerator = { model ->
+ outputProcessor {
- def skipClass = { c ->
- c.fullyQualifiedName =~ /\$[0-9]+$/ || // skip AIC
- 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]+/ }
- def violations = [:].withDefault {
- // key = class name
- // value = map of violations
- [:].withDefault { [] }
- }
- removedConstructor { c, m ->
- if (!skipMethod(c, m)) {
- def level = Modifier.isPrivate(m.oldConstructor.get()?.modifiers) ? 'info' : 'error'
- violations[c.fullyQualifiedName][level] << "Constructor ${prettyPrint(m.oldConstructor)} has been removed"
- }
+ def skipClass = { c ->
+ c.fullyQualifiedName =~ /\$[0-9]+$/ || // skip AIC
+ 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]+/ }
+ def violations = [:].withDefault {
+ // key = class name
+ // value = map of violations
+ [:].withDefault { [] }
+ }
+ removedConstructor { c, m ->
+ if (!skipMethod(c, m)) {
+ def level = Modifier.isPrivate(m.oldConstructor.get()?.modifiers) ? 'info' : 'error'
+ violations[c.fullyQualifiedName][level] << "Constructor ${prettyPrint(m.oldConstructor)} has been removed"
}
- removedMethod { c, m ->
- if (!skipMethod(c, m)) {
- def level = m.name.startsWith('super$') ? 'warning' : 'error'
- violations[c.fullyQualifiedName][level] << "Method ${m.name} has been removed"
- }
+ }
+ removedMethod { c, m ->
+ if (!skipMethod(c, m)) {
+ def level = m.name.startsWith('super$') ? 'warning' : 'error'
+ violations[c.fullyQualifiedName][level] << "Method ${m.name} has been removed"
}
- removedClass { c ->
- if (!skipClass(c)) {
- violations[c.fullyQualifiedName].error << "Class has been removed"
- }
+ }
+ removedClass { c ->
+ if (!skipClass(c)) {
+ violations[c.fullyQualifiedName].error << "Class has been removed"
}
+ }
- modifiedMethod { c, m ->
- if (!skipMethod(c, m)) {
- violations[c.fullyQualifiedName].warning << """<p>Method ${m.name} has been modified</p>
+ modifiedMethod { c, m ->
+ if (!skipMethod(c, m)) {
+ violations[c.fullyQualifiedName].warning << """<p>Method ${m.name} has been modified</p>
<p>From <pre>${prettyPrintMethodWithReturnType(m.oldMethod)}</pre> to <pre>${prettyPrintMethodWithReturnType(m.newMethod)}</pre></p>"""
- }
}
+ }
- modifiedConstructor { c, m ->
- if (!skipMethod(c, m)) {
- violations[c.fullyQualifiedName].warning << """<p>Constructor ${m.name} has been modified</p>
+ modifiedConstructor { c, m ->
+ if (!skipMethod(c, m)) {
+ violations[c.fullyQualifiedName].warning << """<p>Constructor ${m.name} has been modified</p>
<p>From <pre>${prettyPrint(m.oldConstructor)}</pre> to <pre>${prettyPrint(m.newConstructor)}</pre></p>"""
- }
}
+ }
- modifiedClass { c ->
- if (!skipClass(c)) {
- def level = c.binaryCompatible?'info':'error'
- def message = "Class ${c.fullyQualifiedName} has been modified"
- violations[c.fullyQualifiedName][level] << message
- }
+ modifiedClass { c ->
+ if (!skipClass(c)) {
+ def level = c.binaryCompatible?'info':'error'
+ def message = "Class ${c.fullyQualifiedName} has been modified"
+ violations[c.fullyQualifiedName][level] << message
}
+ }
- newClass { c ->
- if (!skipClass(c)) {
- violations[c.fullyQualifiedName].info << "Class has been added"
- }
+ newClass { c ->
+ if (!skipClass(c)) {
+ violations[c.fullyQualifiedName].info << "Class has been added"
}
- newMethod { c, m ->
- if (!skipMethod(c, m)) {
- violations[c.fullyQualifiedName].info << """<p>Method ${m.name} has been added</p>
+ }
+ newMethod { c, m ->
+ if (!skipMethod(c, m)) {
+ violations[c.fullyQualifiedName].info << """<p>Method ${m.name} has been added</p>
<p>Signature: <pre>${prettyPrint(m.newMethod)}</pre></p>"""
- }
}
+ }
- after {
- model.violations = violations
- }
+ after {
+ model.violations = violations
}
}
+}
// using a global engine for all tasks in order to increase performance
- def configDir = file("$rootProject.projectDir/config/binarycompatibility")
- def templateFile = 'binarycompat-report.groovy'
- def templateConfiguration = new TemplateConfiguration()
- templateConfiguration.with {
- autoIndent = true
- autoNewLine = true
+def configDir = file("$rootProject.projectDir/config/binarycompatibility")
+def templateFile = 'binarycompat-report.groovy'
+def templateConfiguration = new TemplateConfiguration()
+templateConfiguration.with {
+ autoIndent = true
+ autoNewLine = true
+}
+def engine = new MarkupTemplateEngine(this.class.classLoader, configDir, templateConfiguration)
+
+task japicmpAll(type: me.champeau.gradle.ArtifactJapicmpTask) {
+ dependsOn jarAll
+ baseline = "org.codehaus.groovy:groovy-all:${referenceMinorVersion}@jar"
+ to = jarAll.archivePath
+ accessModifier = 'protected'
+ onlyModified = true
+ failOnModification = false
+ txtOutputFile = file("$buildDir/reports/japi.txt")
+
+ doFirst {
+ classpath = allprojects.configurations.japicmp.files.flatten()
}
- def engine = new MarkupTemplateEngine(this.class.classLoader, configDir, templateConfiguration)
-
- task japicmpAll(type: me.champeau.gradle.ArtifactJapicmpTask) {
- dependsOn jarAll
- baseline = "org.codehaus.groovy:groovy-all:${referenceMinorVersion}@jar"
- to = jarAll.archivePath
- accessModifier = 'protected'
- onlyModified = true
- failOnModification = false
- txtOutputFile = file("$buildDir/reports/japi.txt")
-
- doFirst {
- classpath = allprojects.configurations.japicmp.files.flatten()
- }
- def htmlReportFile = file("${buildDir}/reports/binary-compat-${project.name}-all.html")
- inputs.file file("$configDir/$templateFile")
- inputs.file templateFile
- outputs.file htmlReportFile
+ def htmlReportFile = file("${buildDir}/reports/binary-compat-${project.name}-all.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))
+ 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)
- }
+ doLast {
+ htmlReportFile.withWriter('utf-8') { wrt ->
+ engine.createTemplateByPath(templateFile).make(model).writeTo(wrt)
}
}
+}
- allprojects {
- if (!(project.name in excludeModules)) {
- dependencies {
- japicmp files(rootProject.jar.archivePath)
- }
+allprojects {
+ if (!(project.name in excludeModules)) {
+ 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)
- }
-
+allprojects {
+ tasks.withType(me.champeau.gradle.ArtifactJapicmpTask) { task ->
+ checkBinaryCompatibility.dependsOn(task)
}
+
}
View
@@ -90,7 +90,7 @@ javadocAll {
javadocAll javadocSpec
// Root project has an extra 'all' groovydoc task
-task groovydocAll(type: Groovydoc)
+task groovydocAll(type: Groovydoc)
groovydocAll {
dependsOn( { project(':groovy-groovydoc').classes })
dependsOn( { project(':groovy-docgenerator').classes })
@@ -123,10 +123,7 @@ task docGDK {
// ext.extraDocGDKclasses = []
dependsOn([project(':groovy-groovydoc'), project(':groovy-docgenerator')]*.classes)
// TODO don't hard-code these
- dependsOn([project(':groovy-sql'), project(':groovy-xml'), project(':groovy-swing')]*.classes)
- if(JavaVersion.current().isJava7Compatible()) {
- dependsOn([project(':groovy-nio')]*.classes)
- }
+ dependsOn([project(':groovy-nio'), project(':groovy-sql'), project(':groovy-xml'), project(':groovy-swing')]*.classes)
dependsOn docProjectVersionInfo
ext.destinationDir = "$buildDir/html/groovy-jdk"
inputs.files sourceSets.main.runtimeClasspath + configurations.tools
@@ -163,9 +160,7 @@ task docGDK {
arg(value: 'subprojects/groovy-sql/src/main/java/org/codehaus/groovy/runtime/SqlGroovyMethods.java')
arg(value: 'subprojects/groovy-swing/src/main/java/org/codehaus/groovy/runtime/SwingGroovyMethods.java')
arg(value: 'subprojects/groovy-xml/src/main/java/org/codehaus/groovy/runtime/XmlGroovyMethods.java')
- if(JavaVersion.current().isJava7Compatible()) {
- arg(value: 'subprojects/groovy-nio/src/main/java/org/codehaus/groovy/runtime/NioGroovyMethods.java')
- }
+ arg(value: 'subprojects/groovy-nio/src/main/java/org/codehaus/groovy/runtime/NioGroovyMethods.java')
}
}
} finally {
@@ -188,9 +183,7 @@ allprojects {
apply plugin: 'javadocHotfix'
}
-if (JavaVersion.current().isJava7Compatible()) {
- javadocAll.options.source = '1.7'
-}
+javadocAll.options.source = '1.7'
if (JavaVersion.current().isJava8Compatible()) {
allprojects {
View
@@ -25,6 +25,7 @@ def subprojects = ['groovy-ant',
'groovy-jmx',
'groovy-json',
'groovy-jsr223',
+ 'groovy-nio',
'groovy-servlet',
'groovy-sql',
'groovy-swing',
@@ -35,10 +36,6 @@ def subprojects = ['groovy-ant',
'groovy-macro'
]
-if(JavaVersion.current().isJava7Compatible()) {
- subprojects << 'groovy-nio'
-}
-
if (JavaVersion.current().isJava8Compatible()) {
subprojects << 'performance'
}

0 comments on commit 1c10e34

Please sign in to comment.