groovy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jwagenleit...@apache.org
Subject [2/2] groovy git commit: remove 1.7 checks from build files
Date Fri, 09 Sep 2016 00:46:03 GMT
remove 1.7 checks from build files

Related to commit 06e5fc0, minimum build version now set to 1.7.


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/1c10e347
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/1c10e347
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/1c10e347

Branch: refs/heads/master
Commit: 1c10e3474aadbaadcf91153fbf06d2861691a584
Parents: 136108e
Author: John Wagenleitner <jwagenleitner@apache.org>
Authored: Thu Sep 8 17:41:52 2016 -0700
Committer: John Wagenleitner <jwagenleitner@apache.org>
Committed: Thu Sep 8 17:41:52 2016 -0700

----------------------------------------------------------------------
 build.gradle                      |  10 --
 gradle/binarycompatibility.gradle | 262 ++++++++++++++++-----------------
 gradle/docs.gradle                |  15 +-
 settings.gradle                   |   5 +-
 4 files changed, 135 insertions(+), 157 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/1c10e347/build.gradle
----------------------------------------------------------------------
diff --git a/build.gradle b/build.gradle
index 0588527..443f8ea 100644
--- a/build.gradle
+++ b/build.gradle
@@ -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']

http://git-wip-us.apache.org/repos/asf/groovy/blob/1c10e347/gradle/binarycompatibility.gradle
----------------------------------------------------------------------
diff --git a/gradle/binarycompatibility.gradle b/gradle/binarycompatibility.gradle
index b7774a9..96b1059 100644
--- a/gradle/binarycompatibility.gradle
+++ b/gradle/binarycompatibility.gradle
@@ -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)
     }
+
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/1c10e347/gradle/docs.gradle
----------------------------------------------------------------------
diff --git a/gradle/docs.gradle b/gradle/docs.gradle
index 9ddf182..03eef94 100644
--- a/gradle/docs.gradle
+++ b/gradle/docs.gradle
@@ -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 {

http://git-wip-us.apache.org/repos/asf/groovy/blob/1c10e347/settings.gradle
----------------------------------------------------------------------
diff --git a/settings.gradle b/settings.gradle
index 230d0ff..7d1ab24 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -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'
 }


Mime
View raw message