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/09 21:29:19 UTC

[royale-compiler] branch develop updated: royale-maven-plugin: BaseMojo provides missing mxml-2009-manifest.xml that is required to use core types like Array, String, Boolean, etc. in MXML (closes #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


The following commit(s) were added to refs/heads/develop by this push:
     new 68133c6  royale-maven-plugin: BaseMojo provides missing mxml-2009-manifest.xml that is required to use core types like Array, String, Boolean, etc. in MXML (closes #103)
68133c6 is described below

commit 68133c6a17ad593d970b2972d99acae094d4ed20
Author: Josh Tynjala <jo...@apache.org>
AuthorDate: Mon Dec 9 12:53:02 2019 -0800

    royale-maven-plugin: BaseMojo provides missing mxml-2009-manifest.xml that is required to use core types like Array, String, Boolean, etc. in MXML (closes #103)
---
 .../java/org/apache/royale/maven/BaseMojo.java     | 45 +++++++++++++++++++++-
 1 file changed, 44 insertions(+), 1 deletion(-)

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 c4c91c2..6cf3509 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
@@ -108,6 +108,21 @@ public abstract class BaseMojo
 
     protected abstract File getOutput() throws MojoExecutionException;
 
+    protected String getLanguageManifestFileName()
+    {
+        return "mxml-2009-manifest.xml";
+    }
+
+    protected String getLanguageNamespaceURI()
+    {
+        return "http://ns.adobe.com/mxml/2009";
+    }
+
+    protected String getLanguageManifestContents()
+    {
+        return "<?xml version=\"1.0\"?>\n<componentPackage>\n<component id=\"Array\" class=\"Array\" lookupOnly=\"true\"/>\n<component id=\"Boolean\" class=\"Boolean\" lookupOnly=\"true\"/>\n<component id=\"Class\" class=\"Class\" lookupOnly=\"true\"/>\n<component id=\"Date\" class=\"Date\" lookupOnly=\"true\"/>\n<component id=\"DesignLayer\" class=\"mx.core.DesignLayer\"/>\n<component id=\"Function\" class=\"Function\" lookupOnly=\"true\"/>\n<component id=\"int\" class=\"int\" lookupOnl [...]
+    }
+
     protected VelocityContext getVelocityContext() throws MojoExecutionException {
         VelocityContext context = new VelocityContext();
 
@@ -130,7 +145,12 @@ public abstract class BaseMojo
         context.put("swfExternalLibraries", swfExternalLibraries);
         context.put("themeLibraries", themeLibraries);
         context.put("sourcePaths", sourcePaths);
-        context.put("namespaces", getNamespaces());
+        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("jsNamespaces", getNamespacesJS());
         context.put("namespaceUris", getNamespaceUris());
         context.put("includeClasses", includeClasses);
@@ -163,6 +183,14 @@ public abstract class BaseMojo
         return namespaces;
     }
 
+    protected Namespace getLanguageNamespace() {
+        File manifestFile = new File(outputDirectory, getLanguageManifestFileName());
+        Namespace namespace = new Namespace();
+        namespace.setUri(getLanguageNamespaceURI());
+        namespace.setManifest(manifestFile.getAbsolutePath());
+        return namespace;
+    }
+
     protected List<Namespace> getNamespacesJS() {
         List<Namespace> namespaces = new LinkedList<Namespace>();
         if(this.namespaces != null) {
@@ -293,6 +321,21 @@ public abstract class BaseMojo
                 }
             }
         }
+        File manifestFile = new File(outputDirectory, getLanguageManifestFileName());
+        try {
+            writer = new FileWriter(manifestFile);
+            writer.write(getLanguageManifestContents());
+        } catch (IOException e) {
+            throw new MojoExecutionException("Error creating config file at " + configFile.getPath());
+        } finally {
+            if(writer != null) {
+                try {
+                    writer.close();
+                } catch (IOException e) {
+                    throw new MojoExecutionException("Error creating config file at " + configFile.getPath());
+                }
+            }
+        }
 
         // Get the tool group.
         FlexToolRegistry toolRegistry = new FlexToolRegistry();


Re: [royale-compiler] branch develop updated: royale-maven-plugin: BaseMojo provides missing mxml-2009-manifest.xml that is required to use core types like Array, String, Boolean, etc. in MXML (closes #103)

Posted by Carlos Rovira <ca...@apache.org>.
HI Josh,
I rebuild and test and added the List example and can confirm now all is
working ok.
Thanks! :)

El mar., 10 dic. 2019 a las 18:33, Josh Tynjala (<jo...@bowlerhat.dev>)
escribió:

> I'm referring to mxml-2009-manifest.xml, which is a new file (for Maven, at
> least) that is necessary to fix the issue.
>
> --
> Josh Tynjala
> Bowler Hat LLC <https://bowlerhat.dev>
>
>
> On Tue, Dec 10, 2019 at 9:28 AM Alex Harui <ah...@adobe.com.invalid>
> wrote:
>
> > AIUI, these xml files are already copied.
> >
> > -Alex
> >
> > On 12/10/19, 8:43 AM, "Josh Tynjala" <jo...@bowlerhat.dev> wrote:
> >
> >     Yes, copying some kind of file would be better probably. No clue how
> > to do
> >     that in Maven, but I guess I'll see if we have some other code that
> > copies
> >     files from your suggested src/main/resources/config location.
> >
> >     --
> >     Josh Tynjala
> >     Bowler Hat LLC <
> >
> https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbowlerhat.dev&amp;data=02%7C01%7Caharui%40adobe.com%7C5d734064c1c24153112708d77d902250%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637115930324628386&amp;sdata=vUMS60pGlShke3Nr36rnD%2BNpgDOTVYsOv8VFVEFPm5A%3D&amp;reserved=0
> > >
> >
> >
> >     On Mon, Dec 9, 2019 at 8:53 PM Alex Harui <ah...@adobe.com.invalid>
> > wrote:
> >
> >     > Is there a reason this wasn't fixed by changing the *.xml files in
> >     > royale-maven-plugin/src/main/resources/config?
> >     >
> >     > I would rather not see this in code.
> >     >
> >     > Of course, I could be wrong...
> >     > -Alex
> >     >
> >     > On 12/9/19, 1:29 PM, "joshtynjala@apache.org" <
> > joshtynjala@apache.org>
> >     > wrote:
> >     >
> >     >     This is an automated email from the ASF dual-hosted git
> > repository.
> >     >
> >     >     joshtynjala pushed a commit to branch develop
> >     >     in repository
> >     >
> >
> https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgitbox.apache.org%2Frepos%2Fasf%2Froyale-compiler.git&amp;data=02%7C01%7Caharui%40adobe.com%7C5d734064c1c24153112708d77d902250%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637115930324628386&amp;sdata=Zw%2BYmLrpuPNSWL4ynBPNWccgWgtyE%2FxZrN7JH897Hkc%3D&amp;reserved=0
> >     >
> >     >
> >     >     The following commit(s) were added to refs/heads/develop by
> this
> > push:
> >     >          new 68133c6  royale-maven-plugin: BaseMojo provides
> missing
> >     > mxml-2009-manifest.xml that is required to use core types like
> Array,
> >     > String, Boolean, etc. in MXML (closes #103)
> >     >     68133c6 is described below
> >     >
> >     >     commit 68133c6a17ad593d970b2972d99acae094d4ed20
> >     >     Author: Josh Tynjala <jo...@apache.org>
> >     >     AuthorDate: Mon Dec 9 12:53:02 2019 -0800
> >     >
> >     >         royale-maven-plugin: BaseMojo provides missing
> >     > mxml-2009-manifest.xml that is required to use core types like
> Array,
> >     > String, Boolean, etc. in MXML (closes #103)
> >     >     ---
> >     >      .../java/org/apache/royale/maven/BaseMojo.java     | 45
> >     > +++++++++++++++++++++-
> >     >      1 file changed, 44 insertions(+), 1 deletion(-)
> >     >
> >     >     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 c4c91c2..6cf3509 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
> >     >     @@ -108,6 +108,21 @@ public abstract class BaseMojo
> >     >
> >     >          protected abstract File getOutput() throws
> > MojoExecutionException;
> >     >
> >     >     +    protected String getLanguageManifestFileName()
> >     >     +    {
> >     >     +        return "mxml-2009-manifest.xml";
> >     >     +    }
> >     >     +
> >     >     +    protected String getLanguageNamespaceURI()
> >     >     +    {
> >     >     +        return "
> >     >
> >
> https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.adobe.com%2Fmxml%2F2009&amp;data=02%7C01%7Caharui%40adobe.com%7C5d734064c1c24153112708d77d902250%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637115930324628386&amp;sdata=8HH8QDq3aUZO1SRHL%2F3FyKPilX6DzF7j4GysswA0UbY%3D&amp;reserved=0
> >     > ";
> >     >     +    }
> >     >     +
> >     >     +    protected String getLanguageManifestContents()
> >     >     +    {
> >     >     +        return "<?xml
> >     > version=\"1.0\"?>\n<componentPackage>\n<component id=\"Array\"
> >     > class=\"Array\" lookupOnly=\"true\"/>\n<component id=\"Boolean\"
> >     > class=\"Boolean\" lookupOnly=\"true\"/>\n<component id=\"Class\"
> >     > class=\"Class\" lookupOnly=\"true\"/>\n<component id=\"Date\"
> >     > class=\"Date\" lookupOnly=\"true\"/>\n<component id=\"DesignLayer\"
> >     > class=\"mx.core.DesignLayer\"/>\n<component id=\"Function\"
> >     > class=\"Function\" lookupOnly=\"true\"/>\n<component id=\"int\"
> >     > class=\"int\" lookupOnl [...]
> >     >     +    }
> >     >     +
> >     >          protected VelocityContext getVelocityContext() throws
> >     > MojoExecutionException {
> >     >              VelocityContext context = new VelocityContext();
> >     >
> >     >     @@ -130,7 +145,12 @@ public abstract class BaseMojo
> >     >              context.put("swfExternalLibraries",
> > swfExternalLibraries);
> >     >              context.put("themeLibraries", themeLibraries);
> >     >              context.put("sourcePaths", sourcePaths);
> >     >     -        context.put("namespaces", getNamespaces());
> >     >     +        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("jsNamespaces", getNamespacesJS());
> >     >              context.put("namespaceUris", getNamespaceUris());
> >     >              context.put("includeClasses", includeClasses);
> >     >     @@ -163,6 +183,14 @@ public abstract class BaseMojo
> >     >              return namespaces;
> >     >          }
> >     >
> >     >     +    protected Namespace getLanguageNamespace() {
> >     >     +        File manifestFile = new File(outputDirectory,
> >     > getLanguageManifestFileName());
> >     >     +        Namespace namespace = new Namespace();
> >     >     +        namespace.setUri(getLanguageNamespaceURI());
> >     >     +        namespace.setManifest(manifestFile.getAbsolutePath());
> >     >     +        return namespace;
> >     >     +    }
> >     >     +
> >     >          protected List<Namespace> getNamespacesJS() {
> >     >              List<Namespace> namespaces = new
> > LinkedList<Namespace>();
> >     >              if(this.namespaces != null) {
> >     >     @@ -293,6 +321,21 @@ public abstract class BaseMojo
> >     >                      }
> >     >                  }
> >     >              }
> >     >     +        File manifestFile = new File(outputDirectory,
> >     > getLanguageManifestFileName());
> >     >     +        try {
> >     >     +            writer = new FileWriter(manifestFile);
> >     >     +            writer.write(getLanguageManifestContents());
> >     >     +        } catch (IOException e) {
> >     >     +            throw new MojoExecutionException("Error creating
> > config
> >     > file at " + configFile.getPath());
> >     >     +        } finally {
> >     >     +            if(writer != null) {
> >     >     +                try {
> >     >     +                    writer.close();
> >     >     +                } catch (IOException e) {
> >     >     +                    throw new MojoExecutionException("Error
> > creating
> >     > config file at " + configFile.getPath());
> >     >     +                }
> >     >     +            }
> >     >     +        }
> >     >
> >     >              // Get the tool group.
> >     >              FlexToolRegistry toolRegistry = new
> FlexToolRegistry();
> >     >
> >     >
> >     >
> >     >
> >
> >
> >
>


-- 
Carlos Rovira
http://about.me/carlosrovira

Re: [royale-compiler] branch develop updated: royale-maven-plugin: BaseMojo provides missing mxml-2009-manifest.xml that is required to use core types like Array, String, Boolean, etc. in MXML (closes #103)

Posted by Josh Tynjala <jo...@bowlerhat.dev>.
I'm referring to mxml-2009-manifest.xml, which is a new file (for Maven, at
least) that is necessary to fix the issue.

--
Josh Tynjala
Bowler Hat LLC <https://bowlerhat.dev>


On Tue, Dec 10, 2019 at 9:28 AM Alex Harui <ah...@adobe.com.invalid> wrote:

> AIUI, these xml files are already copied.
>
> -Alex
>
> On 12/10/19, 8:43 AM, "Josh Tynjala" <jo...@bowlerhat.dev> wrote:
>
>     Yes, copying some kind of file would be better probably. No clue how
> to do
>     that in Maven, but I guess I'll see if we have some other code that
> copies
>     files from your suggested src/main/resources/config location.
>
>     --
>     Josh Tynjala
>     Bowler Hat LLC <
> https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbowlerhat.dev&amp;data=02%7C01%7Caharui%40adobe.com%7C5d734064c1c24153112708d77d902250%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637115930324628386&amp;sdata=vUMS60pGlShke3Nr36rnD%2BNpgDOTVYsOv8VFVEFPm5A%3D&amp;reserved=0
> >
>
>
>     On Mon, Dec 9, 2019 at 8:53 PM Alex Harui <ah...@adobe.com.invalid>
> wrote:
>
>     > Is there a reason this wasn't fixed by changing the *.xml files in
>     > royale-maven-plugin/src/main/resources/config?
>     >
>     > I would rather not see this in code.
>     >
>     > Of course, I could be wrong...
>     > -Alex
>     >
>     > On 12/9/19, 1:29 PM, "joshtynjala@apache.org" <
> joshtynjala@apache.org>
>     > wrote:
>     >
>     >     This is an automated email from the ASF dual-hosted git
> repository.
>     >
>     >     joshtynjala pushed a commit to branch develop
>     >     in repository
>     >
> https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgitbox.apache.org%2Frepos%2Fasf%2Froyale-compiler.git&amp;data=02%7C01%7Caharui%40adobe.com%7C5d734064c1c24153112708d77d902250%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637115930324628386&amp;sdata=Zw%2BYmLrpuPNSWL4ynBPNWccgWgtyE%2FxZrN7JH897Hkc%3D&amp;reserved=0
>     >
>     >
>     >     The following commit(s) were added to refs/heads/develop by this
> push:
>     >          new 68133c6  royale-maven-plugin: BaseMojo provides missing
>     > mxml-2009-manifest.xml that is required to use core types like Array,
>     > String, Boolean, etc. in MXML (closes #103)
>     >     68133c6 is described below
>     >
>     >     commit 68133c6a17ad593d970b2972d99acae094d4ed20
>     >     Author: Josh Tynjala <jo...@apache.org>
>     >     AuthorDate: Mon Dec 9 12:53:02 2019 -0800
>     >
>     >         royale-maven-plugin: BaseMojo provides missing
>     > mxml-2009-manifest.xml that is required to use core types like Array,
>     > String, Boolean, etc. in MXML (closes #103)
>     >     ---
>     >      .../java/org/apache/royale/maven/BaseMojo.java     | 45
>     > +++++++++++++++++++++-
>     >      1 file changed, 44 insertions(+), 1 deletion(-)
>     >
>     >     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 c4c91c2..6cf3509 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
>     >     @@ -108,6 +108,21 @@ public abstract class BaseMojo
>     >
>     >          protected abstract File getOutput() throws
> MojoExecutionException;
>     >
>     >     +    protected String getLanguageManifestFileName()
>     >     +    {
>     >     +        return "mxml-2009-manifest.xml";
>     >     +    }
>     >     +
>     >     +    protected String getLanguageNamespaceURI()
>     >     +    {
>     >     +        return "
>     >
> https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.adobe.com%2Fmxml%2F2009&amp;data=02%7C01%7Caharui%40adobe.com%7C5d734064c1c24153112708d77d902250%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637115930324628386&amp;sdata=8HH8QDq3aUZO1SRHL%2F3FyKPilX6DzF7j4GysswA0UbY%3D&amp;reserved=0
>     > ";
>     >     +    }
>     >     +
>     >     +    protected String getLanguageManifestContents()
>     >     +    {
>     >     +        return "<?xml
>     > version=\"1.0\"?>\n<componentPackage>\n<component id=\"Array\"
>     > class=\"Array\" lookupOnly=\"true\"/>\n<component id=\"Boolean\"
>     > class=\"Boolean\" lookupOnly=\"true\"/>\n<component id=\"Class\"
>     > class=\"Class\" lookupOnly=\"true\"/>\n<component id=\"Date\"
>     > class=\"Date\" lookupOnly=\"true\"/>\n<component id=\"DesignLayer\"
>     > class=\"mx.core.DesignLayer\"/>\n<component id=\"Function\"
>     > class=\"Function\" lookupOnly=\"true\"/>\n<component id=\"int\"
>     > class=\"int\" lookupOnl [...]
>     >     +    }
>     >     +
>     >          protected VelocityContext getVelocityContext() throws
>     > MojoExecutionException {
>     >              VelocityContext context = new VelocityContext();
>     >
>     >     @@ -130,7 +145,12 @@ public abstract class BaseMojo
>     >              context.put("swfExternalLibraries",
> swfExternalLibraries);
>     >              context.put("themeLibraries", themeLibraries);
>     >              context.put("sourcePaths", sourcePaths);
>     >     -        context.put("namespaces", getNamespaces());
>     >     +        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("jsNamespaces", getNamespacesJS());
>     >              context.put("namespaceUris", getNamespaceUris());
>     >              context.put("includeClasses", includeClasses);
>     >     @@ -163,6 +183,14 @@ public abstract class BaseMojo
>     >              return namespaces;
>     >          }
>     >
>     >     +    protected Namespace getLanguageNamespace() {
>     >     +        File manifestFile = new File(outputDirectory,
>     > getLanguageManifestFileName());
>     >     +        Namespace namespace = new Namespace();
>     >     +        namespace.setUri(getLanguageNamespaceURI());
>     >     +        namespace.setManifest(manifestFile.getAbsolutePath());
>     >     +        return namespace;
>     >     +    }
>     >     +
>     >          protected List<Namespace> getNamespacesJS() {
>     >              List<Namespace> namespaces = new
> LinkedList<Namespace>();
>     >              if(this.namespaces != null) {
>     >     @@ -293,6 +321,21 @@ public abstract class BaseMojo
>     >                      }
>     >                  }
>     >              }
>     >     +        File manifestFile = new File(outputDirectory,
>     > getLanguageManifestFileName());
>     >     +        try {
>     >     +            writer = new FileWriter(manifestFile);
>     >     +            writer.write(getLanguageManifestContents());
>     >     +        } catch (IOException e) {
>     >     +            throw new MojoExecutionException("Error creating
> config
>     > file at " + configFile.getPath());
>     >     +        } finally {
>     >     +            if(writer != null) {
>     >     +                try {
>     >     +                    writer.close();
>     >     +                } catch (IOException e) {
>     >     +                    throw new MojoExecutionException("Error
> creating
>     > config file at " + configFile.getPath());
>     >     +                }
>     >     +            }
>     >     +        }
>     >
>     >              // Get the tool group.
>     >              FlexToolRegistry toolRegistry = new FlexToolRegistry();
>     >
>     >
>     >
>     >
>
>
>

Re: [royale-compiler] branch develop updated: royale-maven-plugin: BaseMojo provides missing mxml-2009-manifest.xml that is required to use core types like Array, String, Boolean, etc. in MXML (closes #103)

Posted by Alex Harui <ah...@adobe.com.INVALID>.
AIUI, these xml files are already copied.

-Alex

On 12/10/19, 8:43 AM, "Josh Tynjala" <jo...@bowlerhat.dev> wrote:

    Yes, copying some kind of file would be better probably. No clue how to do
    that in Maven, but I guess I'll see if we have some other code that copies
    files from your suggested src/main/resources/config location.
    
    --
    Josh Tynjala
    Bowler Hat LLC <https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbowlerhat.dev&amp;data=02%7C01%7Caharui%40adobe.com%7C5d734064c1c24153112708d77d902250%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637115930324628386&amp;sdata=vUMS60pGlShke3Nr36rnD%2BNpgDOTVYsOv8VFVEFPm5A%3D&amp;reserved=0>
    
    
    On Mon, Dec 9, 2019 at 8:53 PM Alex Harui <ah...@adobe.com.invalid> wrote:
    
    > Is there a reason this wasn't fixed by changing the *.xml files in
    > royale-maven-plugin/src/main/resources/config?
    >
    > I would rather not see this in code.
    >
    > Of course, I could be wrong...
    > -Alex
    >
    > On 12/9/19, 1:29 PM, "joshtynjala@apache.org" <jo...@apache.org>
    > wrote:
    >
    >     This is an automated email from the ASF dual-hosted git repository.
    >
    >     joshtynjala pushed a commit to branch develop
    >     in repository
    > https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgitbox.apache.org%2Frepos%2Fasf%2Froyale-compiler.git&amp;data=02%7C01%7Caharui%40adobe.com%7C5d734064c1c24153112708d77d902250%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637115930324628386&amp;sdata=Zw%2BYmLrpuPNSWL4ynBPNWccgWgtyE%2FxZrN7JH897Hkc%3D&amp;reserved=0
    >
    >
    >     The following commit(s) were added to refs/heads/develop by this push:
    >          new 68133c6  royale-maven-plugin: BaseMojo provides missing
    > mxml-2009-manifest.xml that is required to use core types like Array,
    > String, Boolean, etc. in MXML (closes #103)
    >     68133c6 is described below
    >
    >     commit 68133c6a17ad593d970b2972d99acae094d4ed20
    >     Author: Josh Tynjala <jo...@apache.org>
    >     AuthorDate: Mon Dec 9 12:53:02 2019 -0800
    >
    >         royale-maven-plugin: BaseMojo provides missing
    > mxml-2009-manifest.xml that is required to use core types like Array,
    > String, Boolean, etc. in MXML (closes #103)
    >     ---
    >      .../java/org/apache/royale/maven/BaseMojo.java     | 45
    > +++++++++++++++++++++-
    >      1 file changed, 44 insertions(+), 1 deletion(-)
    >
    >     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 c4c91c2..6cf3509 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
    >     @@ -108,6 +108,21 @@ public abstract class BaseMojo
    >
    >          protected abstract File getOutput() throws MojoExecutionException;
    >
    >     +    protected String getLanguageManifestFileName()
    >     +    {
    >     +        return "mxml-2009-manifest.xml";
    >     +    }
    >     +
    >     +    protected String getLanguageNamespaceURI()
    >     +    {
    >     +        return "
    > https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.adobe.com%2Fmxml%2F2009&amp;data=02%7C01%7Caharui%40adobe.com%7C5d734064c1c24153112708d77d902250%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637115930324628386&amp;sdata=8HH8QDq3aUZO1SRHL%2F3FyKPilX6DzF7j4GysswA0UbY%3D&amp;reserved=0
    > ";
    >     +    }
    >     +
    >     +    protected String getLanguageManifestContents()
    >     +    {
    >     +        return "<?xml
    > version=\"1.0\"?>\n<componentPackage>\n<component id=\"Array\"
    > class=\"Array\" lookupOnly=\"true\"/>\n<component id=\"Boolean\"
    > class=\"Boolean\" lookupOnly=\"true\"/>\n<component id=\"Class\"
    > class=\"Class\" lookupOnly=\"true\"/>\n<component id=\"Date\"
    > class=\"Date\" lookupOnly=\"true\"/>\n<component id=\"DesignLayer\"
    > class=\"mx.core.DesignLayer\"/>\n<component id=\"Function\"
    > class=\"Function\" lookupOnly=\"true\"/>\n<component id=\"int\"
    > class=\"int\" lookupOnl [...]
    >     +    }
    >     +
    >          protected VelocityContext getVelocityContext() throws
    > MojoExecutionException {
    >              VelocityContext context = new VelocityContext();
    >
    >     @@ -130,7 +145,12 @@ public abstract class BaseMojo
    >              context.put("swfExternalLibraries", swfExternalLibraries);
    >              context.put("themeLibraries", themeLibraries);
    >              context.put("sourcePaths", sourcePaths);
    >     -        context.put("namespaces", getNamespaces());
    >     +        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("jsNamespaces", getNamespacesJS());
    >              context.put("namespaceUris", getNamespaceUris());
    >              context.put("includeClasses", includeClasses);
    >     @@ -163,6 +183,14 @@ public abstract class BaseMojo
    >              return namespaces;
    >          }
    >
    >     +    protected Namespace getLanguageNamespace() {
    >     +        File manifestFile = new File(outputDirectory,
    > getLanguageManifestFileName());
    >     +        Namespace namespace = new Namespace();
    >     +        namespace.setUri(getLanguageNamespaceURI());
    >     +        namespace.setManifest(manifestFile.getAbsolutePath());
    >     +        return namespace;
    >     +    }
    >     +
    >          protected List<Namespace> getNamespacesJS() {
    >              List<Namespace> namespaces = new LinkedList<Namespace>();
    >              if(this.namespaces != null) {
    >     @@ -293,6 +321,21 @@ public abstract class BaseMojo
    >                      }
    >                  }
    >              }
    >     +        File manifestFile = new File(outputDirectory,
    > getLanguageManifestFileName());
    >     +        try {
    >     +            writer = new FileWriter(manifestFile);
    >     +            writer.write(getLanguageManifestContents());
    >     +        } catch (IOException e) {
    >     +            throw new MojoExecutionException("Error creating config
    > file at " + configFile.getPath());
    >     +        } finally {
    >     +            if(writer != null) {
    >     +                try {
    >     +                    writer.close();
    >     +                } catch (IOException e) {
    >     +                    throw new MojoExecutionException("Error creating
    > config file at " + configFile.getPath());
    >     +                }
    >     +            }
    >     +        }
    >
    >              // Get the tool group.
    >              FlexToolRegistry toolRegistry = new FlexToolRegistry();
    >
    >
    >
    >
    


Re: [royale-compiler] branch develop updated: royale-maven-plugin: BaseMojo provides missing mxml-2009-manifest.xml that is required to use core types like Array, String, Boolean, etc. in MXML (closes #103)

Posted by Josh Tynjala <jo...@bowlerhat.dev>.
Yes, copying some kind of file would be better probably. No clue how to do
that in Maven, but I guess I'll see if we have some other code that copies
files from your suggested src/main/resources/config location.

--
Josh Tynjala
Bowler Hat LLC <https://bowlerhat.dev>


On Mon, Dec 9, 2019 at 8:53 PM Alex Harui <ah...@adobe.com.invalid> wrote:

> Is there a reason this wasn't fixed by changing the *.xml files in
> royale-maven-plugin/src/main/resources/config?
>
> I would rather not see this in code.
>
> Of course, I could be wrong...
> -Alex
>
> On 12/9/19, 1:29 PM, "joshtynjala@apache.org" <jo...@apache.org>
> wrote:
>
>     This is an automated email from the ASF dual-hosted git repository.
>
>     joshtynjala pushed a commit to branch develop
>     in repository
> https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgitbox.apache.org%2Frepos%2Fasf%2Froyale-compiler.git&amp;data=02%7C01%7Caharui%40adobe.com%7Cde0a7f8153fe4b4c2a2808d77ceedbe5%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637115237688041632&amp;sdata=H85oQILNteD2V30NtzN0RGRKQu98PVLYO%2FNPn6VfKXI%3D&amp;reserved=0
>
>
>     The following commit(s) were added to refs/heads/develop by this push:
>          new 68133c6  royale-maven-plugin: BaseMojo provides missing
> mxml-2009-manifest.xml that is required to use core types like Array,
> String, Boolean, etc. in MXML (closes #103)
>     68133c6 is described below
>
>     commit 68133c6a17ad593d970b2972d99acae094d4ed20
>     Author: Josh Tynjala <jo...@apache.org>
>     AuthorDate: Mon Dec 9 12:53:02 2019 -0800
>
>         royale-maven-plugin: BaseMojo provides missing
> mxml-2009-manifest.xml that is required to use core types like Array,
> String, Boolean, etc. in MXML (closes #103)
>     ---
>      .../java/org/apache/royale/maven/BaseMojo.java     | 45
> +++++++++++++++++++++-
>      1 file changed, 44 insertions(+), 1 deletion(-)
>
>     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 c4c91c2..6cf3509 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
>     @@ -108,6 +108,21 @@ public abstract class BaseMojo
>
>          protected abstract File getOutput() throws MojoExecutionException;
>
>     +    protected String getLanguageManifestFileName()
>     +    {
>     +        return "mxml-2009-manifest.xml";
>     +    }
>     +
>     +    protected String getLanguageNamespaceURI()
>     +    {
>     +        return "
> https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.adobe.com%2Fmxml%2F2009&amp;data=02%7C01%7Caharui%40adobe.com%7Cde0a7f8153fe4b4c2a2808d77ceedbe5%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637115237688041632&amp;sdata=71log%2FgMvbwKu1eHCxwQ0pw1DXC80grNNoxSjOFzHG8%3D&amp;reserved=0
> ";
>     +    }
>     +
>     +    protected String getLanguageManifestContents()
>     +    {
>     +        return "<?xml
> version=\"1.0\"?>\n<componentPackage>\n<component id=\"Array\"
> class=\"Array\" lookupOnly=\"true\"/>\n<component id=\"Boolean\"
> class=\"Boolean\" lookupOnly=\"true\"/>\n<component id=\"Class\"
> class=\"Class\" lookupOnly=\"true\"/>\n<component id=\"Date\"
> class=\"Date\" lookupOnly=\"true\"/>\n<component id=\"DesignLayer\"
> class=\"mx.core.DesignLayer\"/>\n<component id=\"Function\"
> class=\"Function\" lookupOnly=\"true\"/>\n<component id=\"int\"
> class=\"int\" lookupOnl [...]
>     +    }
>     +
>          protected VelocityContext getVelocityContext() throws
> MojoExecutionException {
>              VelocityContext context = new VelocityContext();
>
>     @@ -130,7 +145,12 @@ public abstract class BaseMojo
>              context.put("swfExternalLibraries", swfExternalLibraries);
>              context.put("themeLibraries", themeLibraries);
>              context.put("sourcePaths", sourcePaths);
>     -        context.put("namespaces", getNamespaces());
>     +        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("jsNamespaces", getNamespacesJS());
>              context.put("namespaceUris", getNamespaceUris());
>              context.put("includeClasses", includeClasses);
>     @@ -163,6 +183,14 @@ public abstract class BaseMojo
>              return namespaces;
>          }
>
>     +    protected Namespace getLanguageNamespace() {
>     +        File manifestFile = new File(outputDirectory,
> getLanguageManifestFileName());
>     +        Namespace namespace = new Namespace();
>     +        namespace.setUri(getLanguageNamespaceURI());
>     +        namespace.setManifest(manifestFile.getAbsolutePath());
>     +        return namespace;
>     +    }
>     +
>          protected List<Namespace> getNamespacesJS() {
>              List<Namespace> namespaces = new LinkedList<Namespace>();
>              if(this.namespaces != null) {
>     @@ -293,6 +321,21 @@ public abstract class BaseMojo
>                      }
>                  }
>              }
>     +        File manifestFile = new File(outputDirectory,
> getLanguageManifestFileName());
>     +        try {
>     +            writer = new FileWriter(manifestFile);
>     +            writer.write(getLanguageManifestContents());
>     +        } catch (IOException e) {
>     +            throw new MojoExecutionException("Error creating config
> file at " + configFile.getPath());
>     +        } finally {
>     +            if(writer != null) {
>     +                try {
>     +                    writer.close();
>     +                } catch (IOException e) {
>     +                    throw new MojoExecutionException("Error creating
> config file at " + configFile.getPath());
>     +                }
>     +            }
>     +        }
>
>              // Get the tool group.
>              FlexToolRegistry toolRegistry = new FlexToolRegistry();
>
>
>
>

Re: [royale-compiler] branch develop updated: royale-maven-plugin: BaseMojo provides missing mxml-2009-manifest.xml that is required to use core types like Array, String, Boolean, etc. in MXML (closes #103)

Posted by Josh Tynjala <jo...@bowlerhat.dev>.
The asdoc build seems to be what was failing, and I just updated that
template to match my changes. I can successfully build royale-asjs locally.

--
Josh Tynjala
Bowler Hat LLC <https://bowlerhat.dev>


On Tue, Dec 10, 2019 at 1:08 AM Carlos Rovira <ca...@apache.org>
wrote:

> Hi,
>
> I'm finding this commit is making Core fail to compile "
> org.apache.royale.utils.object.defineSimpleProperty"
>
> it fails when try to compile "Object.defineProperty"
>
>
>
> El mar., 10 dic. 2019 a las 5:53, Alex Harui (<ah...@adobe.com.invalid>)
> escribió:
>
>> Is there a reason this wasn't fixed by changing the *.xml files in
>> royale-maven-plugin/src/main/resources/config?
>>
>> I would rather not see this in code.
>>
>> Of course, I could be wrong...
>> -Alex
>>
>> On 12/9/19, 1:29 PM, "joshtynjala@apache.org" <jo...@apache.org>
>> wrote:
>>
>>     This is an automated email from the ASF dual-hosted git repository.
>>
>>     joshtynjala pushed a commit to branch develop
>>     in repository
>> https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgitbox.apache.org%2Frepos%2Fasf%2Froyale-compiler.git&amp;data=02%7C01%7Caharui%40adobe.com%7Cde0a7f8153fe4b4c2a2808d77ceedbe5%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637115237688041632&amp;sdata=H85oQILNteD2V30NtzN0RGRKQu98PVLYO%2FNPn6VfKXI%3D&amp;reserved=0
>>
>>
>>     The following commit(s) were added to refs/heads/develop by this push:
>>          new 68133c6  royale-maven-plugin: BaseMojo provides missing
>> mxml-2009-manifest.xml that is required to use core types like Array,
>> String, Boolean, etc. in MXML (closes #103)
>>     68133c6 is described below
>>
>>     commit 68133c6a17ad593d970b2972d99acae094d4ed20
>>     Author: Josh Tynjala <jo...@apache.org>
>>     AuthorDate: Mon Dec 9 12:53:02 2019 -0800
>>
>>         royale-maven-plugin: BaseMojo provides missing
>> mxml-2009-manifest.xml that is required to use core types like Array,
>> String, Boolean, etc. in MXML (closes #103)
>>     ---
>>      .../java/org/apache/royale/maven/BaseMojo.java     | 45
>> +++++++++++++++++++++-
>>      1 file changed, 44 insertions(+), 1 deletion(-)
>>
>>     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 c4c91c2..6cf3509 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
>>     @@ -108,6 +108,21 @@ public abstract class BaseMojo
>>
>>          protected abstract File getOutput() throws
>> MojoExecutionException;
>>
>>     +    protected String getLanguageManifestFileName()
>>     +    {
>>     +        return "mxml-2009-manifest.xml";
>>     +    }
>>     +
>>     +    protected String getLanguageNamespaceURI()
>>     +    {
>>     +        return "
>> https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.adobe.com%2Fmxml%2F2009&amp;data=02%7C01%7Caharui%40adobe.com%7Cde0a7f8153fe4b4c2a2808d77ceedbe5%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637115237688041632&amp;sdata=71log%2FgMvbwKu1eHCxwQ0pw1DXC80grNNoxSjOFzHG8%3D&amp;reserved=0
>> ";
>>     +    }
>>     +
>>     +    protected String getLanguageManifestContents()
>>     +    {
>>     +        return "<?xml
>> version=\"1.0\"?>\n<componentPackage>\n<component id=\"Array\"
>> class=\"Array\" lookupOnly=\"true\"/>\n<component id=\"Boolean\"
>> class=\"Boolean\" lookupOnly=\"true\"/>\n<component id=\"Class\"
>> class=\"Class\" lookupOnly=\"true\"/>\n<component id=\"Date\"
>> class=\"Date\" lookupOnly=\"true\"/>\n<component id=\"DesignLayer\"
>> class=\"mx.core.DesignLayer\"/>\n<component id=\"Function\"
>> class=\"Function\" lookupOnly=\"true\"/>\n<component id=\"int\"
>> class=\"int\" lookupOnl [...]
>>     +    }
>>     +
>>          protected VelocityContext getVelocityContext() throws
>> MojoExecutionException {
>>              VelocityContext context = new VelocityContext();
>>
>>     @@ -130,7 +145,12 @@ public abstract class BaseMojo
>>              context.put("swfExternalLibraries", swfExternalLibraries);
>>              context.put("themeLibraries", themeLibraries);
>>              context.put("sourcePaths", sourcePaths);
>>     -        context.put("namespaces", getNamespaces());
>>     +        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("jsNamespaces", getNamespacesJS());
>>              context.put("namespaceUris", getNamespaceUris());
>>              context.put("includeClasses", includeClasses);
>>     @@ -163,6 +183,14 @@ public abstract class BaseMojo
>>              return namespaces;
>>          }
>>
>>     +    protected Namespace getLanguageNamespace() {
>>     +        File manifestFile = new File(outputDirectory,
>> getLanguageManifestFileName());
>>     +        Namespace namespace = new Namespace();
>>     +        namespace.setUri(getLanguageNamespaceURI());
>>     +        namespace.setManifest(manifestFile.getAbsolutePath());
>>     +        return namespace;
>>     +    }
>>     +
>>          protected List<Namespace> getNamespacesJS() {
>>              List<Namespace> namespaces = new LinkedList<Namespace>();
>>              if(this.namespaces != null) {
>>     @@ -293,6 +321,21 @@ public abstract class BaseMojo
>>                      }
>>                  }
>>              }
>>     +        File manifestFile = new File(outputDirectory,
>> getLanguageManifestFileName());
>>     +        try {
>>     +            writer = new FileWriter(manifestFile);
>>     +            writer.write(getLanguageManifestContents());
>>     +        } catch (IOException e) {
>>     +            throw new MojoExecutionException("Error creating config
>> file at " + configFile.getPath());
>>     +        } finally {
>>     +            if(writer != null) {
>>     +                try {
>>     +                    writer.close();
>>     +                } catch (IOException e) {
>>     +                    throw new MojoExecutionException("Error creating
>> config file at " + configFile.getPath());
>>     +                }
>>     +            }
>>     +        }
>>
>>              // Get the tool group.
>>              FlexToolRegistry toolRegistry = new FlexToolRegistry();
>>
>>
>>
>>
>
> --
> Carlos Rovira
> http://about.me/carlosrovira
>
>

Re: [royale-compiler] branch develop updated: royale-maven-plugin: BaseMojo provides missing mxml-2009-manifest.xml that is required to use core types like Array, String, Boolean, etc. in MXML (closes #103)

Posted by Carlos Rovira <ca...@apache.org>.
Hi,

I'm finding this commit is making Core fail to compile "
org.apache.royale.utils.object.defineSimpleProperty"

it fails when try to compile "Object.defineProperty"



El mar., 10 dic. 2019 a las 5:53, Alex Harui (<ah...@adobe.com.invalid>)
escribió:

> Is there a reason this wasn't fixed by changing the *.xml files in
> royale-maven-plugin/src/main/resources/config?
>
> I would rather not see this in code.
>
> Of course, I could be wrong...
> -Alex
>
> On 12/9/19, 1:29 PM, "joshtynjala@apache.org" <jo...@apache.org>
> wrote:
>
>     This is an automated email from the ASF dual-hosted git repository.
>
>     joshtynjala pushed a commit to branch develop
>     in repository
> https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgitbox.apache.org%2Frepos%2Fasf%2Froyale-compiler.git&amp;data=02%7C01%7Caharui%40adobe.com%7Cde0a7f8153fe4b4c2a2808d77ceedbe5%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637115237688041632&amp;sdata=H85oQILNteD2V30NtzN0RGRKQu98PVLYO%2FNPn6VfKXI%3D&amp;reserved=0
>
>
>     The following commit(s) were added to refs/heads/develop by this push:
>          new 68133c6  royale-maven-plugin: BaseMojo provides missing
> mxml-2009-manifest.xml that is required to use core types like Array,
> String, Boolean, etc. in MXML (closes #103)
>     68133c6 is described below
>
>     commit 68133c6a17ad593d970b2972d99acae094d4ed20
>     Author: Josh Tynjala <jo...@apache.org>
>     AuthorDate: Mon Dec 9 12:53:02 2019 -0800
>
>         royale-maven-plugin: BaseMojo provides missing
> mxml-2009-manifest.xml that is required to use core types like Array,
> String, Boolean, etc. in MXML (closes #103)
>     ---
>      .../java/org/apache/royale/maven/BaseMojo.java     | 45
> +++++++++++++++++++++-
>      1 file changed, 44 insertions(+), 1 deletion(-)
>
>     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 c4c91c2..6cf3509 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
>     @@ -108,6 +108,21 @@ public abstract class BaseMojo
>
>          protected abstract File getOutput() throws MojoExecutionException;
>
>     +    protected String getLanguageManifestFileName()
>     +    {
>     +        return "mxml-2009-manifest.xml";
>     +    }
>     +
>     +    protected String getLanguageNamespaceURI()
>     +    {
>     +        return "
> https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.adobe.com%2Fmxml%2F2009&amp;data=02%7C01%7Caharui%40adobe.com%7Cde0a7f8153fe4b4c2a2808d77ceedbe5%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637115237688041632&amp;sdata=71log%2FgMvbwKu1eHCxwQ0pw1DXC80grNNoxSjOFzHG8%3D&amp;reserved=0
> ";
>     +    }
>     +
>     +    protected String getLanguageManifestContents()
>     +    {
>     +        return "<?xml
> version=\"1.0\"?>\n<componentPackage>\n<component id=\"Array\"
> class=\"Array\" lookupOnly=\"true\"/>\n<component id=\"Boolean\"
> class=\"Boolean\" lookupOnly=\"true\"/>\n<component id=\"Class\"
> class=\"Class\" lookupOnly=\"true\"/>\n<component id=\"Date\"
> class=\"Date\" lookupOnly=\"true\"/>\n<component id=\"DesignLayer\"
> class=\"mx.core.DesignLayer\"/>\n<component id=\"Function\"
> class=\"Function\" lookupOnly=\"true\"/>\n<component id=\"int\"
> class=\"int\" lookupOnl [...]
>     +    }
>     +
>          protected VelocityContext getVelocityContext() throws
> MojoExecutionException {
>              VelocityContext context = new VelocityContext();
>
>     @@ -130,7 +145,12 @@ public abstract class BaseMojo
>              context.put("swfExternalLibraries", swfExternalLibraries);
>              context.put("themeLibraries", themeLibraries);
>              context.put("sourcePaths", sourcePaths);
>     -        context.put("namespaces", getNamespaces());
>     +        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("jsNamespaces", getNamespacesJS());
>              context.put("namespaceUris", getNamespaceUris());
>              context.put("includeClasses", includeClasses);
>     @@ -163,6 +183,14 @@ public abstract class BaseMojo
>              return namespaces;
>          }
>
>     +    protected Namespace getLanguageNamespace() {
>     +        File manifestFile = new File(outputDirectory,
> getLanguageManifestFileName());
>     +        Namespace namespace = new Namespace();
>     +        namespace.setUri(getLanguageNamespaceURI());
>     +        namespace.setManifest(manifestFile.getAbsolutePath());
>     +        return namespace;
>     +    }
>     +
>          protected List<Namespace> getNamespacesJS() {
>              List<Namespace> namespaces = new LinkedList<Namespace>();
>              if(this.namespaces != null) {
>     @@ -293,6 +321,21 @@ public abstract class BaseMojo
>                      }
>                  }
>              }
>     +        File manifestFile = new File(outputDirectory,
> getLanguageManifestFileName());
>     +        try {
>     +            writer = new FileWriter(manifestFile);
>     +            writer.write(getLanguageManifestContents());
>     +        } catch (IOException e) {
>     +            throw new MojoExecutionException("Error creating config
> file at " + configFile.getPath());
>     +        } finally {
>     +            if(writer != null) {
>     +                try {
>     +                    writer.close();
>     +                } catch (IOException e) {
>     +                    throw new MojoExecutionException("Error creating
> config file at " + configFile.getPath());
>     +                }
>     +            }
>     +        }
>
>              // Get the tool group.
>              FlexToolRegistry toolRegistry = new FlexToolRegistry();
>
>
>
>

-- 
Carlos Rovira
http://about.me/carlosrovira

Re: [royale-compiler] branch develop updated: royale-maven-plugin: BaseMojo provides missing mxml-2009-manifest.xml that is required to use core types like Array, String, Boolean, etc. in MXML (closes #103)

Posted by Alex Harui <ah...@adobe.com.INVALID>.
Is there a reason this wasn't fixed by changing the *.xml files in royale-maven-plugin/src/main/resources/config?

I would rather not see this in code.

Of course, I could be wrong...
-Alex

On 12/9/19, 1:29 PM, "joshtynjala@apache.org" <jo...@apache.org> wrote:

    This is an automated email from the ASF dual-hosted git repository.
    
    joshtynjala pushed a commit to branch develop
    in repository https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgitbox.apache.org%2Frepos%2Fasf%2Froyale-compiler.git&amp;data=02%7C01%7Caharui%40adobe.com%7Cde0a7f8153fe4b4c2a2808d77ceedbe5%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637115237688041632&amp;sdata=H85oQILNteD2V30NtzN0RGRKQu98PVLYO%2FNPn6VfKXI%3D&amp;reserved=0
    
    
    The following commit(s) were added to refs/heads/develop by this push:
         new 68133c6  royale-maven-plugin: BaseMojo provides missing mxml-2009-manifest.xml that is required to use core types like Array, String, Boolean, etc. in MXML (closes #103)
    68133c6 is described below
    
    commit 68133c6a17ad593d970b2972d99acae094d4ed20
    Author: Josh Tynjala <jo...@apache.org>
    AuthorDate: Mon Dec 9 12:53:02 2019 -0800
    
        royale-maven-plugin: BaseMojo provides missing mxml-2009-manifest.xml that is required to use core types like Array, String, Boolean, etc. in MXML (closes #103)
    ---
     .../java/org/apache/royale/maven/BaseMojo.java     | 45 +++++++++++++++++++++-
     1 file changed, 44 insertions(+), 1 deletion(-)
    
    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 c4c91c2..6cf3509 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
    @@ -108,6 +108,21 @@ public abstract class BaseMojo
     
         protected abstract File getOutput() throws MojoExecutionException;
     
    +    protected String getLanguageManifestFileName()
    +    {
    +        return "mxml-2009-manifest.xml";
    +    }
    +
    +    protected String getLanguageNamespaceURI()
    +    {
    +        return "https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.adobe.com%2Fmxml%2F2009&amp;data=02%7C01%7Caharui%40adobe.com%7Cde0a7f8153fe4b4c2a2808d77ceedbe5%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637115237688041632&amp;sdata=71log%2FgMvbwKu1eHCxwQ0pw1DXC80grNNoxSjOFzHG8%3D&amp;reserved=0";
    +    }
    +
    +    protected String getLanguageManifestContents()
    +    {
    +        return "<?xml version=\"1.0\"?>\n<componentPackage>\n<component id=\"Array\" class=\"Array\" lookupOnly=\"true\"/>\n<component id=\"Boolean\" class=\"Boolean\" lookupOnly=\"true\"/>\n<component id=\"Class\" class=\"Class\" lookupOnly=\"true\"/>\n<component id=\"Date\" class=\"Date\" lookupOnly=\"true\"/>\n<component id=\"DesignLayer\" class=\"mx.core.DesignLayer\"/>\n<component id=\"Function\" class=\"Function\" lookupOnly=\"true\"/>\n<component id=\"int\" class=\"int\" lookupOnl [...]
    +    }
    +
         protected VelocityContext getVelocityContext() throws MojoExecutionException {
             VelocityContext context = new VelocityContext();
     
    @@ -130,7 +145,12 @@ public abstract class BaseMojo
             context.put("swfExternalLibraries", swfExternalLibraries);
             context.put("themeLibraries", themeLibraries);
             context.put("sourcePaths", sourcePaths);
    -        context.put("namespaces", getNamespaces());
    +        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("jsNamespaces", getNamespacesJS());
             context.put("namespaceUris", getNamespaceUris());
             context.put("includeClasses", includeClasses);
    @@ -163,6 +183,14 @@ public abstract class BaseMojo
             return namespaces;
         }
     
    +    protected Namespace getLanguageNamespace() {
    +        File manifestFile = new File(outputDirectory, getLanguageManifestFileName());
    +        Namespace namespace = new Namespace();
    +        namespace.setUri(getLanguageNamespaceURI());
    +        namespace.setManifest(manifestFile.getAbsolutePath());
    +        return namespace;
    +    }
    +
         protected List<Namespace> getNamespacesJS() {
             List<Namespace> namespaces = new LinkedList<Namespace>();
             if(this.namespaces != null) {
    @@ -293,6 +321,21 @@ public abstract class BaseMojo
                     }
                 }
             }
    +        File manifestFile = new File(outputDirectory, getLanguageManifestFileName());
    +        try {
    +            writer = new FileWriter(manifestFile);
    +            writer.write(getLanguageManifestContents());
    +        } catch (IOException e) {
    +            throw new MojoExecutionException("Error creating config file at " + configFile.getPath());
    +        } finally {
    +            if(writer != null) {
    +                try {
    +                    writer.close();
    +                } catch (IOException e) {
    +                    throw new MojoExecutionException("Error creating config file at " + configFile.getPath());
    +                }
    +            }
    +        }
     
             // Get the tool group.
             FlexToolRegistry toolRegistry = new FlexToolRegistry();