You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by er...@apache.org on 2014/08/01 13:00:39 UTC

[18/33] git commit: [flex-falcon] [refs/heads/develop] - Split 'vf2js' into 'vf2js_mx' and 'vf2js_s', so both 'mx' and 's' namespace components can get shims.

Split 'vf2js' into 'vf2js_mx' and 'vf2js_s', so both 'mx' and 's' namespace components can get shims.

Signed-off-by: Erik de Bruin <er...@ixsoftware.nl>


Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/f100b779
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/f100b779
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/f100b779

Branch: refs/heads/develop
Commit: f100b779518d14788bdcac2fdf1c5ad0626c7f31
Parents: 8307d54
Author: Erik de Bruin <er...@ixsoftware.nl>
Authored: Mon Jun 30 14:44:15 2014 +0200
Committer: Erik de Bruin <er...@ixsoftware.nl>
Committed: Fri Aug 1 12:59:15 2014 +0200

----------------------------------------------------------------------
 .../mxml/vf2js/TestVF2JSMXMLApplication.java    |  2 +-
 .../compiler/internal/test/VF2JSTestBase.java   | 27 +++++++++++++-------
 .../test-files/vf2js/files/Simple.mxml          | 10 +++++---
 3 files changed, 25 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/f100b779/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/mxml/vf2js/TestVF2JSMXMLApplication.java
----------------------------------------------------------------------
diff --git a/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/mxml/vf2js/TestVF2JSMXMLApplication.java b/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/mxml/vf2js/TestVF2JSMXMLApplication.java
index 201d05e..159d3c4 100644
--- a/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/mxml/vf2js/TestVF2JSMXMLApplication.java
+++ b/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/mxml/vf2js/TestVF2JSMXMLApplication.java
@@ -35,7 +35,7 @@ public class TestVF2JSMXMLApplication extends VF2JSTestBase
 
         mxmlBlockWalker.visitFile(node);
         
-        writeResultToFile(writer.toString(), fileName);
+        //writeResultToFile(writer.toString(), fileName);
 
         assertOut(getCodeFromFile(fileName + "_result", true, "vf2js/files"));
     }

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/f100b779/compiler.jx.tests/src/org/apache/flex/compiler/internal/test/VF2JSTestBase.java
----------------------------------------------------------------------
diff --git a/compiler.jx.tests/src/org/apache/flex/compiler/internal/test/VF2JSTestBase.java b/compiler.jx.tests/src/org/apache/flex/compiler/internal/test/VF2JSTestBase.java
index 1655663..32c0f71 100644
--- a/compiler.jx.tests/src/org/apache/flex/compiler/internal/test/VF2JSTestBase.java
+++ b/compiler.jx.tests/src/org/apache/flex/compiler/internal/test/VF2JSTestBase.java
@@ -61,7 +61,9 @@ public class VF2JSTestBase extends TestBase
         libraries.add(new File(FilenameNormalization.normalize(env.SDK
                 + "/frameworks/libs/spark.swc")));
         libraries.add(new File(FilenameNormalization.normalize(env.SDK
-                + "/frameworks/libs/vf2js.swc")));
+                + "/frameworks/libs/vf2js_mx.swc")));
+        libraries.add(new File(FilenameNormalization.normalize(env.SDK
+                + "/frameworks/libs/vf2js_s.swc")));
         
         super.addLibraries(libraries);
     }
@@ -76,8 +78,12 @@ public class VF2JSTestBase extends TestBase
                                 .getAbsolutePath()));
         
         namespaceMappings.add(new MXMLNamespaceMapping(
-                "http://flex.apache.org/vf2js/ns", new File(env.SDK,
-                        "frameworks/vf2js-manifest.xml").getAbsolutePath()));
+                "http://flex.apache.org/vf2js_mx/ns", new File(env.SDK,
+                        "frameworks/vf2js_mx-manifest.xml").getAbsolutePath()));
+        
+        namespaceMappings.add(new MXMLNamespaceMapping(
+                "http://flex.apache.org/vf2js_s/ns", new File(env.SDK,
+                        "frameworks/vf2js_s-manifest.xml").getAbsolutePath()));
         
         super.addNamespaceMappings(namespaceMappings);
     }
@@ -131,14 +137,15 @@ public class VF2JSTestBase extends TestBase
             int wrapLevel)
     {
         if (wrapLevel >= WRAP_LEVEL_NODE)
-            code = "<vf2js:Button " + code + "></vf2js:Button>";
+            code = "<vf2js_s:Button " + code + "></vf2js_s:Button>";
 
         if (wrapLevel >= WRAP_LEVEL_DOCUMENT)
             code = ""
-                    + "<vf2js:Application xmlns:fx=\"http://ns.adobe.com/mxml/2009\"\n"
-                    + "                   xmlns:vf2js=\"http://flex.apache.org/vf2js/ns\">\n"
+                    + "<vf2js_s:Application xmlns:fx=\"http://ns.adobe.com/mxml/2009\"\n"
+                    + "                     xmlns:vf2js_mx=\"http://flex.apache.org/vf2js_mx/ns\">\n"
+                    + "                     xmlns:vf2js_s=\"http://flex.apache.org/vf2js_s/ns\">\n"
                     + code + "\n"
-                    + "</vf2js:Application>";
+                    + "</vf2js_s:Application>";
         
         File intermediateFile = writeCodeToTempFile(code, false, "");
 
@@ -175,8 +182,10 @@ public class VF2JSTestBase extends TestBase
         try 
         {
             String content = FileUtils.readFileToString(intermediateFile, "UTF-8");
-            content = content.replace("<s:", "<vf2js:");
-            content = content.replace("</s:", "</vf2js:");
+            content = content.replace("<mx:", "<vf2js_mx:");
+            content = content.replace("</mx:", "</vf2js_mx:");
+            content = content.replace("<s:", "<vf2js_s:");
+            content = content.replace("</s:", "</vf2js_s:");
             if (createTempFile)
             {
                 tempFile = File.createTempFile(tempFileName, inputFileExtension,

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/f100b779/compiler.jx.tests/test-files/vf2js/files/Simple.mxml
----------------------------------------------------------------------
diff --git a/compiler.jx.tests/test-files/vf2js/files/Simple.mxml b/compiler.jx.tests/test-files/vf2js/files/Simple.mxml
index d7ba83a..5356b05 100644
--- a/compiler.jx.tests/test-files/vf2js/files/Simple.mxml
+++ b/compiler.jx.tests/test-files/vf2js/files/Simple.mxml
@@ -1,4 +1,6 @@
-<vf2js:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
-                   xmlns:vf2js="http://flex.apache.org/vf2js/ns"
-  <vf2js:Button label="hello" x="100" invalidAttr="nope" />
-</vf2js:Application>
\ No newline at end of file
+<vf2js_s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
+                     xmlns:vf2js_mx="http://flex.apache.org/vf2js_mx/ns"
+                     xmlns:vf2js_s="http://flex.apache.org/vf2js_s/ns"
+  <vf2js_s:Button label="hello" x="100" invalidAttr="nope" />
+  <vf2js_s:Button label="hello" x="100" invalidAttr="nope" />
+</vf2js_s:Application>
\ No newline at end of file