This is an automated email from the ASF dual-hosted git repository. joshtynjala pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/royale-compiler.git
commit 0ce9c93afc611777fa5e5e4ee1201ea6f5b675ab Author: Josh Tynjala <[email protected]> AuthorDate: Mon Dec 4 14:29:14 2023 -0800 JSOutputType: this enum is used only by ASDOCJSC now, so move it there and remove leftover dead code references from other parts of the compiler --- .../apache/royale/compiler/clients/ASDOCJSC.java | 36 +++++++++++++++++++- .../apache/royale/compiler/clients/COMPJSC.java | 2 +- .../royale/compiler/clients/JSConfiguration.java | 2 ++ .../apache/royale/compiler/clients/MXMLJSC.java | 38 +--------------------- .../royale/compiler/clients/MXMLJSCRoyale.java | 2 -- .../compiler/clients/MXMLJSCRoyaleCordova.java | 2 -- .../src/main/java/flex2/tools/Tool.java | 1 - 7 files changed, 39 insertions(+), 44 deletions(-) diff --git a/compiler-jx/src/main/java/org/apache/royale/compiler/clients/ASDOCJSC.java b/compiler-jx/src/main/java/org/apache/royale/compiler/clients/ASDOCJSC.java index b8511d6c0..3a262023e 100644 --- a/compiler-jx/src/main/java/org/apache/royale/compiler/clients/ASDOCJSC.java +++ b/compiler-jx/src/main/java/org/apache/royale/compiler/clients/ASDOCJSC.java @@ -111,6 +111,40 @@ public class ASDOCJSC extends MXMLJSCRoyale System.exit(exitCode); } + /* + * JS output type enumerations. + */ + public enum JSOutputType + { + ROYALE("royale"), + ROYALE_DUAL("royale_dual"), + ROYALE_DITA("royale_dita"), + JSC("jsc"), + NODE("node"); + + private String text; + + JSOutputType(String text) + { + this.text = text; + } + + public String getText() + { + return this.text; + } + + public static JSOutputType fromString(String text) + { + for (JSOutputType jsOutputType : JSOutputType.values()) + { + if (text.equalsIgnoreCase(jsOutputType.text)) + return jsOutputType; + } + return ROYALE; + } + } + /** * Entry point for the {@code <compc>} Ant task. * @@ -126,7 +160,7 @@ public class ASDOCJSC extends MXMLJSCRoyale { if (s.contains("js-output-type")) { - jsOutputType = MXMLJSC.JSOutputType.fromString(s.split("=")[1]); + JSOutputType jsOutputType = JSOutputType.fromString(s.split("=")[1]); switch (jsOutputType) { diff --git a/compiler-jx/src/main/java/org/apache/royale/compiler/clients/COMPJSC.java b/compiler-jx/src/main/java/org/apache/royale/compiler/clients/COMPJSC.java index 14fa8352f..cb3f8d042 100644 --- a/compiler-jx/src/main/java/org/apache/royale/compiler/clients/COMPJSC.java +++ b/compiler-jx/src/main/java/org/apache/royale/compiler/clients/COMPJSC.java @@ -206,7 +206,7 @@ public class COMPJSC extends MXMLJSC break targetloop; } break; - // if you add a new js-output-type here, don't forget to also add it + // if you add a new target here, don't forget to also add it // to flex2.tools.MxmlJSC in flex-compiler-oem for IDE support } } diff --git a/compiler-jx/src/main/java/org/apache/royale/compiler/clients/JSConfiguration.java b/compiler-jx/src/main/java/org/apache/royale/compiler/clients/JSConfiguration.java index 3dbf88b49..13c257ec2 100644 --- a/compiler-jx/src/main/java/org/apache/royale/compiler/clients/JSConfiguration.java +++ b/compiler-jx/src/main/java/org/apache/royale/compiler/clients/JSConfiguration.java @@ -102,6 +102,8 @@ public class JSConfiguration extends Configuration // 'js-output-type' // + // NOTE: js-output-type was replaced by targets + @Config @Mapping("js-output-type") public void setJSOutputType(ConfigurationValue cv, String value) diff --git a/compiler-jx/src/main/java/org/apache/royale/compiler/clients/MXMLJSC.java b/compiler-jx/src/main/java/org/apache/royale/compiler/clients/MXMLJSC.java index ccb2459b4..7934e5850 100644 --- a/compiler-jx/src/main/java/org/apache/royale/compiler/clients/MXMLJSC.java +++ b/compiler-jx/src/main/java/org/apache/royale/compiler/clients/MXMLJSC.java @@ -86,40 +86,6 @@ public class MXMLJSC implements JSCompilerEntryPoint, ProblemQueryProvider, private static final String DEFAULT_VAR = "file-specs"; private static final String L10N_CONFIG_PREFIX = "org.apache.royale.compiler.internal.config.configuration"; - /* - * JS output type enumerations. - */ - public enum JSOutputType - { - ROYALE("royale"), - ROYALE_DUAL("royale_dual"), - ROYALE_DITA("royale_dita"), - JSC("jsc"), - NODE("node"); - - private String text; - - JSOutputType(String text) - { - this.text = text; - } - - public String getText() - { - return this.text; - } - - public static JSOutputType fromString(String text) - { - for (JSOutputType jsOutputType : JSOutputType.values()) - { - if (text.equalsIgnoreCase(jsOutputType.text)) - return jsOutputType; - } - return ROYALE; - } - } - /* * JS output type enumerations. */ @@ -183,8 +149,6 @@ public class MXMLJSC implements JSCompilerEntryPoint, ProblemQueryProvider, } } - public static JSOutputType jsOutputType; - @Override public String getName() { @@ -383,7 +347,7 @@ public class MXMLJSC implements JSCompilerEntryPoint, ProblemQueryProvider, break targetloop; } break; - // if you add a new js-output-type here, don't forget to also add it + // if you add a new target here, don't forget to also add it // to flex2.tools.MxmlJSC in flex-compiler-oem for IDE support } } diff --git a/compiler-jx/src/main/java/org/apache/royale/compiler/clients/MXMLJSCRoyale.java b/compiler-jx/src/main/java/org/apache/royale/compiler/clients/MXMLJSCRoyale.java index 5f30188a6..a9de155f4 100644 --- a/compiler-jx/src/main/java/org/apache/royale/compiler/clients/MXMLJSCRoyale.java +++ b/compiler-jx/src/main/java/org/apache/royale/compiler/clients/MXMLJSCRoyale.java @@ -143,8 +143,6 @@ public class MXMLJSCRoyale implements JSCompilerEntryPoint, ProblemQueryProvider } } - public static MXMLJSC.JSOutputType jsOutputType; - @Override public String getName() { diff --git a/compiler-jx/src/main/java/org/apache/royale/compiler/clients/MXMLJSCRoyaleCordova.java b/compiler-jx/src/main/java/org/apache/royale/compiler/clients/MXMLJSCRoyaleCordova.java index c93896aca..f6075ee16 100644 --- a/compiler-jx/src/main/java/org/apache/royale/compiler/clients/MXMLJSCRoyaleCordova.java +++ b/compiler-jx/src/main/java/org/apache/royale/compiler/clients/MXMLJSCRoyaleCordova.java @@ -123,8 +123,6 @@ public class MXMLJSCRoyaleCordova implements JSCompilerEntryPoint, ProblemQueryP } } - public static MXMLJSC.JSOutputType jsOutputType; - @Override public String getName() { diff --git a/flex-compiler-oem/src/main/java/flex2/tools/Tool.java b/flex-compiler-oem/src/main/java/flex2/tools/Tool.java index 9a25baccd..e6ad42e3c 100644 --- a/flex-compiler-oem/src/main/java/flex2/tools/Tool.java +++ b/flex-compiler-oem/src/main/java/flex2/tools/Tool.java @@ -28,7 +28,6 @@ import java.util.*; import org.apache.royale.compiler.clients.COMPC; import org.apache.royale.compiler.clients.MXMLC; -import org.apache.royale.compiler.clients.MXMLJSC.JSOutputType; import org.apache.royale.compiler.clients.problems.ProblemQuery; import org.apache.royale.compiler.clients.problems.ProblemQueryProvider; import org.apache.royale.compiler.config.Configuration;
