You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by jo...@apache.org on 2019/11/20 22:37:26 UTC
[royale-compiler] 02/02: strict-identifier-names is lenient by
default for Royale,
but strict for other SDKs using Royale for code intelligence (since their
compilers will be strict)
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
View the commit online:
https://github.com/apache/royale-compiler/commit/65ceadba0698c55e57f64a011b8f4c66a63a8b0a
commit 65ceadba0698c55e57f64a011b8f4c66a63a8b0a
Author: Josh Tynjala <jo...@apache.org>
AuthorDate: Wed Nov 20 14:36:00 2019 -0800
strict-identifier-names is lenient by default for Royale, but strict for other SDKs using Royale for code intelligence (since their compilers will be strict)
---
.../java/org/apache/royale/compiler/config/Configuration.java | 7 +++----
compiler-externc/src/test/config/compile-as-config.xml | 1 +
.../org/apache/royale/compiler/clients/JSConfiguration.java | 10 ++++++++++
compiler/src/test/config/compile-as-config.xml | 3 ++-
4 files changed, 16 insertions(+), 5 deletions(-)
diff --git a/compiler-common/src/main/java/org/apache/royale/compiler/config/Configuration.java b/compiler-common/src/main/java/org/apache/royale/compiler/config/Configuration.java
index 857d43b..10717b3 100644
--- a/compiler-common/src/main/java/org/apache/royale/compiler/config/Configuration.java
+++ b/compiler-common/src/main/java/org/apache/royale/compiler/config/Configuration.java
@@ -1555,7 +1555,7 @@ public class Configuration
// 'compiler.strict-identifier-names' option
//
- private boolean strictIdentifierNames = false;
+ private boolean strictIdentifierNames = true;
public boolean getCompilerStrictIdentifierNames()
{
@@ -1568,10 +1568,9 @@ public class Configuration
*/
@Config
@Mapping({ "compiler", "strict-identifier-names" })
- @RoyaleOnly
- public void setCompilerStrictIdentifierNames(ConfigurationValue cv, boolean allow)
+ public void setCompilerStrictIdentifierNames(ConfigurationValue cv, boolean strict)
{
- this.strictIdentifierNames = allow;
+ this.strictIdentifierNames = strict;
}
//
diff --git a/compiler-externc/src/test/config/compile-as-config.xml b/compiler-externc/src/test/config/compile-as-config.xml
index a62119a..726ee2e 100644
--- a/compiler-externc/src/test/config/compile-as-config.xml
+++ b/compiler-externc/src/test/config/compile-as-config.xml
@@ -30,6 +30,7 @@
<path-element>generated-sources/externc/typedefs</path-element>
</source-path>
+ <strict-identifier-names>false</strict-identifier-names>
<warn-no-constructor>false</warn-no-constructor>
</compiler>
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 47b4a66..938a9f3 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
@@ -56,9 +56,19 @@ public class JSConfiguration extends Configuration
{
public JSConfiguration()
{
+ //for Royale projects, we want to make some changes to the compiler
+ //defaults. we do that here in JSConfiguration instead of Configuration.
+ //despite its name, JSConfiguration is used for SWF compilation too.
+
+ //we try to keep the defaults of the Configuration base class backwards
+ //compatible with other compilers, like the one in the Flex SDK. this
+ //policy helps IDEs to use the Royale compiler for code intelligence
+ //with other SDKs without requiring the IDEs to "undo" Royale's changes
+ //to defaults.
setCompilerAllowAbstractClasses(null, true);
setCompilerAllowPrivateConstructors(null, true);
setCompilerAllowImportAliases(null, true);
+ setCompilerStrictIdentifierNames(null, false);
}
//
diff --git a/compiler/src/test/config/compile-as-config.xml b/compiler/src/test/config/compile-as-config.xml
index 70e6874..afcc084 100644
--- a/compiler/src/test/config/compile-as-config.xml
+++ b/compiler/src/test/config/compile-as-config.xml
@@ -28,7 +28,8 @@
<external-library-path>
<path-element>../../compiler-externc/target/js.swc</path-element>
</external-library-path>
-
+
+ <strict-identifier-names>false</strict-identifier-names>
<warn-no-constructor>false</warn-no-constructor>
</compiler>