You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by cd...@apache.org on 2016/02/24 09:49:30 UTC

[1/4] git commit: [flex-falcon] [refs/heads/feature/maven-migration] - FLEX-35033 filter for InstanceNodes

Repository: flex-falcon
Updated Branches:
  refs/heads/feature/maven-migration 5e58d7e22 -> 8c7ea138a


FLEX-35033 filter for InstanceNodes


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

Branch: refs/heads/feature/maven-migration
Commit: f796ca222480603f3c1851715af8a045064ea6e1
Parents: e78b3e1
Author: Alex Harui <ah...@apache.org>
Authored: Sun Feb 21 23:12:33 2016 -0800
Committer: Alex Harui <ah...@apache.org>
Committed: Sun Feb 21 23:12:51 2016 -0800

----------------------------------------------------------------------
 .../compiler/internal/codegen/mxml/flexjs/MXMLFlexJSEmitter.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/f796ca22/compiler.jx/src/org/apache/flex/compiler/internal/codegen/mxml/flexjs/MXMLFlexJSEmitter.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/mxml/flexjs/MXMLFlexJSEmitter.java b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/mxml/flexjs/MXMLFlexJSEmitter.java
index d69685e..d8d99ea 100644
--- a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/mxml/flexjs/MXMLFlexJSEmitter.java
+++ b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/mxml/flexjs/MXMLFlexJSEmitter.java
@@ -1590,7 +1590,7 @@ public class MXMLFlexJSEmitter extends MXMLEmitter implements
             if (sib == instanceNode)
                 break;
 
-            if (!isStateDependent(sib))
+            if (sib instanceof IMXMLInstanceNode && !isStateDependent(sib))
             {
                 prevStatelessSibling = sib;
             }


