You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by pa...@apache.org on 2020/04/25 02:39:55 UTC
[groovy] branch master updated: GROOVY-9513: Enable indy by default
(closes #1226)
This is an automated email from the ASF dual-hosted git repository.
paulk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git
The following commit(s) were added to refs/heads/master by this push:
new cb7136f GROOVY-9513: Enable indy by default (closes #1226)
cb7136f is described below
commit cb7136f7c810378e97cff0393657c76f4acdabb6
Author: Daniel Sun <su...@apache.org>
AuthorDate: Sun Apr 19 04:05:00 2020 +0800
GROOVY-9513: Enable indy by default (closes #1226)
---
.github/workflows/gradle.yml | 24 -----------
.travis.yml | 17 +-------
README.adoc | 12 ------
build.gradle | 13 ------
gradle/assemble.gradle | 21 ----------
gradle/indy.gradle | 25 -----------
gradle/jacoco/jacoco.gradle | 48 +---------------------
gradle/test.gradle | 30 +-------------
gradle/upload.gradle | 14 -------
src/bin/groovyConsole_completion | 2 +-
src/bin/groovy_completion | 2 +-
src/bin/groovyc_completion | 2 +-
src/main/java/groovy/ui/GroovyMain.java | 8 ----
.../groovy/classgen/asm/WriterController.java | 2 +-
.../groovy/control/CompilerConfiguration.java | 10 +++--
.../codehaus/groovy/tools/FileSystemCompiler.java | 8 ----
src/spec/doc/tools-groovy.adoc | 1 -
src/spec/doc/tools-groovyc.adoc | 1 -
.../main/java/org/codehaus/groovy/ant/Groovy.java | 13 ------
.../main/java/org/codehaus/groovy/ant/Groovyc.java | 23 -----------
.../groovy-ant/src/spec/doc/groovy-ant-task.adoc | 1 -
.../groovy/cli/picocli/CliBuilderTest.groovy | 20 +--------
.../groovy/groovy/console/ui/AstBrowser.groovy | 40 +++---------------
.../main/groovy/groovy/console/ui/Console.groovy | 41 +-----------------
.../groovy/groovy/console/ui/ConsoleActions.groovy | 7 ----
.../console/ui/ScriptToTreeNodeAdapter.groovy | 7 +---
.../groovy/console/ui/view/BasicMenuBar.groovy | 1 -
.../resources/groovy/console/ui/Console.properties | 2 -
.../src/spec/doc/groovy-console.adoc | 3 --
.../groovy/console/SwingBuilderConsoleTest.groovy | 17 ++------
.../console/ui/ScriptToTreeNodeAdapterTest.groovy | 2 +-
31 files changed, 31 insertions(+), 386 deletions(-)
diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml
index fd6a4c5..6d3cc71 100644
--- a/.github/workflows/gradle.yml
+++ b/.github/workflows/gradle.yml
@@ -42,27 +42,3 @@ jobs:
timeout-minutes: 60
env:
GRADLE_SCANS_ACCEPT: yes
- testWithIndy:
- strategy:
- fail-fast: false
- matrix:
- os: [ubuntu-18.04]
- java: [8.0.232, 11.0.6]
- runs-on: ${{ matrix.os }}
- steps:
- - uses: actions/checkout@v1
- - name: Set up JDK
- uses: actions/setup-java@v1
- with:
- java-version: ${{ matrix.java }}
- - name: Cache Gradle Repository
- uses: actions/cache@v1
- with:
- path: ~/.gradle/caches
- key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
- restore-keys: ${{ runner.os }}-gradle
- - name: Test with Gradle
- run: ./gradlew testWithIndy
- timeout-minutes: 60
- env:
- GRADLE_SCANS_ACCEPT: yes
diff --git a/.travis.yml b/.travis.yml
index a2decd9..427d4ba 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -25,21 +25,6 @@ install:
matrix:
include:
- - env: BC='legacy'
- jdk: openjdk14
- - env: BC='legacy'
- jdk: openjdk13
- - env: BC='legacy'
- jdk: openjdk12
- - env: BC='legacy'
- jdk: openjdk11
- - env: BC='legacy'
- jdk: openjdk10
- - env: BC='legacy'
- jdk: oraclejdk9
- - env: BC='legacy'
- jdk: oraclejdk8
-
- env: BC='indy'
jdk: openjdk14
- env: BC='indy'
@@ -63,7 +48,7 @@ before_script:
script:
- ./gradlew -version
- - if [ "$BC" == "legacy" ]; then travis_wait 60 ./gradlew test; elif [ "$BC" == "sonar" ]; then travis_wait 60 ./gradlew sonarqube -Dsonar.login=$SONAR_LOGIN -Pcoverage=true -x testWithIndy; else travis_wait 60 ./gradlew testWithIndy; fi
+ - if [ "$BC" == "indy" ]; then travis_wait 60 ./gradlew test; elif [ "$BC" == "sonar" ]; then travis_wait 60 ./gradlew sonarqube -Dsonar.login=$SONAR_LOGIN -Pcoverage=true; fi
# As recommended in:
# https://docs.travis-ci.com/user/languages/java/#Caching
diff --git a/README.adoc b/README.adoc
index 293932c..13d6690 100644
--- a/README.adoc
+++ b/README.adoc
@@ -174,18 +174,6 @@ All code samples of the documentation guide are pulled from actual test cases. T
(Note the omission of package name: class is `semantics.PowerAssertTest` but only `PowerAssertTest` is added to `testSingle`.)
-== InvokeDynamic support
-
-The Groovy build supports the JVM instruction `invokedynamic`. If you want to build Groovy with invokedynamic, you can use the project property `indy`:
-
- gradlew -Pindy=true clean test
-
-Please note that the following Gradle tasks generate both indy and non indy variants of the jars, so you don't need to use the system property:
-
-* dist
-* install
-* uploadArchives
-
== Continuous Integration Server
The official CI server runs {groovy-ci}[here] and is sponsored by http://www.jetbrains.com[JetBrains].
diff --git a/build.gradle b/build.gradle
index e04f2d6..94a7076 100644
--- a/build.gradle
+++ b/build.gradle
@@ -64,7 +64,6 @@ ext.modules = {
ext.isReleaseVersion = !groovyVersion.toLowerCase().endsWith("snapshot")
apply from: 'gradle/bad-practices.gradle'
-//apply from: 'gradle/indy.gradle'
apply from: 'gradle/publish.gradle'
apply plugin: "com.github.jk1.dependency-license-report"
@@ -100,7 +99,6 @@ allprojects {
}
apply plugin: 'groovy'
- apply from: "${rootProject.projectDir}/gradle/indy.gradle"
apply from: "${rootProject.projectDir}/gradle/asciidoctor.gradle"
tasks.withType(org.asciidoctor.gradle.AsciidoctorTask) {
@@ -329,17 +327,6 @@ allprojects {
}
}
- if (rootProject.indyCapable()) {
- task compileGroovyWithIndy(type: GroovyCompile) {
- source = sourceSets.main.groovy
- classpath = compileGroovy.classpath
- sourceCompatibility = 1.8
- targetCompatibility = 1.8
- groovyOptions.optimizationOptions['indy'] = true
- destinationDir = file("$buildDir/classes/indy")
- }
- }
-
tasks.withType(GroovyCompile) {
groovyOptions.forkOptions.jvmArgs += ["-Dgroovy.antlr4.cache.threshold=100"]
groovyOptions.fork(memoryMaximumSize: groovycMain_mx)
diff --git a/gradle/assemble.gradle b/gradle/assemble.gradle
index 985529d..6fd28e7 100644
--- a/gradle/assemble.gradle
+++ b/gradle/assemble.gradle
@@ -173,18 +173,6 @@ allprojects {
}
}
}
- if (rootProject.indyCapable()) {
- task jarWithIndy(type: Jar) {
- dependsOn compileGroovyWithIndy
- archiveClassifier = 'indy'
- archiveAppendix = 'raw'
- from sourceSets.main.java.outputDir
- from sourceSets.main.groovy.outputDir
- from compileGroovyWithIndy.destinationDir
- from "${project.buildDir}/resources/main"
- }
- producedJars << jarWithIndy
- }
producedJars.each { arch ->
arch.metaInf {
from("$projectDir/licenses/LICENSE-JARJAR")
@@ -289,9 +277,6 @@ allprojects {
}
def producedJars = [jar]
-if (rootProject.indyCapable()) {
- producedJars << jarWithIndy
-}
producedJars.each {
it.dependsOn('dgmConverter')
@@ -390,12 +375,6 @@ ext.distSpec = copySpec {
from project(':groovy-jaxb').configurations.jaxb
from project(':groovy-jaxb').configurations.jaxbRuntime
}
- if (!rootProject.hasProperty('skipIndy')) {
- into('indy') {
- from jarjarWithIndy
- from modules()*.jarjarWithIndy
- }
- }
if (!rootProject.hasProperty('skipGrooid')) {
into('grooid') {
from { new File(jar.archivePath.parent, "${jar.baseName}-${jar.version}-grooid.jar") }
diff --git a/gradle/indy.gradle b/gradle/indy.gradle
deleted file mode 100644
index f2262c1..0000000
--- a/gradle/indy.gradle
+++ /dev/null
@@ -1,25 +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.
- */
-
-// This file contains support tools for the Gradle build
-// with regards to invoke dynamic support (indy)
-
-rootProject.ext.indyCapable = {
- !rootProject.hasProperty('skipIndy')
-}
diff --git a/gradle/jacoco/jacoco.gradle b/gradle/jacoco/jacoco.gradle
index ed9237d..21f2ff0 100644
--- a/gradle/jacoco/jacoco.gradle
+++ b/gradle/jacoco/jacoco.gradle
@@ -28,7 +28,7 @@ if (rootProject.hasProperty('coverage') && Boolean.valueOf(rootProject.getProper
project.afterEvaluate {
tasks.withType(JacocoReport) {
- if (name != 'jacocoAllReport' && name != 'jacocoAllIndyReport') {
+ if (name != 'jacocoAllReport') {
sourceDirectories.from = sourceDirectories.from + files(project.sourceSets.main.allGroovy.srcDirs)
// classDirectories += files(project.sourceSets.main.output)
}
@@ -37,7 +37,6 @@ if (rootProject.hasProperty('coverage') && Boolean.valueOf(rootProject.getProper
}
// To avoid "Can't add different class with same name" fatal error
- // due to different classes generated when using Indy, create two reports
// No need to include Java class directories since Groovy one includes those classes
task jacocoMerge(type: JacocoMerge) {
@@ -46,22 +45,7 @@ if (rootProject.hasProperty('coverage') && Boolean.valueOf(rootProject.getProper
allprojects {
project.plugins.withType(JavaPlugin) {
project.tasks.withType(Test) { task ->
- if (sourceSets.test.allSource.srcDirs.any { it.exists() } && !task.name.contains('Indy')) {
- executionData(task)
- }
- }
- }
- }
-
- executionData = files(executionData).filter { f -> f.exists() }
- }
-
- task jacocoMergeIndy(type: JacocoMerge) {
- destinationFile = file("$buildDir/jacoco/jacoco-all-indy.exec")
- allprojects {
- project.plugins.withType(JavaPlugin) {
- project.tasks.withType(Test) { task ->
- if (sourceSets.test.allSource.srcDirs.any { it.exists() } && task.name.contains('Indy')) {
+ if (sourceSets.test.allSource.srcDirs.any { it.exists() }) {
executionData(task)
}
}
@@ -92,34 +76,6 @@ if (rootProject.hasProperty('coverage') && Boolean.valueOf(rootProject.getProper
}
}
- task jacocoAllIndyReport(type: JacocoReport, dependsOn: 'jacocoMergeIndy') {
- executionData jacocoMergeIndy.destinationFile
- reports {
- xml {
- enabled true
- }
- html {
- enabled true
- }
- }
-
- allprojects {
- project.plugins.withType(JavaPlugin) {
- def sd = sourceDirectories.from ?: files()
- def cd = classDirectories.from ?: files()
- sourceDirectories.from = sd + files(project.sourceSets.main.allGroovy.srcDirs, project.sourceSets.main.allJava.srcDirs)
- classDirectories.from = cd + files(compileGroovyWithIndy.destinationDir)
- }
- }
- }
-
check.dependsOn jacocoAllReport
- if (!rootProject.hasProperty('skipIndy')) {
- check.dependsOn jacocoAllIndyReport
- }
-
tasks.sonarqube.dependsOn jacocoAllReport
- if (!rootProject.hasProperty('skipIndy')) {
- tasks.sonarqube.dependsOn jacocoAllIndyReport
- }
}
diff --git a/gradle/test.gradle b/gradle/test.gradle
index 8a9a1ef..1d0f874 100644
--- a/gradle/test.gradle
+++ b/gradle/test.gradle
@@ -45,27 +45,6 @@ allprojects {
}
}
- // create an Indy test suite
- if (rootProject.indyCapable()) {
- def dependencies = configurations.testRuntime.incoming.dependencies.findAll {
- it.name.startsWith('groovy')
- }.collect {
- it.name
- }
- task testWithIndy(type: Test) {
- systemProperties 'groovy.target.indy': true
- dependsOn 'jarWithIndy'
- dependencies.each { dependsOn "${it}:jarWithIndy" }
- classpath = classpath - files(jar.archivePath, *dependencies.collect { project(it).jar }) +
- files({ [jarWithIndy.archivePath, *dependencies.collect { project(it).jarWithIndy }] })
- }
- task testAll {
- description = "Runs both the normal and indy test suites"
- dependsOn test, testWithIndy
- }
- check.dependsOn testWithIndy
- }
-
sourceSets {
test {
groovy {
@@ -117,13 +96,8 @@ def buildExcludeFilter(boolean legacyTestSuite) {
excludes << 'groovy/grape/'
}
- if (legacyTestSuite) {
- // indy tests will only be executed in indy test suite
- excludes += ['indy', 'Indy']
- } else {
- // tests not passing with indy : investigation required!
- excludes += ['Log4j2Test', 'ASTTransformationCustomizerTest']
- }
+ // tests not passing with indy : investigation required!
+ excludes += ['Log4j2Test', 'ASTTransformationCustomizerTest']
return { f ->
excludes.any { f.file =~ it }
diff --git a/gradle/upload.gradle b/gradle/upload.gradle
index ca5cb9a..83ffd7e 100644
--- a/gradle/upload.gradle
+++ b/gradle/upload.gradle
@@ -111,13 +111,7 @@ allprojects {
[uploadArchives, install]*.with {
dependsOn([grooidjar, jarjar, sourceJar, javadocJar, groovydocJar])
- if (rootProject.indyCapable()) {
- dependsOn jarjarWithIndy
- }
doFirst {
- if (rootProject.indyCapable()) {
- project.artifacts.add('archives', jarjarWithIndy.outputFile)
- }
def grooidJarFile = rootProject.ext.deriveFile(jarjar.outputFile, 'grooid')
if (grooidJarFile.exists()) {
project.artifacts.add('archives', grooidJarFile)
@@ -133,10 +127,6 @@ allprojects {
signArchiveTask(sourceJar)
signArchiveTask(javadocJar)
signArchiveTask(groovydocJar)
- def indyJar = rootProject.ext.deriveFile(jarjar.outputFile, 'indy')
- if (indyJar.exists()) {
- signWithClassifier('indy', indyJar)
- }
def grooidJarFile = rootProject.ext.deriveFile(jarjar.outputFile, 'grooid')
if (grooidJarFile.exists()) {
signWithClassifier('grooid', grooidJarFile)
@@ -150,10 +140,6 @@ allprojects {
// we don't want them in the root project so add them as artifacts with a modified name
// we'll exclude the original artifacts during publication with an exclude pattern
def configureAdditionalArtifacts = {
- if (!rootProject.indyCapable()) {
- throw new GradleException("Indy must be enabled to upload archives")
- }
-
project.artifacts.add('archives', distBin) { name = 'groovy-binary' }
project.artifacts.add('archives', sourceAllJar) { name = 'groovy-all' }
project.artifacts.add('archives', javadocAllJar) { name = 'groovy-all' }
diff --git a/src/bin/groovyConsole_completion b/src/bin/groovyConsole_completion
index 9803661..e41890b 100644
--- a/src/bin/groovyConsole_completion
+++ b/src/bin/groovyConsole_completion
@@ -90,7 +90,7 @@ function _picocli_groovyConsole() {
PREV_WORD=${COMP_WORDS[COMP_CWORD-1]}
COMMANDS=""
- FLAG_OPTS="-cp -classpath --classpath -h --help -V --version -pa --parameters -pr --enable-preview -i --indy"
+ FLAG_OPTS="-cp -classpath --classpath -h --help -V --version -pa --parameters -pr --enable-preview -i"
ARG_OPTS="-D --define --configscript"
COMPREPLY=( $(compgen -W "${FLAG_OPTS} ${ARG_OPTS} ${COMMANDS}" -- ${CURR_WORD}) )
diff --git a/src/bin/groovy_completion b/src/bin/groovy_completion
index 9fc1fa7..dfe0750 100644
--- a/src/bin/groovy_completion
+++ b/src/bin/groovy_completion
@@ -90,7 +90,7 @@ function _picocli_groovy() {
PREV_WORD=${COMP_WORDS[COMP_CWORD-1]}
COMMANDS=""
- FLAG_OPTS="-d --debug -n -p -pa --parameters -pr --enable-preview --indy -h --help -v --version"
+ FLAG_OPTS="-d --debug -n -p -pa --parameters -pr --enable-preview -h --help -v --version"
ARG_OPTS="-cp -classpath --classpath -D --define --disableopt -c --encoding -e -i -l -a --autosplit --configscript -b --basescript"
COMPREPLY=( $(compgen -W "${FLAG_OPTS} ${ARG_OPTS} ${COMMANDS}" -- ${CURR_WORD}) )
diff --git a/src/bin/groovyc_completion b/src/bin/groovyc_completion
index d4591f1..a66a4f8 100644
--- a/src/bin/groovyc_completion
+++ b/src/bin/groovyc_completion
@@ -90,7 +90,7 @@ function _picocli_groovyc() {
PREV_WORD=${COMP_WORDS[COMP_CWORD-1]}
COMMANDS=""
- FLAG_OPTS="-e --exception -pa --parameters -pr --enable-preview -j --jointCompilation --indy -h --help -v --version"
+ FLAG_OPTS="-e --exception -pa --parameters -pr --enable-preview -j --jointCompilation -h --help -v --version"
ARG_OPTS="-cp -classpath --classpath -sourcepath --sourcepath --temp --encoding -d -b --basescript -J -F --configscript"
case ${CURR_WORD} in
diff --git a/src/main/java/groovy/ui/GroovyMain.java b/src/main/java/groovy/ui/GroovyMain.java
index 26ff489..8ec2ba5 100644
--- a/src/main/java/groovy/ui/GroovyMain.java
+++ b/src/main/java/groovy/ui/GroovyMain.java
@@ -216,9 +216,6 @@ public class GroovyMain {
@Option(names = {"-a", "--autosplit"}, arity = "0..1", paramLabel = "<splitPattern>", description = "Split lines using splitPattern (default '\\s') using implicit 'split' variable")
private String splitPattern;
- @Option(names = {"--indy"}, description = "Enables compilation using invokedynamic")
- private boolean indy;
-
@Option(names = {"--configscript"}, paramLabel = "<script>", description = "A script for tweaking the configuration options")
private String configscript;
@@ -295,11 +292,6 @@ public class GroovyMain {
main.conf.getOptimizationOptions().put(optimization, false);
}
- if (indy) {
- System.setProperty("groovy.target.indy", "true");
- main.conf.getOptimizationOptions().put("indy", true);
- }
-
if (scriptBaseClass != null) {
main.conf.setScriptBaseClass(scriptBaseClass);
}
diff --git a/src/main/java/org/codehaus/groovy/classgen/asm/WriterController.java b/src/main/java/org/codehaus/groovy/classgen/asm/WriterController.java
index fe8dc41..c17c471 100644
--- a/src/main/java/org/codehaus/groovy/classgen/asm/WriterController.java
+++ b/src/main/java/org/codehaus/groovy/classgen/asm/WriterController.java
@@ -87,7 +87,7 @@ public class WriterController {
this.optimizeForInt = false;
// set other optimizations options to false here
} else {
- if (Boolean.TRUE.equals(optOptions.get(CompilerConfiguration.INVOKEDYNAMIC))) invokedynamic = true;
+ if (config.isIndyEnabled()) invokedynamic = true;
if (Boolean.FALSE.equals(optOptions.get("int"))) this.optimizeForInt = false;
if (invokedynamic) this.optimizeForInt = false;
// set other optimizations options to false here
diff --git a/src/main/java/org/codehaus/groovy/control/CompilerConfiguration.java b/src/main/java/org/codehaus/groovy/control/CompilerConfiguration.java
index bb08c63..5e28bf7 100644
--- a/src/main/java/org/codehaus/groovy/control/CompilerConfiguration.java
+++ b/src/main/java/org/codehaus/groovy/control/CompilerConfiguration.java
@@ -436,13 +436,17 @@ public class CompilerConfiguration {
defaultScriptExtension = getSystemPropertySafe("groovy.default.scriptExtension", ".groovy");
optimizationOptions = new HashMap<>(4);
- handleOptimizationOption(optimizationOptions, INVOKEDYNAMIC, "groovy.target.indy");
+ handleOptimizationOption(optimizationOptions, INVOKEDYNAMIC, "groovy.target.indy", "true");
handleOptimizationOption(optimizationOptions, GROOVYDOC, "groovy.attach.groovydoc");
handleOptimizationOption(optimizationOptions, RUNTIME_GROOVYDOC, "groovy.attach.runtime.groovydoc");
}
private void handleOptimizationOption(final Map<String, Boolean> options, final String optionName, final String sysOptionName) {
- String propValue = getSystemPropertySafe(sysOptionName);
+ handleOptimizationOption(options, optionName, sysOptionName, null);
+ }
+
+ private void handleOptimizationOption(final Map<String, Boolean> options, final String optionName, final String sysOptionName, String def) {
+ String propValue = getSystemPropertySafe(sysOptionName, def);
boolean optionEnabled = propValue == null
? (DEFAULT != null && Boolean.TRUE.equals(DEFAULT.getOptimizationOptions().get(optionName)))
: Boolean.parseBoolean(propValue);
@@ -1062,7 +1066,7 @@ public class CompilerConfiguration {
*/
public boolean isIndyEnabled() {
Boolean indyEnabled = getOptimizationOptions().get(INVOKEDYNAMIC);
- return Optional.ofNullable(indyEnabled).orElse(Boolean.FALSE);
+ return Optional.ofNullable(indyEnabled).orElse(Boolean.TRUE);
}
/**
diff --git a/src/main/java/org/codehaus/groovy/tools/FileSystemCompiler.java b/src/main/java/org/codehaus/groovy/tools/FileSystemCompiler.java
index a7da4b9..35acd76 100644
--- a/src/main/java/org/codehaus/groovy/tools/FileSystemCompiler.java
+++ b/src/main/java/org/codehaus/groovy/tools/FileSystemCompiler.java
@@ -378,9 +378,6 @@ public class FileSystemCompiler {
@Option(names = "-F", paramLabel = "<flag>", description = "Passed to javac for joint compilation")
private List<String> flags;
- @Option(names = {"--indy"}, description = "Enables compilation using invokedynamic")
- private boolean indy;
-
@Option(names = {"--configscript"}, paramLabel = "<script>", description = "A script for tweaking the configuration options")
private String configScript;
@@ -425,11 +422,6 @@ public class FileSystemCompiler {
configuration.setJointCompilationOptions(compilerOptions);
}
- if (indy) {
- configuration.getOptimizationOptions().put("int", Boolean.FALSE);
- configuration.getOptimizationOptions().put("indy", Boolean.TRUE);
- }
-
final List<String> transformations = new ArrayList<>();
if (compileStatic) {
transformations.add("ast(groovy.transform.CompileStatic)");
diff --git a/src/spec/doc/tools-groovy.adoc b/src/spec/doc/tools-groovy.adoc
index caf202c..2e865cc 100644
--- a/src/spec/doc/tools-groovy.adoc
+++ b/src/spec/doc/tools-groovy.adoc
@@ -54,7 +54,6 @@ int (disable any int based optimizations) |
| -e <script> | | specify an inline command line script | groovy -e "println new Date()"
| -h | --help | Displays usage information for the command line groovy command | groovy --help
| -i <extension> | | modify files in place; create backup if extension is given (e.g. '.bak') |
-| | --indy | Enables invokedynamic support. Requires Java 7+ | groovy --indy Person.groovy
| -l <port> | | listen on a port and process inbound lines (default: 1960) |
| -n | | process files line by line using implicit 'line' variable |
| -p | | process files line by line and print result (see also -n) |
diff --git a/src/spec/doc/tools-groovyc.adoc b/src/spec/doc/tools-groovyc.adoc
index 6193db6..3d48d1d 100644
--- a/src/spec/doc/tools-groovyc.adoc
+++ b/src/spec/doc/tools-groovyc.adoc
@@ -47,7 +47,6 @@ a number of command line switches:
| -e | --exception | Displays the stack trace in case of compilation error | groovyc -e script.groovy
| -j | --jointCompilation* | Enables joint compilation | groovyc -j A.groovy B.java
| -b | --basescript | Base class name for scripts (must derive from Script)|
-| -indy | --indy | Enables invokedynamic support. Requires Java 7+ | groovyc --indy Person.groovy
| | --configscript | Advanced compiler configuration script | groovyc --configscript config/config.groovy src/Person.groovy
| -Jproperty=value | | Properties to be passed to `javac` if joint compilation is enabled | groovyc -j -Jtarget=1.6 -Jsource=1.6 A.groovy B.java
| -Fflag | | Flags to be passed to `javac` if joint compilation is enabled | groovyc -j -Fnowarn A.groovy B.java
diff --git a/subprojects/groovy-ant/src/main/java/org/codehaus/groovy/ant/Groovy.java b/subprojects/groovy-ant/src/main/java/org/codehaus/groovy/ant/Groovy.java
index 12c3c96..69c6131 100644
--- a/subprojects/groovy-ant/src/main/java/org/codehaus/groovy/ant/Groovy.java
+++ b/subprojects/groovy-ant/src/main/java/org/codehaus/groovy/ant/Groovy.java
@@ -120,7 +120,6 @@ public class Groovy extends Java {
private boolean includeAntRuntime = true;
private boolean useGroovyShell = false;
- private boolean indy = false;
private String scriptBaseClass;
private String configscript;
@@ -298,14 +297,6 @@ public class Groovy extends Java {
this.configscript = configscript;
}
- /**
- * Sets the indy flag to enable or disable invokedynamic
- *
- * @param indy true means invokedynamic support is active
- */
- public void setIndy(final boolean indy) {
- this.indy = indy;
- }
/**
* Set the script base class name
@@ -568,10 +559,6 @@ public class Groovy extends Java {
if (scriptBaseClass != null) {
configuration.setScriptBaseClass(scriptBaseClass);
}
- if (indy) {
- configuration.getOptimizationOptions().put("indy", Boolean.TRUE);
- configuration.getOptimizationOptions().put("int", Boolean.FALSE);
- }
if (configscript != null) {
Binding binding = new Binding();
binding.setVariable("configuration", configuration);
diff --git a/subprojects/groovy-ant/src/main/java/org/codehaus/groovy/ant/Groovyc.java b/subprojects/groovy-ant/src/main/java/org/codehaus/groovy/ant/Groovyc.java
index bb29191..b48bce6 100644
--- a/subprojects/groovy-ant/src/main/java/org/codehaus/groovy/ant/Groovyc.java
+++ b/subprojects/groovy-ant/src/main/java/org/codehaus/groovy/ant/Groovyc.java
@@ -119,7 +119,6 @@ import java.util.StringTokenizer;
* <li>includeDestClasses</li>
* <li>jointCompilationOptions</li>
* <li>stacktrace</li>
- * <li>indy</li>
* <li>scriptBaseClass</li>
* <li>stubdir</li>
* <li>keepStubs</li>
@@ -218,7 +217,6 @@ public class Groovyc extends MatchingTask {
private File stubDir;
private boolean keepStubs;
private boolean forceLookupUnnamedFiles;
- private boolean useIndy;
private String scriptBaseClass;
private String configscript;
@@ -705,24 +703,6 @@ public class Groovyc extends MatchingTask {
}
/**
- * Set the indy flag.
- *
- * @param useIndy the indy flag
- */
- public void setIndy(boolean useIndy) {
- this.useIndy = useIndy;
- }
-
- /**
- * Get the value of the indy flag.
- *
- * @return if to use indy
- */
- public boolean getIndy() {
- return this.useIndy;
- }
-
- /**
* Set the base script class name for the scripts (must derive from Script)
*
* @param scriptBaseClass Base class name for scripts (must derive from Script)
@@ -1206,9 +1186,6 @@ public class Groovyc extends MatchingTask {
if (previewFeatures) {
commandLineList.add("--enable-preview");
}
- if (useIndy) {
- commandLineList.add("--indy");
- }
if (scriptBaseClass != null) {
commandLineList.add("-b");
commandLineList.add(scriptBaseClass);
diff --git a/subprojects/groovy-ant/src/spec/doc/groovy-ant-task.adoc b/subprojects/groovy-ant/src/spec/doc/groovy-ant-task.adoc
index cea3333..6057f70 100644
--- a/subprojects/groovy-ant/src/spec/doc/groovy-ant-task.adoc
+++ b/subprojects/groovy-ant/src/spec/doc/groovy-ant-task.adoc
@@ -118,7 +118,6 @@ You might need to use the _contextClassLoader_ attribute (see below) if any of y
|append|If enabled and output is to a file, append to existing file rather than overwrite. Defaults to false.|No
|fork|If enabled the script will be executed in a forked JVM process (disabled by default).|No
|scriptBaseClass|The name of the base class for scripts.|No
-|indy|If enabled the script will be executed with `invokedynamic` (disabled by default).|No
|parameters|Generates metadata for reflection on method parameter names on JDK 8 and above. Defaults to false. |No
|useGroovyShell|If enabled a new GroovyShell is used to run the script. Special variables won't be available but you don't need Ant in the classpath. Defaults to false. |No
|includeAntRuntime|If enabled the system classpath will be included on the classpath when forking. Defaults to true. |No
diff --git a/subprojects/groovy-cli-picocli/src/test/groovy/groovy/cli/picocli/CliBuilderTest.groovy b/subprojects/groovy-cli-picocli/src/test/groovy/groovy/cli/picocli/CliBuilderTest.groovy
index c0de44a..1c331c8 100644
--- a/subprojects/groovy-cli-picocli/src/test/groovy/groovy/cli/picocli/CliBuilderTest.groovy
+++ b/subprojects/groovy-cli-picocli/src/test/groovy/groovy/cli/picocli/CliBuilderTest.groovy
@@ -898,7 +898,6 @@ class CliBuilderTest extends GroovyTestCase {
V(longOpt: 'version', 'cli.option.version.description')
pa(longOpt: 'parameters', 'cli.option.parameters.description')
pr(longOpt: 'enable-preview', 'cli.option.preview.description')
- i(longOpt: 'indy', 'cli.option.indy.description')
D(longOpt: 'define', args: 2, argName: 'name=value', valueSeparator: '=', 'cli.option.define.description')
_(longOpt: 'configscript', args: 1, 'cli.option.configscript.description')
}
@@ -918,13 +917,7 @@ class CliBuilderTest extends GroovyTestCase {
assert cli.parse(['--enable-preview']).'enable-preview'
assert cli.parse(['--enable-preview']).pr
- assert cli.parse(['--indy']).indy
- assert cli.parse(['--indy']).i
resetPrintWriter()
- cli.writer = printWriter
- assert cli.parse(['-indy']) == null
- assertTrue(stringWriter.toString().startsWith('error: Unmatched argument'))
- assertTrue(stringWriter.toString().contains('-ndy'))
assert cli.parse(['--help']).help
assert cli.parse(['--help']).h
@@ -957,7 +950,6 @@ class CliBuilderTest extends GroovyTestCase {
V(longOpt: 'version', 'cli.option.version.description')
pa(longOpt: 'parameters', 'cli.option.parameters.description')
pr(longOpt: 'enable-preview', 'cli.option.preview.description')
- i(longOpt: 'indy', 'cli.option.indy.description')
D(longOpt: 'define', args: 2, argName: 'name=value', valueSeparator: '=', 'cli.option.define.description')
_(longOpt: 'configscript', args: 1, 'cli.option.configscript.description')
}
@@ -974,10 +966,6 @@ class CliBuilderTest extends GroovyTestCase {
assert cli.parse(['-enable-preview']).'enable-preview'
assert cli.parse(['-pr']).pr
- assert cli.parse(['--indy']).i
- assert cli.parse(['-indy']).i
- assert cli.parse(['-i']).indy
-
assert cli.parse(['--help']).h
assert cli.parse(['-help']).h
assert cli.parse(['-h']).help
@@ -1023,13 +1011,12 @@ class CliBuilderTest extends GroovyTestCase {
V(longOpt: 'version', 'cli.option.version.description')
pa(longOpt: 'parameters', 'cli.option.parameters.description')
pr(longOpt: 'enable-preview', 'cli.option.preview.description')
- i(longOpt: 'indy', 'cli.option.indy.description')
D(longOpt: 'define', args: 2, argName: 'String', valueSeparator: '=', 'cli.option.define.description')
_(longOpt: 'configscript', args: 1, 'cli.option.configscript.description')
}
cli.usage()
def expectedUsage = """\
-Usage: groovy [-hiV] [-cp] [-pa] [-pr] [-configscript=PARAM]
+Usage: groovy [-hV] [-cp] [-pa] [-pr] [-configscript=PARAM]
[-D=<String>=<String>]...
-configscript, --configscript=PARAM
cli.option.configscript.description
@@ -1038,7 +1025,6 @@ Usage: groovy [-hiV] [-cp] [-pa] [-pr] [-configscript=PARAM]
-D, -define, --define=<String>=<String>
cli.option.define.description
-h, -help, --help cli.option.help.description
- -i, -indy, --indy cli.option.indy.description
-pa, -parameters, --parameters
cli.option.parameters.description
-pr, -enable-preview, --enable-preview
@@ -1054,20 +1040,18 @@ Usage: groovy [-hiV] [-cp] [-pa] [-pr] [-configscript=PARAM]
V(longOpt: 'version', 'cli.option.version.description')
pa(longOpt: 'parameters', 'cli.option.parameters.description')
pr(longOpt: 'enable-preview', 'cli.option.preview.description')
- i(longOpt: 'indy', 'cli.option.indy.description')
D(longOpt: 'define', args: 2, argName: 'String', valueSeparator: '=', 'cli.option.define.description')
_(longOpt: 'configscript', args: 1, 'cli.option.configscript.description')
}
cli.usage()
expectedUsage = """\
-Usage: groovy [-hiV] [-cp] [-pa] [-pr] [--configscript=PARAM]
+Usage: groovy [-hV] [-cp] [-pa] [-pr] [--configscript=PARAM]
[-D=<String>=<String>]...
--configscript=PARAM cli.option.configscript.description
-cp, --classpath cli.option.cp.description
-D, --define=<String>=<String>
cli.option.define.description
-h, --help cli.option.help.description
- -i, --indy cli.option.indy.description
-pa, --parameters cli.option.parameters.description
-pr, --enable-preview cli.option.preview.description
-V, --version cli.option.version.description"""
diff --git a/subprojects/groovy-console/src/main/groovy/groovy/console/ui/AstBrowser.groovy b/subprojects/groovy-console/src/main/groovy/groovy/console/ui/AstBrowser.groovy
index d2f6fab..1b21ea8 100644
--- a/subprojects/groovy-console/src/main/groovy/groovy/console/ui/AstBrowser.groovy
+++ b/subprojects/groovy-console/src/main/groovy/groovy/console/ui/AstBrowser.groovy
@@ -69,7 +69,7 @@ class AstBrowser {
private static final String NO_BYTECODE_AVAILABLE_AT_THIS_PHASE = '// No bytecode available at this phase'
private inputArea, rootElement, decompiledSource, jTree, propertyTable, splitterPane, mainSplitter, bytecodeView, asmifierView
- boolean showScriptFreeForm, showScriptClass, showClosureClasses, showTreeView, showIndyBytecode
+ boolean showScriptFreeForm, showScriptClass, showClosureClasses, showTreeView
GeneratedBytecodeAwareGroovyClassLoader classLoader
def prefs = new AstBrowserUiPreferences()
Action refreshAction
@@ -118,14 +118,13 @@ class AstBrowser {
showScriptClass = prefs.showScriptClass
showClosureClasses = prefs.showClosureClasses
showTreeView = prefs.showTreeView
- showIndyBytecode = prefs.showIndyBytecode
frame = swing.frame(title: 'Groovy AST Browser' + (name ? " - $name" : ''),
location: prefs.frameLocation,
size: prefs.frameSize,
iconImage: swing.imageIcon(Console.ICON_PATH).image,
defaultCloseOperation: WindowConstants.DISPOSE_ON_CLOSE,
- windowClosing: { event -> prefs.save(frame, splitterPane, mainSplitter, showScriptFreeForm, showScriptClass, showClosureClasses, phasePicker.selectedItem, showTreeView, showIndyBytecode) }) {
+ windowClosing: { event -> prefs.save(frame, splitterPane, mainSplitter, showScriptFreeForm, showScriptClass, showClosureClasses, phasePicker.selectedItem, showTreeView) }) {
menuBar {
menu(text: 'Show Script', mnemonic: 'S') {
@@ -145,10 +144,6 @@ class AstBrowser {
action(name: 'Tree View', closure: this.&showTreeView,
mnemonic: 'T')
}
- checkBoxMenuItem(selected: showIndyBytecode) {
- action(name: 'Generate Indy Bytecode', closure: this.&showIndyBytecode,
- mnemonic: 'I')
- }
}
menu(text: 'View', mnemonic: 'V') {
menuItem {
@@ -435,32 +430,12 @@ class AstBrowser {
}
}
- void showIndyBytecode(EventObject evt = null) {
- showIndyBytecode = evt.source.selected
- initAuxViews()
- refreshAction.actionPerformed(null)
- updateTabTitles()
- }
-
- private void updateTabTitles() {
- def tabPane = mainSplitter.bottomComponent
- int tabCount = tabPane.getTabCount()
- for (int i = 0; i < tabCount; i++) {
- def component = tabPane.getComponentAt(i)
- if (bytecodeView.is(component)) {
- tabPane.setTitleAt(i, getByteCodeTitle())
- } else if (asmifierView.is(component)) {
- tabPane.setTitleAt(i, getASMifierTitle())
- }
- }
- }
-
private String getByteCodeTitle() {
- 'Bytecode' + (showIndyBytecode ? ' (Indy)' : '')
+ 'Bytecode'
}
private String getASMifierTitle() {
- 'ASMifier' + (showIndyBytecode ? ' (Indy)' : '')
+ 'ASMifier'
}
void decompile(phaseId, source) {
@@ -502,7 +477,7 @@ class AstBrowser {
def nodeMaker = new SwingTreeNodeMaker()
def adapter = new ScriptToTreeNodeAdapter(classLoader, showScriptFreeForm, showScriptClass, showClosureClasses, nodeMaker, config)
classLoader.clearBytecodeTable()
- def result = adapter.compile(script, compilePhase, showIndyBytecode)
+ def result = adapter.compile(script, compilePhase)
swing.doLater {
model.setRoot(result)
model.reload()
@@ -531,7 +506,6 @@ class AstBrowserUiPreferences {
final boolean showTreeView
final boolean showScriptClass
final boolean showClosureClasses
- final boolean showIndyBytecode
int decompiledSourceFontSize
final CompilePhaseAdapter selectedPhase
@@ -551,14 +525,13 @@ class AstBrowserUiPreferences {
showScriptClass = prefs.getBoolean('showScriptClass', true)
showClosureClasses = prefs.getBoolean('showClosureClasses', false)
showTreeView = prefs.getBoolean('showTreeView', true)
- showIndyBytecode = prefs.getBoolean('showIndyBytecode', false)
int phase = prefs.getInt('compilerPhase', Phases.SEMANTIC_ANALYSIS)
selectedPhase = CompilePhaseAdapter.values().find {
it.phaseId == phase
}
}
- def save(frame, vSplitter, hSplitter, scriptFreeFormPref, scriptClassPref, closureClassesPref, CompilePhaseAdapter phase, showTreeView, showIndyBytecode = false) {
+ def save(frame, vSplitter, hSplitter, scriptFreeFormPref, scriptClassPref, closureClassesPref, CompilePhaseAdapter phase, showTreeView) {
Preferences prefs = Preferences.userNodeForPackage(AstBrowserUiPreferences)
prefs.putInt('decompiledFontSize', decompiledSourceFontSize as int)
prefs.putInt('frameX', frame.location.x as int)
@@ -571,7 +544,6 @@ class AstBrowserUiPreferences {
prefs.putBoolean('showScriptClass', scriptClassPref)
prefs.putBoolean('showClosureClasses', closureClassesPref)
prefs.putBoolean('showTreeView', showTreeView)
- prefs.putBoolean('showIndyBytecode', showIndyBytecode)
prefs.putInt('compilerPhase', phase.phaseId)
}
}
diff --git a/subprojects/groovy-console/src/main/groovy/groovy/console/ui/Console.groovy b/subprojects/groovy-console/src/main/groovy/groovy/console/ui/Console.groovy
index 6a5a90c..72b8e5e 100644
--- a/subprojects/groovy-console/src/main/groovy/groovy/console/ui/Console.groovy
+++ b/subprojects/groovy-console/src/main/groovy/groovy/console/ui/Console.groovy
@@ -162,9 +162,6 @@ class Console implements CaretListener, HyperlinkListener, ComponentListener, Fo
boolean loopMode = prefs.getBoolean('loopMode', false)
int inputAreaContentHash
- boolean indy = prefs.getBoolean('indy', false)
- Action indyAction
-
//to allow loading classes dynamically when using @Grab (GROOVY-4877, GROOVY-5871)
boolean useScriptClassLoaderForScriptExecution = false
@@ -254,7 +251,6 @@ class Console implements CaretListener, HyperlinkListener, ComponentListener, Fo
V(longOpt: 'version', messages['cli.option.version.description'])
pa(longOpt: 'parameters', messages['cli.option.parameters.description'])
pr(longOpt: 'enable-preview', messages['cli.option.enable.preview.description'])
- i(longOpt: 'indy', messages['cli.option.indy.description'])
D(longOpt: 'define', type: Map, argName: 'name=value', messages['cli.option.define.description'])
_(longOpt: 'configscript', args: 1, messages['cli.option.configscript.description'])
}
@@ -300,10 +296,6 @@ class Console implements CaretListener, HyperlinkListener, ComponentListener, Fo
baseConfig.setParameters(options.hasOption("pa"))
- if (options.i) {
- enableIndy(baseConfig)
- }
-
def console = new Console(Thread.currentThread().contextClassLoader, new Binding(), baseConfig)
console.useScriptClassLoaderForScriptExecution = true
console.run()
@@ -360,10 +352,6 @@ class Console implements CaretListener, HyperlinkListener, ComponentListener, Fo
Console(ClassLoader parent, Binding binding = new Binding(), CompilerConfiguration baseConfig = new CompilerConfiguration(System.getProperties())) {
this.baseConfig = baseConfig
this.maxOutputChars = loadMaxOutputChars()
- indy = indy || isIndyEnabled(baseConfig)
- if (indy) {
- enableIndy(baseConfig)
- }
// Set up output file for stdout/stderr, if any
def outputLogFileName = prefs.get('outputLogFileName', null)
@@ -477,7 +465,7 @@ class Console implements CaretListener, HyperlinkListener, ComponentListener, Fo
swing.consoleFrame.show()
}
installInterceptor()
- updateTitle() // Title changes based on indy setting
+ updateTitle()
swing.doLater inputArea.&requestFocus
}
@@ -1259,30 +1247,6 @@ class Console implements CaretListener, HyperlinkListener, ComponentListener, Fo
prefs.putBoolean('loopMode', loopMode)
}
- void indy(EventObject evt = null) {
- indy = evt.source.selected
- prefs.putBoolean('indy', indy)
- if (indy) {
- enableIndy(baseConfig)
- } else {
- disableIndy(baseConfig)
- }
- updateTitle()
- newScript(shell.classLoader, shell.context)
- }
-
- private static void enableIndy(CompilerConfiguration cc) {
- cc.getOptimizationOptions().put(CompilerConfiguration.INVOKEDYNAMIC, true)
- }
-
- private static void disableIndy(CompilerConfiguration cc) {
- cc.getOptimizationOptions().remove(CompilerConfiguration.INVOKEDYNAMIC)
- }
-
- private static boolean isIndyEnabled(CompilerConfiguration cc) {
- cc.getOptimizationOptions().get(CompilerConfiguration.INVOKEDYNAMIC)
- }
-
void runSelectedJava(EventObject evt = null) {
runSelectedScript(evt, new JavaSourceType())
}
@@ -1746,9 +1710,6 @@ class Console implements CaretListener, HyperlinkListener, ComponentListener, Fo
void updateTitle() {
if (frame.title) {
String title = 'GroovyConsole'
- if (indy) {
- title += ' (Indy)'
- }
if (scriptFile != null) {
frame.title = scriptFile.name + (dirty ? ' * ' : '') + ' - ' + title
} else {
diff --git a/subprojects/groovy-console/src/main/groovy/groovy/console/ui/ConsoleActions.groovy b/subprojects/groovy-console/src/main/groovy/groovy/console/ui/ConsoleActions.groovy
index eea6bcd..5c9b52b 100644
--- a/subprojects/groovy-console/src/main/groovy/groovy/console/ui/ConsoleActions.groovy
+++ b/subprojects/groovy-console/src/main/groovy/groovy/console/ui/ConsoleActions.groovy
@@ -446,13 +446,6 @@ selectBlockAction = action(
shortDescription: 'Selects current Word, Line or Block in Script'
)
-indyAction = action(
- name: 'Enable Indy Compilation',
- closure: controller.&indy,
- mnemonic: 'I',
- shortDescription: 'Enable InvokeDynamic (Indy) compilation for scripts'
-)
-
preferencesAction = action(
name: 'Preferences',
closure: controller.&preferences,
diff --git a/subprojects/groovy-console/src/main/groovy/groovy/console/ui/ScriptToTreeNodeAdapter.groovy b/subprojects/groovy-console/src/main/groovy/groovy/console/ui/ScriptToTreeNodeAdapter.groovy
index c9e78f4..f2f0fb3 100644
--- a/subprojects/groovy-console/src/main/groovy/groovy/console/ui/ScriptToTreeNodeAdapter.groovy
+++ b/subprojects/groovy-console/src/main/groovy/groovy/console/ui/ScriptToTreeNodeAdapter.groovy
@@ -164,19 +164,14 @@ class ScriptToTreeNodeAdapter {
* a Groovy script in String form
* @param compilePhase
* the int based CompilePhase to compile it to.
- * @param indy
- * if {@code true} InvokeDynamic (Indy) bytecode is generated
*/
- def compile(String script, int compilePhase, boolean indy=false) {
+ def compile(String script, int compilePhase) {
def scriptName = 'script' + System.currentTimeMillis() + '.groovy'
GroovyCodeSource codeSource = new GroovyCodeSource(script, scriptName, '/groovy/script')
CompilerConfiguration cc = new CompilerConfiguration(config ?: CompilerConfiguration.DEFAULT)
if (config) {
cc.addCompilationCustomizers(*config.compilationCustomizers)
}
- if (indy) {
- cc.optimizationOptions.put(CompilerConfiguration.INVOKEDYNAMIC, true)
- }
CompilationUnit cu = new CompilationUnit(cc, codeSource.codeSource, classLoader)
cu.setClassgenCallback(classLoader.createCollector(cu, null))
diff --git a/subprojects/groovy-console/src/main/groovy/groovy/console/ui/view/BasicMenuBar.groovy b/subprojects/groovy-console/src/main/groovy/groovy/console/ui/view/BasicMenuBar.groovy
index f584595..f598e40 100644
--- a/subprojects/groovy-console/src/main/groovy/groovy/console/ui/view/BasicMenuBar.groovy
+++ b/subprojects/groovy-console/src/main/groovy/groovy/console/ui/view/BasicMenuBar.groovy
@@ -87,7 +87,6 @@ menuBar {
menuItem(interruptAction)
menuItem(compileAction)
menuItem(compileJavaAction)
- checkBoxMenuItem(indyAction, selected: controller.indy)
separator()
menuItem(addClasspathJar)
menuItem(addClasspathDir)
diff --git a/subprojects/groovy-console/src/main/resources/groovy/console/ui/Console.properties b/subprojects/groovy-console/src/main/resources/groovy/console/ui/Console.properties
index 56371c2..f0ad966 100644
--- a/subprojects/groovy-console/src/main/resources/groovy/console/ui/Console.properties
+++ b/subprojects/groovy-console/src/main/resources/groovy/console/ui/Console.properties
@@ -30,8 +30,6 @@ cli.option.enable.preview.description=Enable preview Java features (JEP 12) (jdk
cli.option.parameters.description=Generate metadata for reflection on method parameter names (jdk8+ only)
-cli.option.indy.description=Enable InvokeDynamic (Indy) compilation for scripts
-
cli.option.define.description=Define a system property
cli.option.configscript.description=A script for tweaking the compiler configuration options
diff --git a/subprojects/groovy-console/src/spec/doc/groovy-console.adoc b/subprojects/groovy-console/src/spec/doc/groovy-console.adoc
index a77d7df..d149f9d 100644
--- a/subprojects/groovy-console/src/spec/doc/groovy-console.adoc
+++ b/subprojects/groovy-console/src/spec/doc/groovy-console.adoc
@@ -61,7 +61,6 @@ The Groovy Swing Console allows a user to enter and run Groovy scripts.
argument
-D, --define=<name=value> Define a system property
-h, --help Display this help message
- -i, --indy Enable InvokeDynamic (Indy) compilation for scripts
-pa, --parameters Generate metadata for reflection on method parameter
names (jdk8+ only)
-pr, --enable-preview Enable preview Java features (JEP 12) (jdk12+ only)
@@ -142,8 +141,6 @@ being run by adding a new JAR or a directory to the classpath from the
`Script` menu
* Error hyperlinking from the output area when a compilation error is
expected or when an exception is thrown
-* You can enable InvokeDynamic (Indy) compilation mode by selecting
-`Enable Indy Compilation` from the `Script` menu
[[GroovyConsole-EmbeddingtheConsole]]
== Embedding the Console
diff --git a/subprojects/groovy-console/src/test/groovy/groovy/console/SwingBuilderConsoleTest.groovy b/subprojects/groovy-console/src/test/groovy/groovy/console/SwingBuilderConsoleTest.groovy
index 6e4be7b..6d57206 100644
--- a/subprojects/groovy-console/src/test/groovy/groovy/console/SwingBuilderConsoleTest.groovy
+++ b/subprojects/groovy-console/src/test/groovy/groovy/console/SwingBuilderConsoleTest.groovy
@@ -25,14 +25,13 @@ import groovy.console.ui.view.MacOSXMenuBar
import groovy.swing.GroovySwingTestCase
import groovy.swing.SwingBuilder
import org.codehaus.groovy.control.CompilerConfiguration
-
-import javax.swing.JTextPane
-import java.awt.event.ActionEvent
-import java.util.prefs.Preferences
import org.junit.rules.TemporaryFolder
+import javax.swing.JTextPane
import javax.swing.SwingUtilities
import java.awt.Color
+import java.awt.event.ActionEvent
+import java.util.prefs.Preferences
class SwingBuilderConsoleTest extends GroovySwingTestCase {
@@ -591,21 +590,13 @@ class SwingBuilderConsoleTest extends GroovySwingTestCase {
def outputDocument = console.outputArea.document
console.inputEditor.textEditor.text = scriptSource
- console.indy(new EventObject([selected: true]))
- assert console.prefs.getBoolean('indy', false)
- assert console.frame.title == 'GroovyConsole (Indy)'
-
console.runScript(new EventObject([:]))
assert console.config.getOptimizationOptions().get(CompilerConfiguration.INVOKEDYNAMIC)
assert outputDocument.getText(0, outputDocument.length) == 'Result: foobar'
- console.indy(new EventObject([selected: false]))
- assert !console.prefs.getBoolean('indy', true)
- assert console.frame.title == 'GroovyConsole'
-
console.outputArea.text = ''
console.runScript(new EventObject([:]))
- assert !console.config.getOptimizationOptions().get(CompilerConfiguration.INVOKEDYNAMIC)
+ assert console.config.getOptimizationOptions().get(CompilerConfiguration.INVOKEDYNAMIC)
assert outputDocument.getText(0, outputDocument.length) == 'Result: foobar'
} finally {
GroovySystem.metaClassRegistry.removeMetaClass(Thread)
diff --git a/subprojects/groovy-console/src/test/groovy/groovy/console/ui/ScriptToTreeNodeAdapterTest.groovy b/subprojects/groovy-console/src/test/groovy/groovy/console/ui/ScriptToTreeNodeAdapterTest.groovy
index 7653a81..538d974 100644
--- a/subprojects/groovy-console/src/test/groovy/groovy/console/ui/ScriptToTreeNodeAdapterTest.groovy
+++ b/subprojects/groovy-console/src/test/groovy/groovy/console/ui/ScriptToTreeNodeAdapterTest.groovy
@@ -611,7 +611,7 @@ class ScriptToTreeNodeAdapterTest extends GroovyTestCase {
void test() {}
}
- ''', Phases.CLASS_GENERATION, true) as TreeNode
+ ''', Phases.CLASS_GENERATION) as TreeNode
def classNodeTest = root.children().find { it.toString() == 'ClassNode - Test' }
def methods = classNodeTest.children().find { it.toString() == 'Methods' }