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/12/10 19:24:39 UTC

[royale-compiler] 02/02: royale-maven-plugin: the MXML language manifest is added separately from other namespaces because it shouldn't affect the namespaces collection used by the template (references #103)

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 b0c6008d7b7f305c3e7c628027bb2334b31de336
Author: Josh Tynjala <jo...@apache.org>
AuthorDate: Tue Dec 10 10:53:48 2019 -0800

    royale-maven-plugin: the MXML language manifest is added separately from other namespaces because it shouldn't affect the namespaces collection used by the template (references #103)
    
    This caused issue where the MXML language namespace could be added to things like include-namespace, which is wrong. This will prevent the same issue in the future.
---
 .../src/main/java/org/apache/royale/maven/BaseMojo.java      |  8 ++------
 .../src/main/resources/config/compile-app-config.xml         |  6 ++++++
 .../src/main/resources/config/compile-asdoc-js-config.xml    | 12 +++++++++---
 .../src/main/resources/config/compile-asdoc-swf-config.xml   |  6 ++++++
 .../src/main/resources/config/compile-extern-config.xml      |  6 ++++++
 .../src/main/resources/config/compile-js-config.xml          |  6 ++++++
 .../src/main/resources/config/compile-swf-config.xml         |  6 ++++++
 7 files changed, 41 insertions(+), 9 deletions(-)

diff --git a/royale-maven-plugin/src/main/java/org/apache/royale/maven/BaseMojo.java b/royale-maven-plugin/src/main/java/org/apache/royale/maven/BaseMojo.java
index cef9149..f1cf374 100644
--- a/royale-maven-plugin/src/main/java/org/apache/royale/maven/BaseMojo.java
+++ b/royale-maven-plugin/src/main/java/org/apache/royale/maven/BaseMojo.java
@@ -140,12 +140,8 @@ public abstract class BaseMojo
         context.put("swfExternalLibraries", swfExternalLibraries);
         context.put("themeLibraries", themeLibraries);
         context.put("sourcePaths", sourcePaths);
-        List<Namespace> namespaces = getNamespaces();
-        // not good to put the language namespace into getNamespaces() because
-        // the result of getNamespaces() is used in places where the language 
-        // namespace should not be included.
-        namespaces.add(getLanguageNamespace());
-        context.put("namespaces", namespaces);
+        context.put("languageNamespace", getLanguageNamespace());
+        context.put("namespaces", getNamespaces());
         context.put("jsNamespaces", getNamespacesJS());
         context.put("namespaceUris", getNamespaceUris());
         context.put("includeClasses", includeClasses);
diff --git a/royale-maven-plugin/src/main/resources/config/compile-app-config.xml b/royale-maven-plugin/src/main/resources/config/compile-app-config.xml
index ea275ed..c3fa2fa 100644
--- a/royale-maven-plugin/src/main/resources/config/compile-app-config.xml
+++ b/royale-maven-plugin/src/main/resources/config/compile-app-config.xml
@@ -129,6 +129,12 @@
         <manifest>$namespace.manifest</manifest>
       </namespace>
 #end
+#if($languageNamespace)
+      <namespace>
+        <uri>$languageNamespace.uri</uri>
+        <manifest>$languageNamespace.manifest</manifest>
+      </namespace>
+#end
     </namespaces>
 
     <!-- Enable post-link SWF optimization. -->
diff --git a/royale-maven-plugin/src/main/resources/config/compile-asdoc-js-config.xml b/royale-maven-plugin/src/main/resources/config/compile-asdoc-js-config.xml
index 0f63100..a47c349 100644
--- a/royale-maven-plugin/src/main/resources/config/compile-asdoc-js-config.xml
+++ b/royale-maven-plugin/src/main/resources/config/compile-asdoc-js-config.xml
@@ -40,9 +40,15 @@
 
     <namespaces>
 #foreach($namespace in $namespaces)            <namespace>
-      <uri>$namespace.uri</uri>
-      <manifest>$namespace.manifest</manifest>
-    </namespace>
+        <uri>$namespace.uri</uri>
+        <manifest>$namespace.manifest</manifest>
+      </namespace>
+#end
+#if($languageNamespace)
+      <namespace>
+        <uri>$languageNamespace.uri</uri>
+        <manifest>$languageNamespace.manifest</manifest>
+      </namespace>
 #end
     </namespaces>
 
diff --git a/royale-maven-plugin/src/main/resources/config/compile-asdoc-swf-config.xml b/royale-maven-plugin/src/main/resources/config/compile-asdoc-swf-config.xml
index 896c5bd3..965fdd0 100644
--- a/royale-maven-plugin/src/main/resources/config/compile-asdoc-swf-config.xml
+++ b/royale-maven-plugin/src/main/resources/config/compile-asdoc-swf-config.xml
@@ -49,6 +49,12 @@
                 <manifest>$namespace.manifest</manifest>
             </namespace>
 #end
+#if($languageNamespace)
+            <namespace>
+                <uri>$languageNamespace.uri</uri>
+                <manifest>$languageNamespace.manifest</manifest>
+            </namespace>
+#end
         </namespaces>
 
         <keep-as3-metadata>
diff --git a/royale-maven-plugin/src/main/resources/config/compile-extern-config.xml b/royale-maven-plugin/src/main/resources/config/compile-extern-config.xml
index ae61341..5bb1c99 100644
--- a/royale-maven-plugin/src/main/resources/config/compile-extern-config.xml
+++ b/royale-maven-plugin/src/main/resources/config/compile-extern-config.xml
@@ -44,6 +44,12 @@
                 <manifest>$namespace.manifest</manifest>
             </namespace>
 #end
+#if($languageNamespace)
+            <namespace>
+                <uri>$languageNamespace.uri</uri>
+                <manifest>$languageNamespace.manifest</manifest>
+            </namespace>
+#end
         </namespaces>
 
         <warn-no-constructor>false</warn-no-constructor>
diff --git a/royale-maven-plugin/src/main/resources/config/compile-js-config.xml b/royale-maven-plugin/src/main/resources/config/compile-js-config.xml
index 82ada4b..689a1fc 100644
--- a/royale-maven-plugin/src/main/resources/config/compile-js-config.xml
+++ b/royale-maven-plugin/src/main/resources/config/compile-js-config.xml
@@ -66,6 +66,12 @@
                 <manifest>$namespace.manifest</manifest>
             </namespace>
 #end
+#if($languageNamespace)
+            <namespace>
+                <uri>$languageNamespace.uri</uri>
+                <manifest>$languageNamespace.manifest</manifest>
+            </namespace>
+#end
         </namespaces>
 
         <warn-no-constructor>false</warn-no-constructor>
diff --git a/royale-maven-plugin/src/main/resources/config/compile-swf-config.xml b/royale-maven-plugin/src/main/resources/config/compile-swf-config.xml
index 80eaddd..dd96e02 100644
--- a/royale-maven-plugin/src/main/resources/config/compile-swf-config.xml
+++ b/royale-maven-plugin/src/main/resources/config/compile-swf-config.xml
@@ -69,6 +69,12 @@
                 <manifest>$namespace.manifest</manifest>
             </namespace>
 #end
+#if($languageNamespace)
+            <namespace>
+                <uri>$languageNamespace.uri</uri>
+                <manifest>$languageNamespace.manifest</manifest>
+            </namespace>
+#end
         </namespaces>
 
         <js-namespaces>