diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 328cbf10..13da93dd 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -8,21 +8,44 @@ on: branches: - master +env: + MAVEN_OPTS: '-Xms2048m -Xmx2048m' + MAVEN_ARGS: >- + --show-version + --errors + --batch-mode + --no-transfer-progress + -Dinvoker.streamLogsOnFailures=true + -Pnonindy + +defaults: + run: + shell: 'bash -o errexit -o nounset -o pipefail {0}' + jobs: ci: runs-on: ubuntu-latest + strategy: + matrix: + groovy-version: + - 2.5.23 + - 3.0.19 + - 4.0.15 +# - 5.0.0-alpha-2 + env: + MVN_GROOVY_GROUP_ID: ${{format('{0}{1}', '-DgroovyVersion=', matrix.groovy-version)}} + MVN_GROOVY_VERSION: ${{(startsWith(matrix.groovy-version, '2') || startsWith(matrix.groovy-version, '3')) && '-DgroovyGroupId=org.codehaus.groovy' || '-DgroovyGroupId=org.apache.groovy' }} steps: - name: checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: jdk setup - uses: actions/setup-java@v1 + uses: actions/setup-java@v3 with: + distribution: temurin java-version: 11 - java-package: jdk - architecture: x64 -# - name: unit test -# run: ./mvnw --batch-mode --activate-profiles indy clean test -# - name: integration test -# run: ./mvnw --batch-mode --activate-profiles indy -Dmaven.test.skip=true clean install invoker:install invoker:run - name: full test - run: ./mvnw --batch-mode clean install invoker:install invoker:run + run: >- + ./mvnw ${MAVEN_ARGS} + ${MVN_GROOVY_GROUP_ID} + ${MVN_GROOVY_VERSION} + clean install invoker:install invoker:run diff --git a/integrationTestSuite.groovy b/integrationTestSuite.groovy deleted file mode 100644 index 2a95cc75..00000000 --- a/integrationTestSuite.groovy +++ /dev/null @@ -1,81 +0,0 @@ -import groovy.io.FileType - -// Note Groovy 1.7.1 has a bad dependency on Jansi 1.1. You have to manually install it into your local cache for the tests to work. You can download it at http://repo.fusesource.com/nexus/content/groups/public/org/fusesource/jansi/jansi/1.1/. - -// Remember to test the console and shell goals. There are currently no integration tests for these. - -new File(System.getProperty("user.dir")).eachFileMatch FileType.FILES, ~/groovy-.+\.log/, { it.delete() } -println "Installing plugin..." -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", - "1.7-beta-1", "1.7-beta-2", "1.7-rc-1", "1.7-rc-2", "1.7.0", "1.7.1", "1.7.2", "1.7.3", "1.7.4", "1.7.5", "1.7.6", "1.7.7", "1.7.8", "1.7.9", "1.7.10", "1.7.11", - "1.8.0-beta-1", "1.8.0-beta-2", "1.8.0-beta-3", "1.8.0-beta-4", "1.8.0-rc-1", "1.8.0-rc-2", "1.8.0-rc-3", "1.8.0-rc-4", "1.8.0", "1.8.1", "1.8.2", "1.8.3", "1.8.4", "1.8.5", "1.8.6", "1.8.7", "1.8.8", "1.8.9", - "1.9.0-beta-1", "1.9.0-beta-2", "1.9.0-beta-3", "1.9.0-beta-4", - "2.0.0-beta-1", "2.0.0-beta-2", "2.0.0-beta-3", "2.0.0-rc-1", "2.0.0-rc-2", "2.0.0-rc-3", "2.0.0-rc-4", "2.0.0", "2.0.1", "2.0.2", "2.0.3", "2.0.4", "2.0.5", "2.0.6", "2.0.7", "2.0.8", - "2.1.0-beta-1", "2.1.0-rc-1", "2.1.0-rc-2", "2.1.0-rc-3", "2.1.0", "2.1.1", "2.1.2", "2.1.3", "2.1.4", "2.1.5", "2.1.6", "2.1.7", - "2.2.0-beta-1", "2.2.0-beta-2", "2.2.0-rc-1", "2.2.0-rc-2", "2.2.0-rc-3", "2.2.0", "2.2.1", "2.2.2", - "2.3.0-beta-1", "2.3.0-beta-2", "2.3.0-rc-1", "2.3.0-rc-2", "2.3.0-rc-4", "2.3.0", "2.3.1", "2.3.2", "2.3.3", "2.3.4", "2.3.5", "2.3.6", "2.3.7", "2.3.8", "2.3.9", "2.3.10", "2.3.11", - "2.4.0-beta-1", "2.4.0-beta-2", "2.4.0-beta-3", "2.4.0-beta-4", "2.4.0-rc-1", "2.4.0-rc-2", "2.4.0", "2.4.1", "2.4.2", "2.4.3", "2.4.4", "2.4.5", "2.4.6", "2.4.7", "2.4.8", "2.4.9", "2.4.10", "2.4.11", "2.4.12", "2.4.13", "2.4.14", "2.4.15", "2.4.16", "2.4.17", "2.4.18", "2.4.19", "2.4.20", "2.4.21", - "2.5.0-alpha-1", "2.5.0-beta-1", "2.5.0-beta-2", "2.5.0-beta-3", "2.5.0-rc-1", "2.5.0-rc-2", "2.5.0", "2.5.1", "2.5.2", "2.5.3", "2.5.4", "2.5.5", "2.5.6", "2.5.7", "2.5.8", "2.5.9", "2.5.10", "2.5.11", "2.5.12", "2.5.13", "2.5.14", "2.5.15", "2.5.16", "2.5.17", "2.5.18", "2.5.19", "2.5.20", "2.5.21", "2.5.22", - "2.6.0-alpha-1", "2.6.0-alpha-2", "2.6.0-alpha-3", - "3.0.0-alpha-1", "3.0.0-alpha-2", "3.0.0-alpha-3", "3.0.0-alpha-4", "3.0.0-beta-1", "3.0.0-beta-2", "3.0.0-beta-3", "3.0.0-rc-1", "3.0.0-rc-2", "3.0.0-rc-3", "3.0.0", "3.0.1", "3.0.2", "3.0.3", "3.0.4", "3.0.5", "3.0.6", "3.0.7", "3.0.8", "3.0.9", "3.0.10", "3.0.11", "3.0.12", "3.0.13", "3.0.14", "3.0.15", "3.0.16", "3.0.17", "3.0.18", - "4.0.0-alpha-1", "4.0.0-alpha-2", "4.0.0-alpha-3", "4.0.0-beta-1", "4.0.0-beta-2", "4.0.0-rc-1", "4.0.0-rc-2", "4.0.0", "4.0.1", "4.0.2", "4.0.3", "4.0.4", "4.0.5", "4.0.6", "4.0.7", "4.0.8", "4.0.9", "4.0.10", "4.0.11", "4.0.12", "4.0.13"] -for (int i = 0; i < groovyVersions.size(); i++) { - def groovyVersion = groovyVersions[i] - - System.out.print "Testing Groovy ${groovyVersion}..." - testLabel = groovyVersion - os = new FileOutputStream(new File("groovy-${testLabel}.log")) - 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") && 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")) - profiles = "${i < groovyVersions.indexOf("2.3.0") ? 'pre2.3-' : ''}indy" - properties = "-DgroovyVersion=${groovyVersion} -DgroovyGroupId=org.codehaus.groovy" - testVersion() - } -} -quietlyRunCommand "${mvn()} -B clean" - -void testVersion() { - def exitCode = runCommand "${mvn()} --batch-mode --activate-profiles ${profiles} -Dinvoker.streamLogs=true ${properties} invoker:run" - os.flush() - os.close() - if (exitCode != 0) { - println " Failed." - } else { - println " Succeeded." - new File("groovy-${testLabel}.log").delete() - } -} - -def runCommand(def command) { - def proc = command.execute() - proc.consumeProcessOutput(os, os) - proc.waitFor() -} - -static def quietlyRunCommand(def command) { - def proc = command.execute() - proc.consumeProcessOutput() - proc.waitFor() -} - -static def mvn() { - if (System.getProperty('os.name').contains('Windows')) { - try { - quietlyRunCommand("mvn.bat -v") - return "mvn.bat" - } catch (IOException ignored) { - return "mvn.cmd" - } - } else { - return "mvn" - } -} diff --git a/src/main/java/org/codehaus/gmavenplus/mojo/AbstractGenerateStubsMojo.java b/src/main/java/org/codehaus/gmavenplus/mojo/AbstractGenerateStubsMojo.java index bf05c7ea..64633776 100644 --- a/src/main/java/org/codehaus/gmavenplus/mojo/AbstractGenerateStubsMojo.java +++ b/src/main/java/org/codehaus/gmavenplus/mojo/AbstractGenerateStubsMojo.java @@ -166,12 +166,6 @@ public abstract class AbstractGenerateStubsMojo extends AbstractGroovyStubSource */ protected static final Version GROOVY_1_8_3 = new Version(1, 8, 3); - /* - * TODO: support Groovy 1.5.0 - 1.8.1? - * For some reason, the JavaStubCompilationUnit is silently not creating my stubs - * (although it does create the target directory) when I use other versions. - */ - /** * The encoding of source files. */