[4/4] git commit: [flex-falcon] [refs/heads/feature/maven-migration] - - Disabled assertions during unit-test execution as the Ant counterpart had them disabled too (We'll fix this after finishing the migration)

Posted by cd...@apache.org.
- Disabled assertions during unit-test execution as the Ant counterpart had them disabled too (We'll fix this after finishing the migration)


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

Branch: refs/heads/feature/maven-migration
Commit: 8c7ea138a040afc7a6d0589a79b4405f25e98e83
Parents: 729c0fc
Author: Christofer Dutz <ch...@codecentric.de>
Authored: Wed Feb 24 09:49:08 2016 +0100
Committer: Christofer Dutz <ch...@codecentric.de>
Committed: Wed Feb 24 09:49:08 2016 +0100

----------------------------------------------------------------------
 compiler/pom.xml | 8 ++++++++
 1 file changed, 8 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/8c7ea138/compiler/pom.xml
----------------------------------------------------------------------
diff --git a/compiler/pom.xml b/compiler/pom.xml
index 95f0c2b..4416749 100644
--- a/compiler/pom.xml
+++ b/compiler/pom.xml
@@ -311,6 +311,14 @@
                         <airVersion>${air.version}</airVersion>
                         <mavenLocalRepoDir>${settings.localRepository}</mavenLocalRepoDir>
                     </systemPropertyVariables>
+                    <!--
+                        Currently some tests need this to be disabled,
+                        but actually this is a bug. For now I'll disable
+                        them to avoid problems during the maven migration.
+                        After this is finished, we should defnitely fix
+                        the tests so assertions can be enabled.
+                    -->
+                    <enableAssertions>false</enableAssertions>
                 </configuration>
             </plugin>
         </plugins>


[3/4] git commit: [flex-falcon] [refs/heads/feature/maven-migration] - Merge remote-tracking branch 'origin/develop' into feature/maven-migration

Posted by cd...@apache.org.
Merge remote-tracking branch 'origin/develop' into feature/maven-migration


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

Branch: refs/heads/feature/maven-migration
Commit: 729c0fc79179e36ab77d45e65654a0a81abafbb1
Parents: 5e58d7e 04bc650
Author: Christofer Dutz <ch...@codecentric.de>
Authored: Wed Feb 24 09:41:29 2016 +0100
Committer: Christofer Dutz <ch...@codecentric.de>
Committed: Wed Feb 24 09:41:29 2016 +0100

----------------------------------------------------------------------
 .../codegen/mxml/flexjs/MXMLFlexJSEmitter.java  |  2 +-
 .../org/apache/flex/utils/AntTestAdapter.java   | 46 ++++++++++++++
 .../src/org/apache/flex/utils/ITestAdapter.java | 17 ++++++
 .../org/apache/flex/utils/MavenTestAdapter.java | 63 ++++++++++++++++++++
 .../internal/tree/mxml/MXMLNodeBaseTests.java   | 29 ++++-----
 5 files changed, 139 insertions(+), 18 deletions(-)
----------------------------------------------------------------------



[2/4] git commit: [flex-falcon] [refs/heads/feature/maven-migration] - - Introduced a ITestAdapter interface that wraps build-system specific details - Moved the Ant-specific parts into a new AntTestAdapter - Added a new MavenTestAdapter for running unit

Posted by cd...@apache.org.
- Introduced a ITestAdapter interface that wraps build-system specific details
- Moved the Ant-specific parts into a new AntTestAdapter
- Added a new MavenTestAdapter for running unit-tests with Maven.
- Changed the MXMLNodeBaseTests to use the AntTestAdapter per default, but to allow overriding this by setting a system-property and hereby switching to the MavenTestAdapter


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

Branch: refs/heads/feature/maven-migration
Commit: 04bc65015703f7d3552c39008e9c2ca7eb7aeb9a
Parents: f796ca2
Author: Christofer Dutz <ch...@codecentric.de>
Authored: Wed Feb 24 09:40:36 2016 +0100
Committer: Christofer Dutz <ch...@codecentric.de>
Committed: Wed Feb 24 09:40:36 2016 +0100

----------------------------------------------------------------------
 .../org/apache/flex/utils/AntTestAdapter.java   | 46 ++++++++++++++
 .../src/org/apache/flex/utils/ITestAdapter.java | 17 ++++++
 .../org/apache/flex/utils/MavenTestAdapter.java | 63 ++++++++++++++++++++
 .../internal/tree/mxml/MXMLNodeBaseTests.java   | 29 ++++-----
 4 files changed, 138 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/04bc6501/compiler.tests/src/org/apache/flex/utils/AntTestAdapter.java
----------------------------------------------------------------------
diff --git a/compiler.tests/src/org/apache/flex/utils/AntTestAdapter.java b/compiler.tests/src/org/apache/flex/utils/AntTestAdapter.java
new file mode 100644
index 0000000..32c24d5
--- /dev/null
+++ b/compiler.tests/src/org/apache/flex/utils/AntTestAdapter.java
@@ -0,0 +1,46 @@
+package org.apache.flex.utils;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+
+import static org.junit.Assert.assertNotNull;
+
+/**
+ * Created by christoferdutz on 23.02.16.
+ */
+public class AntTestAdapter implements ITestAdapter {
+
+    private static EnvProperties env = EnvProperties.initiate();
+
+    @Override
+    public String getTempDir() {
+        return FilenameNormalization.normalize("temp"); // ensure this exists
+    }
+
+    @Override
+    public List<File> getLibraries(boolean withFlex) {
+        // Do some checks if all needed environment variables are set.
+        if (withFlex) {
+            assertNotNull("Environment variable FLEX_HOME is not set", env.SDK);
+        }
+        assertNotNull("Environment variable PLAYERGLOBAL_HOME is not set", env.FPSDK);
+
+        // Create a list of libs needed to compile.
+        List<File> libraries = new ArrayList<File>();
+        libraries.add(new File(FilenameNormalization.normalize(env.FPSDK + "\\" + env.FPVER + "\\playerglobal.swc")));
+        if (withFlex)
+        {
+            libraries.add(new File(FilenameNormalization.normalize(env.SDK + "\\frameworks\\libs\\framework.swc")));
+            libraries.add(new File(FilenameNormalization.normalize(env.SDK + "\\frameworks\\libs\\rpc.swc")));
+            libraries.add(new File(FilenameNormalization.normalize(env.SDK + "\\frameworks\\libs\\spark.swc")));
+        }
+        return libraries;
+    }
+
+    @Override
+    public String getManifestPath() {
+        return env.SDK + "\\frameworks\\mxml-2009-manifest.xml";
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/04bc6501/compiler.tests/src/org/apache/flex/utils/ITestAdapter.java
----------------------------------------------------------------------
diff --git a/compiler.tests/src/org/apache/flex/utils/ITestAdapter.java b/compiler.tests/src/org/apache/flex/utils/ITestAdapter.java
new file mode 100644
index 0000000..460ce16
--- /dev/null
+++ b/compiler.tests/src/org/apache/flex/utils/ITestAdapter.java
@@ -0,0 +1,17 @@
+package org.apache.flex.utils;
+
+import java.io.File;
+import java.util.List;
+
+/**
+ * Created by christoferdutz on 23.02.16.
+ */
+public interface ITestAdapter {
+
+    String getTempDir();
+
+    List<File> getLibraries(boolean withFlex);
+
+    String getManifestPath();
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/04bc6501/compiler.tests/src/org/apache/flex/utils/MavenTestAdapter.java
----------------------------------------------------------------------
diff --git a/compiler.tests/src/org/apache/flex/utils/MavenTestAdapter.java b/compiler.tests/src/org/apache/flex/utils/MavenTestAdapter.java
new file mode 100644
index 0000000..403ee67
--- /dev/null
+++ b/compiler.tests/src/org/apache/flex/utils/MavenTestAdapter.java
@@ -0,0 +1,63 @@
+package org.apache.flex.utils;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Created by christoferdutz on 23.02.16.
+ */
+public class MavenTestAdapter implements ITestAdapter {
+
+    @Override
+    public String getTempDir() {
+        File tempDir = new File("target/surefire-temp");
+        if(!tempDir.exists()) {
+            if(!tempDir.mkdirs()) {
+                throw new RuntimeException("Could not create temp dir at: " + tempDir.getAbsolutePath());
+            }
+        }
+        return tempDir.getPath();
+    }
+
+    @Override
+    public List<File> getLibraries(boolean withFlex) {
+        List<File> libs = new ArrayList<File>();
+        libs.add(getDependency("com.adobe.flash.framework", "playerglobal",
+                System.getProperty("flashVersion"), "swc", null));
+        if(withFlex) {
+            String flexVersion = System.getProperty("flexVersion");
+            libs.add(getDependency("org.apache.flex.framework", "framework", flexVersion, "swc", null));
+            libs.add(getDependency("org.apache.flex.framework", "rpc", flexVersion, "swc", null));
+            libs.add(getDependency("org.apache.flex.framework", "spark", flexVersion, "swc", null));
+        }
+        return libs;
+    }
+
+    @Override
+    public String getManifestPath() {
+        File configsZip = getDependency("org.apache.flex.framework", "framework",
+                System.getProperty("flexVersion"), "zip", "configs");
+        File frameworkDir = configsZip.getParentFile();
+        File unpackedConfigsDir = new File(frameworkDir, "configs_zip");
+        // If the directory doesn't exist, we have to create it by unpacking the zip archive.
+        // This is identical behaviour to Flexmojos, which does the same thing.
+        if(!unpackedConfigsDir.exists()) {
+            // TODO: Implement
+        }
+        return new File(unpackedConfigsDir, "mxml-2009-manifest.xml").getPath();
+    }
+
+    private File getDependency(String groupId, String artifactId, String version, String type, String classifier) {
+        String dependencyPath = System.getProperty("mavenLocalRepoDir") + "/" + groupId.replaceAll("\\.", "/") + "/" +
+                artifactId + "/" + version + "/" + artifactId + "-" + version +
+                ((classifier != null) ? "-" + classifier : "") + "." + type;
+        dependencyPath = FilenameNormalization.normalize(dependencyPath);
+        File dependency = new File(dependencyPath);
+        if(!dependency.exists()) {
+            throw new RuntimeException("Could not read SWC dependency at " + dependency.getAbsolutePath());
+        }
+        return dependency;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/04bc6501/compiler.tests/unit-tests/org/apache/flex/compiler/internal/tree/mxml/MXMLNodeBaseTests.java
----------------------------------------------------------------------
diff --git a/compiler.tests/unit-tests/org/apache/flex/compiler/internal/tree/mxml/MXMLNodeBaseTests.java b/compiler.tests/unit-tests/org/apache/flex/compiler/internal/tree/mxml/MXMLNodeBaseTests.java
index 048b44c..70eed1a 100644
--- a/compiler.tests/unit-tests/org/apache/flex/compiler/internal/tree/mxml/MXMLNodeBaseTests.java
+++ b/compiler.tests/unit-tests/org/apache/flex/compiler/internal/tree/mxml/MXMLNodeBaseTests.java
@@ -43,6 +43,9 @@ import org.apache.flex.compiler.units.requests.ISyntaxTreeRequestResult;
 import org.apache.flex.utils.EnvProperties;
 import org.apache.flex.utils.FilenameNormalization;
 import org.apache.flex.utils.StringUtils;
+import org.apache.flex.utils.ITestAdapter;
+import org.apache.flex.utils.AntTestAdapter;
+import org.apache.flex.utils.MavenTestAdapter;
 import org.junit.Ignore;
 
 /**
@@ -124,14 +127,14 @@ public class MXMLNodeBaseTests
     
     protected IMXMLFileNode getMXMLFileNode(String mxml, boolean withFlex)
 	{
-    	if (withFlex)
-    		assertNotNull("Environment variable FLEX_HOME is not set", env.SDK);
-		assertNotNull("Environment variable PLAYERGLOBAL_HOME is not set", env.FPSDK);
-		
 		project = new FlexProject(workspace);
-		FlexProjectConfigurator.configure(project);		
-		
-		String tempDir = FilenameNormalization.normalize("temp"); // ensure this exists
+		FlexProjectConfigurator.configure(project);
+
+		// Depending on the "buildType" system-property, create the corresponding test-adapter.
+		// Make the AntTestAdapter the default.
+		ITestAdapter testAdapter = System.getProperty("buildType", "Ant").equals("Maven") ?
+				new MavenTestAdapter() : new AntTestAdapter();
+		String tempDir = testAdapter.getTempDir();
 				
 		File tempMXMLFile = null;
 		try
@@ -152,21 +155,13 @@ public class MXMLNodeBaseTests
 		sourcePath.add(new File(tempDir));
 		project.setSourcePath(sourcePath);
 
-		// Compile the code against playerglobal.swc.
-		List<File> libraries = new ArrayList<File>();
-		libraries.add(new File(FilenameNormalization.normalize(env.FPSDK + "\\" + env.FPVER + "\\playerglobal.swc")));
-		if (withFlex)
-		{
-			libraries.add(new File(FilenameNormalization.normalize(env.SDK + "\\frameworks\\libs\\framework.swc")));
-			libraries.add(new File(FilenameNormalization.normalize(env.SDK + "\\frameworks\\libs\\rpc.swc")));
-			libraries.add(new File(FilenameNormalization.normalize(env.SDK + "\\frameworks\\libs\\spark.swc")));
-		}
+		List<File> libraries = testAdapter.getLibraries(withFlex);
 		project.setLibraries(libraries);
 		
 		// Use the MXML 2009 manifest.
 		List<IMXMLNamespaceMapping> namespaceMappings = new ArrayList<IMXMLNamespaceMapping>();
 		IMXMLNamespaceMapping mxml2009 = new MXMLNamespaceMapping(
-		    "http://ns.adobe.com/mxml/2009", env.SDK + "\\frameworks\\mxml-2009-manifest.xml");
+		    "http://ns.adobe.com/mxml/2009", testAdapter.getManifestPath());
 		namespaceMappings.add(mxml2009);
 		project.setNamespaceMappings(namespaceMappings);