Skip to content

Commit

Permalink
[Groovy3] Simplify Groovy 2/3 compatibility layer
Browse files Browse the repository at this point in the history
  • Loading branch information
szpak committed Jan 14, 2020
1 parent 399de9e commit 33b01bb
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 14 deletions.
7 changes: 0 additions & 7 deletions groovy2-compat/groovy2-compat.gradle

This file was deleted.

3 changes: 0 additions & 3 deletions internal-backport/internal-backport.gradle

This file was deleted.

5 changes: 2 additions & 3 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 5 additions & 1 deletion spock-core/core.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
27 changes: 27 additions & 0 deletions spock-groovy2-compat/groovy2-compat.gradle
Original file line number Diff line number Diff line change
@@ -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'
)
}
}

0 comments on commit 33b01bb

Please sign in to comment.