You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by cc...@apache.org on 2019/03/19 20:39:59 UTC

[groovy] branch master updated (649d9d0 -> fa85e15)

This is an automated email from the ASF dual-hosted git repository.

cchampeau pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git.


    from 649d9d0  trivial refactor: remove redundant assignment
     new 56c219e  Fix binary compatibility report
     new f67eb61  Remove `FileContentsHolder` as it is no longer required
     new 53db949  Fix location of checkstyle rule
     new fa85e15  Fix CodeNarc task

The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 build.gradle                                      |  2 +-
 config/checkstyle/checkstyle.xml                  | 12 ++--
 gradle/binarycompatibility.gradle                 | 87 -----------------------
 gradle/jacoco/jacoco.gradle                       |  2 +-
 gradle/quality.gradle                             | 14 +++-
 settings.gradle                                   |  3 +-
 subprojects/binary-compatibility/build.gradle.kts | 69 ++++++++++++++++++
 7 files changed, 90 insertions(+), 99 deletions(-)
 delete mode 100644 gradle/binarycompatibility.gradle
 create mode 100644 subprojects/binary-compatibility/build.gradle.kts


[groovy] 02/04: Remove `FileContentsHolder` as it is no longer required

Posted by cc...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

cchampeau pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git

commit f67eb6109c9c9243e65115bb76a15e711d27f164
Author: Cedric Champeau <cc...@apache.org>
AuthorDate: Tue Mar 19 20:39:33 2019 +0100

    Remove `FileContentsHolder` as it is no longer required
    
    The new checkstyle version doesn't need it, and it breaks the build.
---
 config/checkstyle/checkstyle.xml | 1 -
 1 file changed, 1 deletion(-)

diff --git a/config/checkstyle/checkstyle.xml b/config/checkstyle/checkstyle.xml
index 2a44790..c581433 100644
--- a/config/checkstyle/checkstyle.xml
+++ b/config/checkstyle/checkstyle.xml
@@ -166,7 +166,6 @@
         <!-- add below in eventually for consistency -->
         <!--<module name="ArrayTypeStyle"/>-->
 
-        <module name="FileContentsHolder" />
     </module>
     <!-- Item 6 - Avoid finalizers -->
     <!-- this will not find violations that contain linebreaks -->


[groovy] 03/04: Fix location of checkstyle rule

Posted by cc...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

cchampeau pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git

commit 53db9497f7b057d97af7bf688ad8cb6270ad5491
Author: Cedric Champeau <cc...@apache.org>
AuthorDate: Tue Mar 19 20:46:11 2019 +0100

    Fix location of checkstyle rule
---
 config/checkstyle/checkstyle.xml | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/config/checkstyle/checkstyle.xml b/config/checkstyle/checkstyle.xml
index c581433..18e6dc6 100644
--- a/config/checkstyle/checkstyle.xml
+++ b/config/checkstyle/checkstyle.xml
@@ -166,6 +166,12 @@
         <!-- add below in eventually for consistency -->
         <!--<module name="ArrayTypeStyle"/>-->
 
+        <module name="SuppressionCommentFilter">
+            <property name="offCommentFormat" value="CHECKSTYLE.OFF\: ([\w\|]+)"/>
+            <property name="onCommentFormat" value="CHECKSTYLE.ON\: ([\w\|]+)"/>
+            <property name="checkFormat" value="$1"/>
+        </module>
+
     </module>
     <!-- Item 6 - Avoid finalizers -->
     <!-- this will not find violations that contain linebreaks -->
@@ -181,11 +187,6 @@
         <property name="allowLegacy" value="true"/>
     </module>
 
-    <module name="SuppressionCommentFilter">
-        <property name="offCommentFormat" value="CHECKSTYLE.OFF\: ([\w\|]+)"/>
-        <property name="onCommentFormat" value="CHECKSTYLE.ON\: ([\w\|]+)"/>
-        <property name="checkFormat" value="$1"/>
-    </module>
 <!--
     <module name="au.com.redhillconsulting.simian.SimianCheck">
         <property name="threshold" value="8"/>


[groovy] 01/04: Fix binary compatibility report

Posted by cc...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

cchampeau pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git

commit 56c219eca0c028c95713a3abd74f14fa40cb0e6c
Author: Cedric Champeau <cc...@apache.org>
AuthorDate: Tue Mar 19 19:41:53 2019 +0100

    Fix binary compatibility report
    
    This commit fixes the binary compatibility report, that didn't work
    anymore. It replaces the old mechanism with a subproject which goal
    is _just_ to generate binary compatibility reports. This way we can
    avoid the dark magic around detached configurations.
