groovy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sun...@apache.org
Subject [groovy] 04/04: remove short option names & small fixes
Date Wed, 21 Aug 2019 10:07:47 GMT
This is an automated email from the ASF dual-hosted git repository.

sunlan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git

commit 4e625616b50d2f4d21e53e644583c1c98e517f77
Author: Davyd Kohut <expexes@gmail.com>
AuthorDate: Fri Aug 16 20:28:10 2019 +0300

    remove short option names & small fixes
---
 src/main/java/groovy/ui/GroovyMain.java                        | 10 ++++++----
 .../java/org/codehaus/groovy/tools/FileSystemCompiler.java     |  8 +++++---
 2 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/src/main/java/groovy/ui/GroovyMain.java b/src/main/java/groovy/ui/GroovyMain.java
index a05a2c7..1d9ae63 100644
--- a/src/main/java/groovy/ui/GroovyMain.java
+++ b/src/main/java/groovy/ui/GroovyMain.java
@@ -231,10 +231,10 @@ public class GroovyMain {
         @Option(names = {"-v", "--version"}, versionHelp = true, description = "Print version
information and exit")
         private boolean versionRequested;
 
-        @Option(names = {"-cs", "--compile-static"}, description = "Use CompileStatic")
+        @Option(names = {"--compile-static"}, description = "Use CompileStatic")
         private boolean compileStatic;
 
-        @Option(names = {"-tc", "--type-checked"}, description = "Use TypeChecked")
+        @Option(names = {"--type-checked"}, description = "Use TypeChecked")
         private boolean typeChecked;
 
         @Unmatched
@@ -311,7 +311,9 @@ public class GroovyMain {
             if (typeChecked) {
                 transformations.add("ast(groovy.transform.TypeChecked)");
             }
-            processConfigScriptText(buildConfigScriptText(transformations), main.conf);
+            if (!transformations.isEmpty()) {
+                processConfigScriptText(buildConfigScriptText(transformations), main.conf);
+            }
 
             processConfigScripts(getConfigScripts(), main.conf);
 
@@ -347,7 +349,7 @@ public class GroovyMain {
         }
     }
 
-    public static void processConfigScriptText(final String scriptText, final CompilerConfiguration
conf) {
+    public static void processConfigScriptText(String scriptText, CompilerConfiguration conf)
{
         if (scriptText.trim().isEmpty()) return;
 
         GroovyShell shell = createConfigScriptsShell(conf);
diff --git a/src/main/java/org/codehaus/groovy/tools/FileSystemCompiler.java b/src/main/java/org/codehaus/groovy/tools/FileSystemCompiler.java
index 3aab7de..3a94c70 100644
--- a/src/main/java/org/codehaus/groovy/tools/FileSystemCompiler.java
+++ b/src/main/java/org/codehaus/groovy/tools/FileSystemCompiler.java
@@ -396,10 +396,10 @@ public class FileSystemCompiler {
                 paramLabel = "<source-files>")
         private List<String> files;
 
-        @Option(names = {"-cs", "--compile-static"}, description = "Use CompileStatic")
+        @Option(names = {"--compile-static"}, description = "Use CompileStatic")
         private boolean compileStatic;
 
-        @Option(names = {"-tc", "--type-checked"}, description = "Use TypeChecked")
+        @Option(names = {"--type-checked"}, description = "Use TypeChecked")
         private boolean typeChecked;
 
         public CompilerConfiguration toCompilerConfiguration() throws IOException {
@@ -439,7 +439,9 @@ public class FileSystemCompiler {
             if (typeChecked) {
                 transformations.add("ast(groovy.transform.TypeChecked)");
             }
-            processConfigScriptText(buildConfigScriptText(transformations), configuration);
+            if (!transformations.isEmpty()) {
+                processConfigScriptText(buildConfigScriptText(transformations), configuration);
+            }
 
             String configScripts = System.getProperty("groovy.starter.configscripts", null);
             if (configScript != null || (configScripts != null && !configScripts.isEmpty()))
{


Mime
View raw message