Skip to content

Commit

Permalink
Merge pull request #175 from groovy/Groovy4
Browse files Browse the repository at this point in the history
Groovy 4 Support
  • Loading branch information
keeganwitt authored Oct 11, 2020
2 parents 7640b66 + 5960bbc commit a94c72f
Show file tree
Hide file tree
Showing 36 changed files with 260 additions and 205 deletions.
17 changes: 9 additions & 8 deletions integrationTest.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import groovy.io.FileType

new File(System.getProperty("user.dir")).eachFileMatch FileType.FILES, ~/groovy-.+\.log/, { it.delete() }
println "Installing plugin..."
quietlyRunCommand "${mvn()} -B -P nonindy clean install invoker:install"
quietlyRunCommand "${mvn()} -B -P nonindy -Dmaven.test.skip=true -Dinvoker.skip=true clean install invoker:install"
// TODO: fix joint compilation failures with Groovy 1.9-beta-1 and 1.9-beta-2
groovyVersions = ["1.5.0", "1.5.1", "1.5.2", "1.5.3", "1.5.4", "1.5.5", "1.5.6", "1.5.7", "1.5.8",
"1.6-beta-1", "1.6-beta-2", "1.6-RC-1", "1.6-RC-2", "1.6-RC-3", "1.6.0", "1.6.1", "1.6.2", "1.6.3", "1.6.4", "1.6.5", "1.6.6", "1.6.7", "1.6.8", "1.6.9",
Expand All @@ -24,26 +24,27 @@ groovyVersions = ["1.5.0", "1.5.1", "1.5.2", "1.5.3", "1.5.4", "1.5.5", "1.5.6",
"4.0.0-alpha-1"]
for (int i = 0; i < groovyVersions.size(); i++) {
def groovyVersion = groovyVersions[i]

System.out.print "Testing Groovy ${groovyVersion}..."
def pom = new File("pom.xml")
pom.write((pom.text =~ /<groovyVersion>.+/).replaceFirst("<groovyVersion>${groovyVersion}</groovyVersion>"))
testLabel = groovyVersion
os = new FileOutputStream(new File("groovy-${testLabel}.log"))
profile = "${i < groovyVersions.indexOf("2.3.0") ? 'pre2.3-' : ''}nonindy"
profiles = "${i < groovyVersions.indexOf("2.3.0") ? 'pre2.3-' : ''}nonindy"
properties = "-DgroovyVersion=${groovyVersion} -DgroovyGroupId=${i >= groovyVersions.indexOf("4.0.0-alpha-1") ? 'org.apache.groovy' : 'org.codehaus.groovy'}"
testVersion()
if (i >= groovyVersions.indexOf("2.0.0-beta-3")) {

if (i >= groovyVersions.indexOf("2.0.0-beta-3") && i < groovyVersions.indexOf("4.0.0-alpha-1")) {
System.out.print "Testing Groovy ${groovyVersion}-indy..."
testLabel = "${groovyVersion}-indy"
os = new FileOutputStream(new File("groovy-${testLabel}.log"))
profile = "${i < groovyVersions.indexOf("2.3.0") ? 'pre2.3-' : ''}indy"
profiles = "${i < groovyVersions.indexOf("2.3.0") ? 'pre2.3-' : ''}indy"
properties = "-DgroovyVersion=${groovyVersion} -DgroovyGroupId=${i >= groovyVersions.indexOf("4.0.0-alpha-1") ? 'org.apache.groovy' : 'org.codehaus.groovy'}"
testVersion()
}
}
quietlyRunCommand "git checkout pom.xml"
quietlyRunCommand "${mvn()} -B clean"

void testVersion() {
def exitCode = runCommand "${mvn()} -B -P $profile -Dinvoker.streamLogs=true invoker:run"
def exitCode = runCommand "${mvn()} -B -P ${profiles} -Dinvoker.streamLogs=true ${properties} invoker:run"
os.flush()
os.close()
if (exitCode != 0) {
Expand Down
30 changes: 19 additions & 11 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>org.codehaus.gmavenplus</groupId>
<artifactId>gmavenplus-plugin</artifactId>
<packaging>maven-plugin</packaging>
<version>1.10.2-SNAPSHOT</version>
<version>1.11.0-SNAPSHOT</version>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand All @@ -23,7 +24,8 @@
<pluginPluginVersion>3.6.0</pluginPluginVersion>
<!-- this is a property so that site generation can use it -->
<sourcePluginVersion>3.2.1</sourcePluginVersion>
<!-- this is a property so that site generation and integration tests can use it -->
<!-- these are properties so that site generation and integration tests can use it -->
<groovyGroupId>org.codehaus.groovy</groovyGroupId>
<groovyVersion>3.0.6</groovyVersion>
</properties>

Expand Down Expand Up @@ -112,21 +114,21 @@
<id>indy</id>
<dependencies>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<groupId>${groovyGroupId}</groupId>
<artifactId>groovy</artifactId>
<version>${groovyVersion}</version>
<classifier>indy</classifier>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<groupId>${groovyGroupId}</groupId>
<artifactId>groovy-ant</artifactId>
<version>${groovyVersion}</version>
<classifier>indy</classifier>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<groupId>${groovyGroupId}</groupId>
<artifactId>groovy-groovydoc</artifactId>
<version>${groovyVersion}</version>
<classifier>indy</classifier>
Expand All @@ -151,19 +153,19 @@
<id>nonindy</id>
<dependencies>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<groupId>${groovyGroupId}</groupId>
<artifactId>groovy</artifactId>
<version>${groovyVersion}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<groupId>${groovyGroupId}</groupId>
<artifactId>groovy-ant</artifactId>
<version>${groovyVersion}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<groupId>${groovyGroupId}</groupId>
<artifactId>groovy-groovydoc</artifactId>
<version>${groovyVersion}</version>
<scope>test</scope>
Expand All @@ -187,7 +189,7 @@
<id>pre2.3-indy</id>
<dependencies>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<groupId>${groovyGroupId}</groupId>
<artifactId>groovy</artifactId>
<version>${groovyVersion}</version>
<classifier>indy</classifier>
Expand All @@ -212,7 +214,7 @@
<id>pre2.3-nonindy</id>
<dependencies>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<groupId>${groovyGroupId}</groupId>
<artifactId>groovy</artifactId>
<version>${groovyVersion}</version>
<scope>test</scope>
Expand Down Expand Up @@ -450,6 +452,9 @@
<configuration>
<source>${shortJavaVersion}</source>
<failOnError>false</failOnError>
<links>
<link>https://docs.groovy-lang.org/latest/html/api/</link>
</links>
</configuration>
<executions>
<execution>
Expand Down Expand Up @@ -526,6 +531,9 @@
<configuration>
<source>${javaVersion}</source>
<failOnError>false</failOnError>
<links>
<link>https://docs.groovy-lang.org/latest/html/api/</link>
</links>
</configuration>
</plugin>
<plugin>
Expand Down
8 changes: 4 additions & 4 deletions src/it/advancedCompile/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<id>indy</id>
<dependencies>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<groupId>@groovyGroupId@</groupId>
<artifactId>groovy</artifactId>
<classifier>indy</classifier>
</dependency>
Expand All @@ -41,7 +41,7 @@
<id>nonindy</id>
<dependencies>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<groupId>@groovyGroupId@</groupId>
<artifactId>groovy</artifactId>
</dependency>
</dependencies>
Expand All @@ -50,7 +50,7 @@
<id>pre2.3-indy</id>
<dependencies>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<groupId>@groovyGroupId@</groupId>
<artifactId>groovy</artifactId>
<classifier>indy</classifier>
</dependency>
Expand All @@ -60,7 +60,7 @@
<id>pre2.3-nonindy</id>
<dependencies>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<groupId>@groovyGroupId@</groupId>
<artifactId>groovy</artifactId>
</dependency>
</dependencies>
Expand Down
12 changes: 6 additions & 6 deletions src/it/advancedExecute/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@
<artifactId>gmavenplus-plugin</artifactId>
<dependencies>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<groupId>@groovyGroupId@</groupId>
<artifactId>groovy</artifactId>
<version>@groovyVersion@</version>
<classifier>indy</classifier>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<groupId>@groovyGroupId@</groupId>
<artifactId>groovy-ant</artifactId>
<version>@groovyVersion@</version>
<classifier>indy</classifier>
Expand All @@ -64,12 +64,12 @@
<artifactId>gmavenplus-plugin</artifactId>
<dependencies>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<groupId>@groovyGroupId@</groupId>
<artifactId>groovy</artifactId>
<version>@groovyVersion@</version>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<groupId>@groovyGroupId@</groupId>
<artifactId>groovy-ant</artifactId>
<version>@groovyVersion@</version>
</dependency>
Expand All @@ -87,7 +87,7 @@
<artifactId>gmavenplus-plugin</artifactId>
<dependencies>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<groupId>@groovyGroupId@</groupId>
<artifactId>groovy</artifactId>
<version>@groovyVersion@</version>
<classifier>indy</classifier>
Expand All @@ -106,7 +106,7 @@
<artifactId>gmavenplus-plugin</artifactId>
<dependencies>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<groupId>@groovyGroupId@</groupId>
<artifactId>groovy</artifactId>
<version>@groovyVersion@</version>
</dependency>
Expand Down
8 changes: 4 additions & 4 deletions src/it/advancedGenerateStubs/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<id>indy</id>
<dependencies>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<groupId>@groovyGroupId@</groupId>
<artifactId>groovy</artifactId>
<classifier>indy</classifier>
</dependency>
Expand All @@ -39,7 +39,7 @@
<id>nonindy</id>
<dependencies>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<groupId>@groovyGroupId@</groupId>
<artifactId>groovy</artifactId>
</dependency>
</dependencies>
Expand All @@ -48,7 +48,7 @@
<id>pre2.3-indy</id>
<dependencies>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<groupId>@groovyGroupId@</groupId>
<artifactId>groovy</artifactId>
<classifier>indy</classifier>
</dependency>
Expand All @@ -58,7 +58,7 @@
<id>pre2.3-nonindy</id>
<dependencies>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<groupId>@groovyGroupId@</groupId>
<artifactId>groovy</artifactId>
</dependency>
</dependencies>
Expand Down
12 changes: 6 additions & 6 deletions src/it/advancedGroovydoc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@
<id>indy</id>
<dependencies>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<groupId>@groovyGroupId@</groupId>
<artifactId>groovy</artifactId>
<classifier>indy</classifier>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<groupId>@groovyGroupId@</groupId>
<artifactId>groovy-groovydoc</artifactId>
<classifier>indy</classifier>
</dependency>
Expand All @@ -43,11 +43,11 @@
<id>nonindy</id>
<dependencies>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<groupId>@groovyGroupId@</groupId>
<artifactId>groovy</artifactId>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<groupId>@groovyGroupId@</groupId>
<artifactId>groovy-groovydoc</artifactId>
</dependency>
</dependencies>
Expand All @@ -56,7 +56,7 @@
<id>pre2.3-indy</id>
<dependencies>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<groupId>@groovyGroupId@</groupId>
<artifactId>groovy</artifactId>
<classifier>indy</classifier>
</dependency>
Expand All @@ -66,7 +66,7 @@
<id>pre2.3-nonindy</id>
<dependencies>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<groupId>@groovyGroupId@</groupId>
<artifactId>groovy</artifactId>
</dependency>
</dependencies>
Expand Down
8 changes: 4 additions & 4 deletions src/it/astCompile/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<id>indy</id>
<dependencies>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<groupId>@groovyGroupId@</groupId>
<artifactId>groovy</artifactId>
<classifier>indy</classifier>
</dependency>
Expand All @@ -39,7 +39,7 @@
<id>nonindy</id>
<dependencies>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<groupId>@groovyGroupId@</groupId>
<artifactId>groovy</artifactId>
</dependency>
</dependencies>
Expand All @@ -48,7 +48,7 @@
<id>pre2.3-indy</id>
<dependencies>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<groupId>@groovyGroupId@</groupId>
<artifactId>groovy</artifactId>
<classifier>indy</classifier>
</dependency>
Expand All @@ -58,7 +58,7 @@
<id>pre2.3-nonindy</id>
<dependencies>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<groupId>@groovyGroupId@</groupId>
<artifactId>groovy</artifactId>
</dependency>
</dependencies>
Expand Down
8 changes: 4 additions & 4 deletions src/it/basicCompile/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<id>indy</id>
<dependencies>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<groupId>@groovyGroupId@</groupId>
<artifactId>groovy</artifactId>
<classifier>indy</classifier>
</dependency>
Expand All @@ -38,7 +38,7 @@
<id>nonindy</id>
<dependencies>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<groupId>@groovyGroupId@</groupId>
<artifactId>groovy</artifactId>
</dependency>
</dependencies>
Expand All @@ -47,7 +47,7 @@
<id>pre2.3-indy</id>
<dependencies>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<groupId>@groovyGroupId@</groupId>
<artifactId>groovy</artifactId>
<classifier>indy</classifier>
</dependency>
Expand All @@ -57,7 +57,7 @@
<id>pre2.3-nonindy</id>
<dependencies>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<groupId>@groovyGroupId@</groupId>
<artifactId>groovy</artifactId>
</dependency>
</dependencies>
Expand Down
Loading

0 comments on commit a94c72f

Please sign in to comment.