---
 build.gradle                                      |  2 +-
 gradle/binarycompatibility.gradle                 | 87 -----------------------
 gradle/jacoco/jacoco.gradle                       |  2 +-
 gradle/quality.gradle                             |  2 -
 settings.gradle                                   |  3 +-
 subprojects/binary-compatibility/build.gradle.kts | 69 ++++++++++++++++++
 6 files changed, 73 insertions(+), 92 deletions(-)

diff --git a/build.gradle b/build.gradle
index 216bbd6..e9afdf6 100644
--- a/build.gradle
+++ b/build.gradle
@@ -68,7 +68,7 @@ buildScanRecipes {
 }
 
 ext.modules = {
-    subprojects.findAll{ !['performance'].contains(it.name) }
+    subprojects.findAll{ !['performance', 'binary-compatibility'].contains(it.name) }
 }
 ext.isReleaseVersion = !groovyVersion.toLowerCase().endsWith("snapshot")
 
diff --git a/gradle/binarycompatibility.gradle b/gradle/binarycompatibility.gradle
deleted file mode 100644
index aa4d1fb..0000000
--- a/gradle/binarycompatibility.gradle
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-import me.champeau.gradle.japicmp.JapicmpTask
-
-buildscript {
-    repositories {
-        maven {
-            url 'https://plugins.gradle.org/m2/'
-        }
-    }
-    dependencies {
-        classpath 'me.champeau.gradle:japicmp-gradle-plugin:0.2.6'
-    }
-}
-
-task checkBinaryCompatibility {
-    description = 'Generates binary compatibility reports'
-}
-check.dependsOn(checkBinaryCompatibility)
-
-// for comparing between versions with different modules, set excludeModules to differing modules, e.g.
-def excludeModules = [
-        'groovy-cli-picocli', 'groovy-cli-commons', 'groovy-dateutil', 'groovy-datetime', 'groovy-jaxb',
-        'groovy-macro', 'groovy-json-direct', 'groovy-test-junit5', 'groovy-yaml', 'performance', 'tests-vm8'
-]
-//def excludeModules = []
-
-Set projectsToCheck = allprojects.findAll{ !(it.name in excludeModules) }
-
-def compatibilityBaselineVersion = '2.4.15'
-
-allprojects {
-    if (project in projectsToCheck) {
-        // Use a detached configuration, otherwise the current version's jar will take precedence over the baseline jar.
-        // A necessary hack, the intuitive thing does NOT work:
-        // https://discuss.gradle.org/t/is-the-default-configuration-leaking-into-independent-configurations/2088/6
-        def saveGroup = project.group
-        def detachedConf
-        try {
-            project.group = 'virtual_group_for_japicmp'
-            String depModule = "org.codehaus.groovy:${project.name}:${compatibilityBaselineVersion}@jar"
-            String depJar = "${project.name}-${compatibilityBaselineVersion}.jar"
-            detachedConf = configurations.detachedConfiguration(
-                    dependencies.create(depModule)
-            )
-        } finally {
-            project.group = saveGroup
-        }
-        task japicmp(type: JapicmpTask, dependsOn: jarjar) {
-            oldClasspath = files({
-                files(detachedConf.files).filter {
-                it.name.equals(depJar)
-            }.singleFile})
-            newArchives = files(jarjar.outputFile)
-            newClasspath = configurations.runtimeClasspath
-            accessModifier = 'protected'
-            onlyModified = true
-            failOnModification = false
-            ignoreMissingClasses = true
-            classExcludes = ['**_closure**','org.codehaus.groovy.runtime.dgm$**']
-            packageExcludes = ['**internal**','groovyjarjar**']
-            htmlOutputFile = file("$buildDir/reports/japi.html")
-        }
-    }
-}
-
-allprojects {
-    tasks.withType(JapicmpTask) { task ->
-        checkBinaryCompatibility.dependsOn(task)
-    }
-}
diff --git a/gradle/jacoco/jacoco.gradle b/gradle/jacoco/jacoco.gradle
index c483005..64cb666 100644
--- a/gradle/jacoco/jacoco.gradle
+++ b/gradle/jacoco/jacoco.gradle
@@ -22,7 +22,7 @@ if (rootProject.hasProperty('coverage') && Boolean.valueOf(rootProject.getProper
     // are not specifically asking for code coverage
 
     allprojects {
-        if (!['performance'].contains(it.name)) {
+        if (!['performance', 'binary-compatibility'].contains(it.name)) {
             apply plugin: 'jacoco'
         }
 
diff --git a/gradle/quality.gradle b/gradle/quality.gradle
index cdff674..fb93553 100644
--- a/gradle/quality.gradle
+++ b/gradle/quality.gradle
@@ -188,5 +188,3 @@ rat {
 }
 
 apply from: 'gradle/jacoco/jacoco.gradle'
-// Temporarily disabled because of conflict
-apply from: 'gradle/binarycompatibility.gradle'
diff --git a/settings.gradle b/settings.gradle
index ca4cab3..bfc3abe 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -41,7 +41,8 @@ def subprojects = ['groovy-ant',
         'groovy-xml',
         'groovy-macro',
         'groovy-yaml',
-        'performance'
+        'performance',
+        'binary-compatibility'
 ]
 
 if (hasProperty('stressTests')) {
diff --git a/subprojects/binary-compatibility/build.gradle.kts b/subprojects/binary-compatibility/build.gradle.kts
new file mode 100644
index 0000000..f31790f
--- /dev/null
+++ b/subprojects/binary-compatibility/build.gradle.kts
@@ -0,0 +1,69 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+import me.champeau.gradle.japicmp.JapicmpTask
+
+plugins {
+    id("me.champeau.gradle.japicmp") version "0.2.6"
+}
+
+val checkBinaryCompatibility = tasks.register("checkBinaryCompatibility") {
+    description = "Generates binary compatibility reports"
+}
+
+tasks.named("check").configure {
+    dependsOn(checkBinaryCompatibility)
+}
+
+// for comparing between versions with different modules, set excludeModules to differing modules, e.g.
+val excludeModules = setOf(
+        "groovy-cli-picocli", "groovy-cli-commons", "groovy-dateutil", "groovy-datetime", "groovy-jaxb",
+        "groovy-macro", "groovy-json-direct", "groovy-test-junit5", "groovy-yaml", "performance", "tests-vm8",
+        "binary-compatibility"
+)
+
+val compatibilityBaselineVersion = "2.4.15"
+
+val binaryCompatProject = project
+
+rootProject.allprojects {
+    if (!(name in excludeModules)) {
+        val baseline = binaryCompatProject.configurations.create("${getJapiTaskName()}Baseline") {
+            dependencies.add(binaryCompatProject.dependencies.create("org.codehaus.groovy:${project.name}:${compatibilityBaselineVersion}@jar"))
+        }
+        val singleProjectCheck = binaryCompatProject.tasks.register<JapicmpTask>(getJapiTaskName()) {
+            oldArchives = baseline
+            newArchives = files(tasks.named("jarjar"))
+            oldClasspath = files()
+            newClasspath = files()
+            accessModifier = "protected"
+            onlyModified = true
+            failOnModification = false
+            ignoreMissingClasses = true
+            classExcludes = listOf("**_closure**", "org.codehaus.groovy.runtime.dgm$**")
+            packageExcludes = listOf("**internal**", "groovyjarjar**")
+            htmlOutputFile = file("${binaryCompatProject.buildDir}/reports/${getJapiTaskName()}.html")
+        }
+        checkBinaryCompatibility.configure {
+            dependsOn(singleProjectCheck)
+        }
+    }
+}
+
+fun Project.getJapiTaskName() =
+        "japicmp${name.split('-').joinToString(separator = "", transform = String::capitalize)}"
\ No newline at end of file


[groovy] 04/04: Fix CodeNarc task

Posted by cc...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

cchampeau pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git

commit fa85e15b99f799dbc63f852af7cf8879e0e2a04d
Author: Cedric Champeau <cc...@apache.org>
AuthorDate: Tue Mar 19 21:21:11 2019 +0100

    Fix CodeNarc task
---
 gradle/quality.gradle | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/gradle/quality.gradle b/gradle/quality.gradle
index fb93553..2047d22 100644
--- a/gradle/quality.gradle
+++ b/gradle/quality.gradle
@@ -36,6 +36,13 @@ allprojects {
             substitute module("org.codehaus.groovy:groovy-xml") with project(":groovy-xml")
             substitute module("org.codehaus.groovy:groovy-groovydoc") with project(":groovy-groovydoc")
         }
+        
+        exclude module: 'groovy-all'
+    }
+    
+    dependencies {
+        codenarc "org.codenarc:CodeNarc:1.2.1"
+        codenarc project(":groovy-templates")
     }
 
 //    license {
@@ -59,9 +66,12 @@ allprojects {
 
     // don't fail build on CodeNarc tasks
     tasks.withType(CodeNarc) {
-        dependsOn jar
+        //dependsOn jar
         ignoreFailures = true
         configFile = file("$rootProject.projectDir/config/codenarc/codenarc.groovy")
+        doFirst {
+            configurations.codenarc.files.each { println it }
+        }
     }
 
     tasks.withType(Checkstyle) {