diff --git a/groovy2-compat/groovy2-compat.gradle b/groovy2-compat/groovy2-compat.gradle deleted file mode 100644 index 4c6387934b..0000000000 --- a/groovy2-compat/groovy2-compat.gradle +++ /dev/null @@ -1,7 +0,0 @@ -//Module with compatibility layer to keep codebase compilable with both Groovy 2.5 and 3.0 - -if (variant == 2.5) { - dependencies { - compile project(':internal-backport') - } -} diff --git a/internal-backport/internal-backport.gradle b/internal-backport/internal-backport.gradle deleted file mode 100644 index 1cdcf406cb..0000000000 --- a/internal-backport/internal-backport.gradle +++ /dev/null @@ -1,3 +0,0 @@ -//Module with compatibility layer to keep codebase compilable with both Groovy 2.5 and 3.0 -// -//WARNING. Do not mix groovy-3 and spock-2.x-groovy-2.5 jars on classpath! diff --git a/settings.gradle b/settings.gradle index 02e1f96892..42fdeae4a3 100755 --- a/settings.gradle +++ b/settings.gradle @@ -8,11 +8,10 @@ include "spock-guice" include "spock-junit4" include "spock-temp" include "spock-testkit" -//Remove once Groovy 2.5 support is dropped -include "groovy2-compat" if ((System.getProperty("variant") as BigDecimal ?: 3.0) != 3.0) { - include "internal-backport" + //Remove once Groovy 2.5 support is dropped + include "spock-groovy2-compat" } // https://issues.apache.org/jira/projects/TAP5/issues/TAP5-2588 diff --git a/spock-core/core.gradle b/spock-core/core.gradle index f3048e0f6d..e71a669685 100755 --- a/spock-core/core.gradle +++ b/spock-core/core.gradle @@ -23,7 +23,11 @@ dependencies { compile libs.cglib, optional compile libs.objenesis, optional - compile project(':groovy2-compat') + if (variant == 2.5) { + dependencies { + compile project(':spock-groovy2-compat') + } + } coreConsoleRuntime groovyConsoleExtraDependency } diff --git a/groovy2-compat/src/main/java/org/spockframework/compat/groovy2/GroovyCodeVisitorCompat.java b/spock-core/src/main/java/org/spockframework/compat/groovy2/GroovyCodeVisitorCompat.java similarity index 100% rename from groovy2-compat/src/main/java/org/spockframework/compat/groovy2/GroovyCodeVisitorCompat.java rename to spock-core/src/main/java/org/spockframework/compat/groovy2/GroovyCodeVisitorCompat.java diff --git a/spock-groovy2-compat/groovy2-compat.gradle b/spock-groovy2-compat/groovy2-compat.gradle new file mode 100644 index 0000000000..caadfa71cb --- /dev/null +++ b/spock-groovy2-compat/groovy2-compat.gradle @@ -0,0 +1,27 @@ +//Module with compatibility layer to keep codebase compilable with both Groovy 2.5 and 3.0 +// +//WARNING. Do not mix groovy:3.x and spock-groovy2-compat:2.x-groovy-2.5 jars on classpath! + +apply from: script("publishMaven") + +ext.displayName = "Spock Framework - Groovy 2 Compatibility Module" + +description = "Spock's Groovy 2 Compatibility Module provides support for using Spock 2 with Groovy 2.5." + +jar { + manifest { + attributes( + 'Created-By': "${System.properties['java.version']} (${System.properties['java.vendor']} ${System.properties['java.vm.version']})".toString(), + 'Build-Date': buildDate, + 'Build-Time': buildTime, + 'Build-Revision': versioning.info.commit, + 'Specification-Title': project.name, + 'Specification-Version': baseVersion, + 'Specification-Vendor': 'spockframework.org', + 'Implementation-Title': project.name, + 'Implementation-Version': variantLessVersion, + 'Implementation-Vendor': 'spockframework.org', + 'Automatic-Module-Name': 'org.spockframework.spring' + ) + } +} diff --git a/internal-backport/src/main/java/org/codehaus/groovy/ast/expr/LambdaExpression.java b/spock-groovy2-compat/src/main/java/org/codehaus/groovy/ast/expr/LambdaExpression.java similarity index 100% rename from internal-backport/src/main/java/org/codehaus/groovy/ast/expr/LambdaExpression.java rename to spock-groovy2-compat/src/main/java/org/codehaus/groovy/ast/expr/LambdaExpression.java diff --git a/internal-backport/src/main/java/org/codehaus/groovy/ast/expr/MethodReferenceExpression.java b/spock-groovy2-compat/src/main/java/org/codehaus/groovy/ast/expr/MethodReferenceExpression.java similarity index 100% rename from internal-backport/src/main/java/org/codehaus/groovy/ast/expr/MethodReferenceExpression.java rename to spock-groovy2-compat/src/main/java/org/codehaus/groovy/ast/expr/MethodReferenceExpression.java