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/03/12 13:11:16 UTC
[01/18] git commit: [flex-falcon]
[refs/heads/feature/maven-migration] - - Made the build use the
FLASHPLAYER_DEBUGGER environment variable.
Repository: flex-falcon
Updated Branches:
refs/heads/feature/maven-migration c5220ae7e -> 9d43e31da
- Made the build use the FLASHPLAYER_DEBUGGER environment variable.
Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/5ff0219a
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/5ff0219a
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/5ff0219a
Branch: refs/heads/feature/maven-migration
Commit: 5ff0219abce37d38b22d3acb15706fd8a992028e
Parents: 82df476
Author: Christofer Dutz <ch...@codecentric.de>
Authored: Tue Mar 8 13:52:07 2016 +0100
Committer: Christofer Dutz <ch...@codecentric.de>
Committed: Tue Mar 8 13:52:07 2016 +0100
----------------------------------------------------------------------
compiler.tests/src/org/apache/flex/utils/MavenTestAdapter.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/5ff0219a/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
index 09f41c3..a1f25e7 100644
--- a/compiler.tests/src/org/apache/flex/utils/MavenTestAdapter.java
+++ b/compiler.tests/src/org/apache/flex/utils/MavenTestAdapter.java
@@ -57,7 +57,8 @@ public class MavenTestAdapter implements ITestAdapter {
public File getFlashplayerDebugger() {
// TODO: If the archive isn't unpacked, unpack it.
// TODO: Return a reference to the player debugger executable, depending on the current platform.
- return new File("/Users/christoferdutz/Devtools/Adobe/Flash/19.0/Flash Player.app/Contents/MacOS/Flash Player Debugger");
+ String FLASHPLAYER_DEBUGGER = System.getProperty("FLASHPLAYER_DEBUGGER", null);
+ return new File(FLASHPLAYER_DEBUGGER);
/*return getDependency("com.adobe.flash.runtime", "player-debugger",
System.getProperty("flashVersion"), "zip", null);*/
}
[09/18] git commit: [flex-falcon]
[refs/heads/feature/maven-migration] - Continued the preparation of
supporting Ant and Maven builds by extending the test-adapters to support
additional parameters needed by FlexJS / ASJS
Posted by cd...@apache.org.
Continued the preparation of supporting Ant and Maven builds by extending the test-adapters to support additional parameters needed by FlexJS / ASJS
Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/d4aaeab9
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/d4aaeab9
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/d4aaeab9
Branch: refs/heads/feature/maven-migration
Commit: d4aaeab9f6427f67fd46708e2a8894dd7adf457a
Parents: 92d2b98
Author: Christofer Dutz <ch...@codecentric.de>
Authored: Fri Mar 11 15:15:07 2016 +0100
Committer: Christofer Dutz <ch...@codecentric.de>
Committed: Fri Mar 11 15:15:07 2016 +0100
----------------------------------------------------------------------
.../feature-tests/as/ASFeatureTestsBase.java | 19 ++---
.../mxml/tags/MXMLFeatureTestsBase.java | 19 ++---
.../org/apache/flex/utils/AntTestAdapter.java | 54 +++++++++---
.../org/apache/flex/utils/EnvProperties.java | 13 ++-
.../src/org/apache/flex/utils/ITestAdapter.java | 33 +++++++-
.../org/apache/flex/utils/MavenTestAdapter.java | 86 +++++++++++++++-----
.../apache/flex/utils/TestAdapterFactory.java | 41 ++++++++++
.../internal/tree/mxml/MXMLNodeBaseTests.java | 35 +++-----
8 files changed, 214 insertions(+), 86 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/d4aaeab9/compiler.tests/feature-tests/as/ASFeatureTestsBase.java
----------------------------------------------------------------------
diff --git a/compiler.tests/feature-tests/as/ASFeatureTestsBase.java b/compiler.tests/feature-tests/as/ASFeatureTestsBase.java
index e088970..f7ac2f9 100644
--- a/compiler.tests/feature-tests/as/ASFeatureTestsBase.java
+++ b/compiler.tests/feature-tests/as/ASFeatureTestsBase.java
@@ -51,10 +51,7 @@ public class ASFeatureTestsBase
System.out.println("Generating test:");
// Write the MXML into a temp file.
- // 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();
+ ITestAdapter testAdapter = TestAdapterFactory.getTestAdapter();
String tempDir = testAdapter.getTempDir();
File tempASFile = null;
try
@@ -81,25 +78,25 @@ public class ASFeatureTestsBase
List<String> swcs = new ArrayList<String>();
if (withFramework)
{
- swcs.add(testAdapter.getArtifact("framework").getPath());
- swcs.add(testAdapter.getArtifactResourceBundle("framework").getPath());
+ swcs.add(testAdapter.getFlexArtifact("framework").getPath());
+ swcs.add(testAdapter.getFlexArtifactResourceBundle("framework").getPath());
}
if (withRPC)
{
- swcs.add(testAdapter.getArtifact("rpc").getPath());
- swcs.add(testAdapter.getArtifactResourceBundle("rpc").getPath());
+ swcs.add(testAdapter.getFlexArtifact("rpc").getPath());
+ swcs.add(testAdapter.getFlexArtifactResourceBundle("rpc").getPath());
}
if (withSpark)
{
- swcs.add(testAdapter.getArtifact("spark").getPath());
- swcs.add(testAdapter.getArtifactResourceBundle("spark").getPath());
+ swcs.add(testAdapter.getFlexArtifact("spark").getPath());
+ swcs.add(testAdapter.getFlexArtifactResourceBundle("spark").getPath());
}
String libraryPath = "-library-path=" + StringUtils.join(swcs.toArray(new String[swcs.size()]), ",");
List<String> args = new ArrayList<String>();
args.add("-external-library-path=" + testAdapter.getPlayerglobal().getPath());
args.add(libraryPath);
- args.add("-namespace=" + NAMESPACE_2009 + "," + testAdapter.getManifestPath());
+ args.add("-namespace=" + NAMESPACE_2009 + "," + testAdapter.getFlexManifestPath("mxml-2009"));
if (otherOptions != null)
{
Collections.addAll(args, otherOptions);
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/d4aaeab9/compiler.tests/feature-tests/mxml/tags/MXMLFeatureTestsBase.java
----------------------------------------------------------------------
diff --git a/compiler.tests/feature-tests/mxml/tags/MXMLFeatureTestsBase.java b/compiler.tests/feature-tests/mxml/tags/MXMLFeatureTestsBase.java
index fd5fc16..c36ad0f 100644
--- a/compiler.tests/feature-tests/mxml/tags/MXMLFeatureTestsBase.java
+++ b/compiler.tests/feature-tests/mxml/tags/MXMLFeatureTestsBase.java
@@ -52,10 +52,7 @@ public class MXMLFeatureTestsBase
System.out.println("Generating test:");
// Write the MXML into a temp file.
- // 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();
+ ITestAdapter testAdapter = TestAdapterFactory.getTestAdapter();
String tempDir = testAdapter.getTempDir();
File tempMXMLFile = null;
try
@@ -77,25 +74,25 @@ public class MXMLFeatureTestsBase
List<String> swcs = new ArrayList<String>();
if (withFramework)
{
- swcs.add(testAdapter.getArtifact("framework").getPath());
- swcs.add(testAdapter.getArtifactResourceBundle("framework").getPath());
+ swcs.add(testAdapter.getFlexArtifact("framework").getPath());
+ swcs.add(testAdapter.getFlexArtifactResourceBundle("framework").getPath());
}
if (withRPC)
{
- swcs.add(testAdapter.getArtifact("rpc").getPath());
- swcs.add(testAdapter.getArtifactResourceBundle("rpc").getPath());
+ swcs.add(testAdapter.getFlexArtifact("rpc").getPath());
+ swcs.add(testAdapter.getFlexArtifactResourceBundle("rpc").getPath());
}
if (withSpark)
{
- swcs.add(testAdapter.getArtifact("spark").getPath());
- swcs.add(testAdapter.getArtifactResourceBundle("spark").getPath());
+ swcs.add(testAdapter.getFlexArtifact("spark").getPath());
+ swcs.add(testAdapter.getFlexArtifactResourceBundle("spark").getPath());
}
String libraryPath = "-library-path=" + StringUtils.join(swcs.toArray(new String[swcs.size()]), ",");
List<String> args = new ArrayList<String>();
args.add("-external-library-path=" + testAdapter.getPlayerglobal().getPath());
args.add(libraryPath);
- args.add("-namespace=" + NAMESPACE_2009 + "," + testAdapter.getManifestPath());
+ args.add("-namespace=" + NAMESPACE_2009 + "," + testAdapter.getFlexManifestPath("mxml-2009"));
if (otherOptions != null)
{
Collections.addAll(args, otherOptions);
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/d4aaeab9/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
index c0d253d..c79c61a 100644
--- a/compiler.tests/src/org/apache/flex/utils/AntTestAdapter.java
+++ b/compiler.tests/src/org/apache/flex/utils/AntTestAdapter.java
@@ -1,3 +1,22 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
package org.apache.flex.utils;
import java.io.File;
@@ -38,19 +57,14 @@ public class AntTestAdapter implements ITestAdapter {
libraries.add(getPlayerglobal());
if (withFlex)
{
- libraries.add(getArtifact("framework"));
- libraries.add(getArtifact("rpc"));
- libraries.add(getArtifact("spark"));
+ libraries.add(getFlexArtifact("framework"));
+ libraries.add(getFlexArtifact("rpc"));
+ libraries.add(getFlexArtifact("spark"));
}
return libraries;
}
@Override
- public String getManifestPath() {
- return env.SDK + "\\frameworks\\mxml-2009-manifest.xml";
- }
-
- @Override
public File getPlayerglobal() {
return PLAYERGLOBAL_SWC;
}
@@ -61,15 +75,35 @@ public class AntTestAdapter implements ITestAdapter {
}
@Override
- public File getArtifact(String artifactName) {
+ public String getFlexManifestPath(String type) {
+ return env.SDK + "\\frameworks\\" + type + "-manifest.xml";
+ }
+
+ @Override
+ public File getFlexArtifact(String artifactName) {
return getLib(artifactName);
}
@Override
- public File getArtifactResourceBundle(String artifactName) {
+ public File getFlexArtifactResourceBundle(String artifactName) {
return getResourceBundle(artifactName);
}
+ @Override
+ public String getFlexJsManifestPath(String type) {
+ return null;
+ }
+
+ @Override
+ public File getFlexJSArtifact(String artifactName) {
+ return null;
+ }
+
+ @Override
+ public File getUnitTestBaseDir() {
+ return new File(FilenameNormalization.normalize("test-files"));
+ }
+
private File getLib(String artifactId) {
return new File(LIBS_ROOT, artifactId + ".swc");
}
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/d4aaeab9/compiler.tests/src/org/apache/flex/utils/EnvProperties.java
----------------------------------------------------------------------
diff --git a/compiler.tests/src/org/apache/flex/utils/EnvProperties.java b/compiler.tests/src/org/apache/flex/utils/EnvProperties.java
index 03805d5..b204b1b 100644
--- a/compiler.tests/src/org/apache/flex/utils/EnvProperties.java
+++ b/compiler.tests/src/org/apache/flex/utils/EnvProperties.java
@@ -80,8 +80,7 @@ public class EnvProperties {
{
String prefix = "";
Properties p = new Properties();
- String envFileName = FilenameNormalization
- .normalize("../env.properties");
+ String envFileName = FilenameNormalization.normalize("../env.properties");
try {
File f = new File(envFileName);
if (f.exists())
@@ -97,19 +96,19 @@ public class EnvProperties {
} catch (FileNotFoundException e1) {
System.out.println("unittest.properties not found");
} catch (IOException e1) {
+ // Ignore
}
} catch (IOException e) {
+ // Ignore
}
SDK = p.getProperty(prefix + "FLEX_HOME", System.getenv("FLEX_HOME"));
if(SDK == null)
{
- SDK = FilenameNormalization
- .normalize("../../flex-sdk");
+ SDK = FilenameNormalization.normalize("../../flex-sdk");
File mxmlc = new File(SDK + "/lib/mxmlc.jar");
if (!mxmlc.exists())
- SDK = FilenameNormalization
- .normalize("../compiler/generated/dist/sdk");
+ SDK = FilenameNormalization.normalize("../compiler/generated/dist/sdk");
}
System.out.println("environment property - FLEX_HOME = " + SDK);
@@ -126,7 +125,7 @@ public class EnvProperties {
TLF = p.getProperty(prefix + "TLF_HOME", System.getenv("TLF_HOME"));
if (TLF == null)
{
- TLF = FilenameNormalization.normalize("../../flex-tlf");
+ TLF = FilenameNormalization.normalize("../../flex-tlf");
}
System.out.println("environment property - TLF_HOME = " + TLF);
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/d4aaeab9/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
index 4790004..5f35557 100644
--- a/compiler.tests/src/org/apache/flex/utils/ITestAdapter.java
+++ b/compiler.tests/src/org/apache/flex/utils/ITestAdapter.java
@@ -1,3 +1,22 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
package org.apache.flex.utils;
import java.io.File;
@@ -12,14 +31,20 @@ public interface ITestAdapter {
List<File> getLibraries(boolean withFlex);
- String getManifestPath();
-
File getPlayerglobal();
File getFlashplayerDebugger();
- File getArtifact(String artifactName);
+ String getFlexManifestPath(String type);
+
+ File getFlexArtifact(String artifactName);
+
+ File getFlexArtifactResourceBundle(String artifactName);
+
+ String getFlexJsManifestPath(String type);
+
+ File getFlexJSArtifact(String artifactName);
- File getArtifactResourceBundle(String artifactName);
+ File getUnitTestBaseDir();
}
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/d4aaeab9/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
index a1f25e7..485d14b 100644
--- a/compiler.tests/src/org/apache/flex/utils/MavenTestAdapter.java
+++ b/compiler.tests/src/org/apache/flex/utils/MavenTestAdapter.java
@@ -1,5 +1,26 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
package org.apache.flex.utils;
+import org.apache.commons.io.FilenameUtils;
+
import java.io.File;
import java.util.ArrayList;
import java.util.List;
@@ -34,20 +55,6 @@ public class MavenTestAdapter implements ITestAdapter {
}
@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();
- }
-
- @Override
public File getPlayerglobal() {
return getDependency("com.adobe.flash.framework", "playerglobal",
System.getProperty("flashVersion"), "swc", null);
@@ -64,22 +71,61 @@ public class MavenTestAdapter implements ITestAdapter {
}
@Override
- public File getArtifact(String artifactName) {
+ public String getFlexManifestPath(String type) {
+ 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, type + "-manifest.xml").getPath();
+ }
+
+ @Override
+ public File getFlexArtifact(String artifactName) {
String flexVersion = System.getProperty("flexVersion");
return getDependency("org.apache.flex.framework", artifactName, flexVersion, "swc", null);
}
@Override
- public File getArtifactResourceBundle(String artifactName) {
+ public File getFlexArtifactResourceBundle(String artifactName) {
String flexVersion = System.getProperty("flexVersion");
return getDependency("org.apache.flex.framework", artifactName, flexVersion, "rb.swc", "en_US");
}
+ @Override
+ public String getFlexJsManifestPath(String type) {
+ File configsZip = getDependency("org.apache.flex.framework.flexjs", "framework",
+ System.getProperty("flexJsVersion"), "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, type + "-manifest.xml").getPath();
+ }
+
+ @Override
+ public File getFlexJSArtifact(String artifactName) {
+ String flexJsVersion = System.getProperty("flexJsVersion");
+ return getDependency("org.apache.flex.framework.flexjs", artifactName, flexJsVersion, "swc", null);
+ }
+
+ @Override
+ public File getUnitTestBaseDir() {
+ return new File(FilenameUtils.normalize("target/test-classes"));
+ }
+
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);
+ String dependencyPath = System.getProperty("mavenLocalRepoDir") + File.separator +
+ groupId.replaceAll("\\.", File.separator) + File.separator + artifactId + File.separator + version +
+ File.separator + artifactId + "-" + version + ((classifier != null) ? "-" + classifier : "") + "." +
+ type;
File dependency = new File(dependencyPath);
if(!dependency.exists()) {
throw new RuntimeException("Could not read SWC dependency at " + dependency.getAbsolutePath());
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/d4aaeab9/compiler.tests/src/org/apache/flex/utils/TestAdapterFactory.java
----------------------------------------------------------------------
diff --git a/compiler.tests/src/org/apache/flex/utils/TestAdapterFactory.java b/compiler.tests/src/org/apache/flex/utils/TestAdapterFactory.java
new file mode 100644
index 0000000..ccdb0c2
--- /dev/null
+++ b/compiler.tests/src/org/apache/flex/utils/TestAdapterFactory.java
@@ -0,0 +1,41 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.flex.utils;
+
+/**
+ * Created by christoferdutz on 10.03.16.
+ */
+public class TestAdapterFactory {
+
+ private static final ITestAdapter adapter =
+ System.getProperty("buildType", "Ant").equals("Maven") ?
+ new MavenTestAdapter() : new AntTestAdapter();
+
+ /**
+ * Depending on the "buildType" system-property, create the corresponding test-adapter
+ * Make the AntTestAdapter the default.
+ *
+ * @return test adapter instance for the given type of build.
+ */
+ public static ITestAdapter getTestAdapter() {
+ return adapter;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/d4aaeab9/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 70eed1a..1598e9d 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
@@ -19,16 +19,6 @@
package org.apache.flex.compiler.internal.tree.mxml;
-import static org.junit.Assert.assertNotNull;
-
-import java.io.BufferedWriter;
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
import org.apache.flex.compiler.internal.mxml.MXMLNamespaceMapping;
import org.apache.flex.compiler.internal.projects.FlexProject;
import org.apache.flex.compiler.internal.projects.FlexProjectConfigurator;
@@ -40,14 +30,17 @@ import org.apache.flex.compiler.tree.as.IASNode;
import org.apache.flex.compiler.tree.mxml.IMXMLFileNode;
import org.apache.flex.compiler.units.ICompilationUnit;
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.apache.flex.utils.*;
import org.junit.Ignore;
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
/**
* JUnit tests for {@link MXMLNodeBase}.
*
@@ -56,8 +49,7 @@ import org.junit.Ignore;
@Ignore
public class MXMLNodeBaseTests
{
- private static EnvProperties env = EnvProperties.initiate();
-
+
protected static Workspace workspace = new Workspace();
protected FlexProject project;
@@ -130,10 +122,7 @@ public class MXMLNodeBaseTests
project = new FlexProject(workspace);
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();
+ ITestAdapter testAdapter = TestAdapterFactory.getTestAdapter();
String tempDir = testAdapter.getTempDir();
File tempMXMLFile = null;
@@ -161,7 +150,7 @@ public class MXMLNodeBaseTests
// Use the MXML 2009 manifest.
List<IMXMLNamespaceMapping> namespaceMappings = new ArrayList<IMXMLNamespaceMapping>();
IMXMLNamespaceMapping mxml2009 = new MXMLNamespaceMapping(
- "http://ns.adobe.com/mxml/2009", testAdapter.getManifestPath());
+ "http://ns.adobe.com/mxml/2009", testAdapter.getFlexManifestPath("mxml-2009"));
namespaceMappings.add(mxml2009);
project.setNamespaceMappings(namespaceMappings);
[04/18] git commit: [flex-falcon]
[refs/heads/feature/maven-migration] - Window.resolveLocalFileSystemURI has
been deprecated. This update adds its replacement, resolveLocalFileSystemURL.
Posted by cd...@apache.org.
Window.resolveLocalFileSystemURI has been deprecated. This update adds its replacement, resolveLocalFileSystemURL.
Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/49c3296c
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/49c3296c
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/49c3296c
Branch: refs/heads/feature/maven-migration
Commit: 49c3296cd325e0ae3e31ee48ca0d176094ec2e6a
Parents: 8d8b2f2
Author: Peter Ent <pe...@apache.org>
Authored: Thu Mar 10 06:46:18 2016 -0500
Committer: Peter Ent <pe...@apache.org>
Committed: Thu Mar 10 06:46:18 2016 -0500
----------------------------------------------------------------------
externs/js/missing.js | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/49c3296c/externs/js/missing.js
----------------------------------------------------------------------
diff --git a/externs/js/missing.js b/externs/js/missing.js
index cb6980e..d53e13b 100644
--- a/externs/js/missing.js
+++ b/externs/js/missing.js
@@ -17,7 +17,7 @@
*
*/
-
+
// webkit_notifications
/**
* @constructor
@@ -49,6 +49,16 @@ var window;
Window.prototype.document;
/**
+ * resolveLocalFileSystemURI has been deprecated; this is the replacement.
+ * @see http://www.w3.org/TR/file-system-api/#widl-LocalFileSystem-resolveLocalFileSystemURL
+ * @param {string} url
+ * @param {function(!Entry)} successCallback
+ * @param {function(!FileError)=} errorCallback
+ */
+Window.prototype.resolveLocalFileSystemURL = function(url, successCallback,
+ errorCallback) {}
+
+/**
* @constructor
*/
function Promise() {}
@@ -162,4 +172,4 @@ function trace(rest) {}
* @type {!Console}
* @const
*/
-var console;
\ No newline at end of file
+var console;
[07/18] git commit: [flex-falcon]
[refs/heads/feature/maven-migration] - initial support for QName and
Namespace
Posted by cd...@apache.org.
initial support for QName and Namespace
Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/92d2b983
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/92d2b983
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/92d2b983
Branch: refs/heads/feature/maven-migration
Commit: 92d2b983ad00b8d8c68490afe0d66bc66c6687cf
Parents: 8e27013
Author: Alex Harui <ah...@apache.org>
Authored: Thu Mar 10 19:27:09 2016 -0800
Committer: Alex Harui <ah...@apache.org>
Committed: Thu Mar 10 19:32:14 2016 -0800
----------------------------------------------------------------------
.../js/flexjs/TestFlexJSGlobalClasses.java | 34 +++++-------
.../internal/codegen/as/ASBlockWalker.java | 1 +
.../codegen/js/flexjs/JSFlexJSEmitter.java | 21 ++++++++
.../codegen/js/jx/MemberAccessEmitter.java | 55 ++++++++++++++++++++
.../codegen/js/jx/PackageHeaderEmitter.java | 5 +-
.../internal/projects/FlexJSProject.java | 12 ++++-
6 files changed, 105 insertions(+), 23 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/92d2b983/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSGlobalClasses.java
----------------------------------------------------------------------
diff --git a/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSGlobalClasses.java b/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSGlobalClasses.java
index a3a50c1..96a9a0a 100644
--- a/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSGlobalClasses.java
+++ b/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSGlobalClasses.java
@@ -519,60 +519,52 @@ public class TestFlexJSGlobalClasses extends TestGoogGlobalClasses
assertOut("var foreachiter0_target = a;\nfor (var foreachiter0 in foreachiter0_target.elementNames()) \n{\nvar p = foreachiter0_target.child(foreachiter0);\n\n var /** @type {number} */ i = p.length();}\n");
}
- @Ignore
+ @Test
public void testNamespaceNoArg()
{
IVariableNode node = getVariable("var a:Namespace = new Namespace();");
asBlockWalker.visitVariable(node);
- assertOut("var /** @type {Array} */ a = new Array(['Hello', 'World'])");
+ assertOut("var /** @type {Namespace} */ a = new Namespace()");
}
- @Ignore
+ @Test
public void testNamespaceOneArg()
{
IVariableNode node = getVariable("var a:Namespace = new Namespace('foo');");
asBlockWalker.visitVariable(node);
- assertOut("var /** @type {Array} */ a = new Array(['Hello', 'World'])");
+ assertOut("var /** @type {Namespace} */ a = new Namespace('foo')");
}
- @Ignore
+ @Test
public void testNamespaceTwoArg()
{
IVariableNode node = getVariable("var a:Namespace = new Namespace('foo', 'bar');");
asBlockWalker.visitVariable(node);
- assertOut("var /** @type {Array} */ a = new Array(['Hello', 'World'])");
+ assertOut("var /** @type {Namespace} */ a = new Namespace('foo', 'bar')");
}
-
- @Ignore
- public void testNamespaceThreeArg()
- {
- IVariableNode node = getVariable("var a:Namespace = new Namespace('foo', 'bar', 'baz');");
- asBlockWalker.visitVariable(node);
- assertOut("var /** @type {Array} */ a = new Array(['Hello', 'World'])");
- }
-
- @Ignore
+
+ @Test
public void testQNameNoArg()
{
IVariableNode node = getVariable("var a:QName = new QName();");
asBlockWalker.visitVariable(node);
- assertOut("var /** @type {Array} */ a = new Array(['Hello', 'World'])");
+ assertOut("var /** @type {QName} */ a = new QName()");
}
- @Ignore
+ @Test
public void testQNameTwoArg()
{
IVariableNode node = getVariable("var a:QName = new QName(new Namespace('foo'), 'bar');");
asBlockWalker.visitVariable(node);
- assertOut("var /** @type {Array} */ a = new Array(['Hello', 'World'])");
+ assertOut("var /** @type {QName} */ a = new QName(new Namespace('foo'), 'bar')");
}
- @Ignore
+ @Test
public void testQNameOneArg()
{
IVariableNode node = getVariable("var a:QName = new QName(new QName(new Namespace('foo'), 'bar'));");
asBlockWalker.visitVariable(node);
- assertOut("var /** @type {Array} */ a = new Array(['Hello', 'World'])");
+ assertOut("var /** @type {QName} */ a = new QName(new QName(new Namespace('foo'), 'bar'))");
}
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/92d2b983/compiler.jx/src/org/apache/flex/compiler/internal/codegen/as/ASBlockWalker.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/as/ASBlockWalker.java b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/as/ASBlockWalker.java
index d31ea74..aa29f4d 100644
--- a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/as/ASBlockWalker.java
+++ b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/as/ASBlockWalker.java
@@ -201,6 +201,7 @@ public class ASBlockWalker implements IASBlockVisitor, IASBlockWalker
isAllowedAfterPackage = pnode instanceof IInterfaceNode
|| pnode instanceof IClassNode
|| pnode instanceof IFunctionNode
+ || pnode instanceof INamespaceNode
|| pnode instanceof IVariableNode;
}
if(isPackage || isAllowedAfterPackage)
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/92d2b983/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/flexjs/JSFlexJSEmitter.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/flexjs/JSFlexJSEmitter.java b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/flexjs/JSFlexJSEmitter.java
index de50ace..d4325a7 100644
--- a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/flexjs/JSFlexJSEmitter.java
+++ b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/flexjs/JSFlexJSEmitter.java
@@ -25,6 +25,7 @@ import java.util.List;
import org.apache.flex.compiler.codegen.js.flexjs.IJSFlexJSEmitter;
import org.apache.flex.compiler.codegen.js.goog.IJSGoogDocEmitter;
+import org.apache.flex.compiler.constants.IASLanguageConstants;
import org.apache.flex.compiler.definitions.IClassDefinition;
import org.apache.flex.compiler.definitions.IDefinition;
import org.apache.flex.compiler.definitions.IPackageDefinition;
@@ -83,6 +84,7 @@ import org.apache.flex.compiler.tree.as.IInterfaceNode;
import org.apache.flex.compiler.tree.as.ILiteralContainerNode;
import org.apache.flex.compiler.tree.as.ILiteralNode;
import org.apache.flex.compiler.tree.as.IMemberAccessExpressionNode;
+import org.apache.flex.compiler.tree.as.INamespaceNode;
import org.apache.flex.compiler.tree.as.IPackageNode;
import org.apache.flex.compiler.tree.as.IScopedNode;
import org.apache.flex.compiler.tree.as.ISetterNode;
@@ -317,6 +319,20 @@ public class JSFlexJSEmitter extends JSGoogEmitter implements IJSFlexJSEmitter
writeToken(ASEmitterTokens.VAR);
}
}
+
+ @Override
+ public void emitNamespace(INamespaceNode node)
+ {
+ write(formatQualifiedName(node.getName()));
+ write(ASEmitterTokens.SPACE);
+ writeToken(ASEmitterTokens.EQUAL);
+ writeToken(ASEmitterTokens.NEW);
+ write(IASLanguageConstants.Namespace);
+ write(ASEmitterTokens.PAREN_OPEN);
+ getWalker().walk(node.getNamespaceURINode());
+ write(ASEmitterTokens.PAREN_CLOSE);
+ write(ASEmitterTokens.SEMICOLON);
+ }
@Override
public void emitMemberName(IDefinitionNode node)
@@ -397,6 +413,11 @@ public class JSFlexJSEmitter extends JSGoogEmitter implements IJSFlexJSEmitter
String className = ((IFunctionNode)pnode).getQualifiedName();
getModel().getInternalClasses().put(className, mainClassName + "." + className);
}
+ else if (pnode instanceof INamespaceNode)
+ {
+ String className = ((INamespaceNode)pnode).getQualifiedName();
+ getModel().getInternalClasses().put(className, mainClassName + "." + className);
+ }
else if (pnode instanceof IVariableNode)
{
String className = ((IVariableNode)pnode).getQualifiedName();
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/92d2b983/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/MemberAccessEmitter.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/MemberAccessEmitter.java b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/MemberAccessEmitter.java
index 2fcc160..305b2e9 100644
--- a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/MemberAccessEmitter.java
+++ b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/MemberAccessEmitter.java
@@ -21,6 +21,7 @@ package org.apache.flex.compiler.internal.codegen.js.jx;
import org.apache.flex.compiler.codegen.ISubEmitter;
import org.apache.flex.compiler.codegen.js.IJSEmitter;
+import org.apache.flex.compiler.constants.IASLanguageConstants;
import org.apache.flex.compiler.definitions.IDefinition;
import org.apache.flex.compiler.internal.codegen.as.ASEmitterTokens;
import org.apache.flex.compiler.internal.codegen.js.JSSubEmitter;
@@ -31,7 +32,9 @@ import org.apache.flex.compiler.internal.definitions.FunctionDefinition;
import org.apache.flex.compiler.internal.projects.FlexJSProject;
import org.apache.flex.compiler.internal.tree.as.FunctionCallNode;
import org.apache.flex.compiler.internal.tree.as.GetterNode;
+import org.apache.flex.compiler.internal.tree.as.IdentifierNode;
import org.apache.flex.compiler.internal.tree.as.MemberAccessExpressionNode;
+import org.apache.flex.compiler.internal.tree.as.NamespaceAccessExpressionNode;
import org.apache.flex.compiler.projects.ICompilerProject;
import org.apache.flex.compiler.tree.ASTNodeID;
import org.apache.flex.compiler.tree.as.IASNode;
@@ -61,6 +64,11 @@ public class MemberAccessEmitter extends JSSubEmitter implements
IASNode leftNode = node.getLeftOperandNode();
IASNode rightNode = node.getRightOperandNode();
+ String leftName = "";
+ if (leftNode instanceof IdentifierNode)
+ {
+ leftName = ((IdentifierNode)leftNode).getName();
+ }
JSFlexJSEmitter fjs = (JSFlexJSEmitter)getEmitter();
IDefinition def = node.resolve(getProject());
if (def == null)
@@ -136,6 +144,31 @@ public class MemberAccessEmitter extends JSSubEmitter implements
return;
}
}
+ else if (rightNode instanceof NamespaceAccessExpressionNode)
+ {
+ // if you define a local variable with the same URI as a
+ // namespace that defines a namespaced property
+ // it doesn't resolve above so we handle it here
+ NamespaceAccessExpressionNode naen = (NamespaceAccessExpressionNode)rightNode;
+ IDefinition d = naen.getLeftOperandNode().resolve(getProject());
+ IdentifierNode r = (IdentifierNode)(naen.getRightOperandNode());
+ // output bracket access with QName
+ writeLeftSide(node, leftNode, rightNode);
+ write(ASEmitterTokens.SQUARE_OPEN);
+ write(ASEmitterTokens.NEW);
+ write(ASEmitterTokens.SPACE);
+ write(IASLanguageConstants.QName);
+ write(ASEmitterTokens.PAREN_OPEN);
+ write(d.getBaseName());
+ write(ASEmitterTokens.COMMA);
+ write(ASEmitterTokens.SPACE);
+ write(ASEmitterTokens.SINGLE_QUOTE);
+ write(r.getName());
+ write(ASEmitterTokens.SINGLE_QUOTE);
+ write(ASEmitterTokens.PAREN_CLOSE);
+ write(ASEmitterTokens.SQUARE_CLOSE);
+ return;
+ }
}
else if (fjs.isDateProperty(node))
{
@@ -167,6 +200,28 @@ public class MemberAccessEmitter extends JSSubEmitter implements
return;
}
}
+ else if (rightNode instanceof NamespaceAccessExpressionNode)
+ {
+ NamespaceAccessExpressionNode naen = (NamespaceAccessExpressionNode)rightNode;
+ IDefinition d = naen.getLeftOperandNode().resolve(getProject());
+ IdentifierNode r = (IdentifierNode)(naen.getRightOperandNode());
+ // output bracket access with QName
+ writeLeftSide(node, leftNode, rightNode);
+ write(ASEmitterTokens.SQUARE_OPEN);
+ write(ASEmitterTokens.NEW);
+ write(ASEmitterTokens.SPACE);
+ write(IASLanguageConstants.QName);
+ write(ASEmitterTokens.PAREN_OPEN);
+ write(fjs.formatQualifiedName(d.getBaseName()));
+ write(ASEmitterTokens.COMMA);
+ write(ASEmitterTokens.SPACE);
+ write(ASEmitterTokens.SINGLE_QUOTE);
+ write(r.getName());
+ write(ASEmitterTokens.SINGLE_QUOTE);
+ write(ASEmitterTokens.PAREN_CLOSE);
+ write(ASEmitterTokens.SQUARE_CLOSE);
+ return;
+ }
boolean isStatic = false;
if (def != null && def.isStatic())
isStatic = true;
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/92d2b983/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/PackageHeaderEmitter.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/PackageHeaderEmitter.java b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/PackageHeaderEmitter.java
index d026e9c..64b560a 100644
--- a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/PackageHeaderEmitter.java
+++ b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/PackageHeaderEmitter.java
@@ -205,7 +205,10 @@ public class PackageHeaderEmitter extends JSSubEmitter implements
continue;
if (NativeUtils.isNative(imp))
- continue;
+ {
+ if (!(imp.equals("QName") || imp.equals("Namespace")))
+ continue;
+ }
if (writtenRequires.indexOf(imp) == -1)
{
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/92d2b983/compiler.jx/src/org/apache/flex/compiler/internal/projects/FlexJSProject.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/internal/projects/FlexJSProject.java b/compiler.jx/src/org/apache/flex/compiler/internal/projects/FlexJSProject.java
index ff668c6..bcae9ef 100644
--- a/compiler.jx/src/org/apache/flex/compiler/internal/projects/FlexJSProject.java
+++ b/compiler.jx/src/org/apache/flex/compiler/internal/projects/FlexJSProject.java
@@ -100,7 +100,7 @@ public class FlexJSProject extends FlexProject
reqs.put(qname, dt);
}
}
- else if (!isExternalLinkage(to))
+ else if (!isExternalLinkage(to) || qname.equals("Namespace"))
reqs.put(qname, dt);
}
}
@@ -165,6 +165,16 @@ public class FlexJSProject extends FlexProject
return false;
}
+ List<String> qnames;
+ try {
+ qnames = cu.getQualifiedNames();
+ String qname = qnames.get(0);
+ if (qname.equals("QName"))
+ return false;
+ } catch (InterruptedException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ }
try
{
return linkageChecker.isExternal(cu);
[11/18] git commit: [flex-falcon]
[refs/heads/feature/maven-migration] - Merge branch 'develop' into
feature/maven-migration
Posted by cd...@apache.org.
Merge branch '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/e203e4a8
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/e203e4a8
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/e203e4a8
Branch: refs/heads/feature/maven-migration
Commit: e203e4a8f61ab3d259c293b1258c8ad391a5cf7b
Parents: 73bc327 46755c1
Author: Christofer Dutz <ch...@codecentric.de>
Authored: Fri Mar 11 15:17:58 2016 +0100
Committer: Christofer Dutz <ch...@codecentric.de>
Committed: Fri Mar 11 15:17:58 2016 +0100
----------------------------------------------------------------------
build.xml | 24 +++-
.../js/flexjs/TestFlexJSGlobalClasses.java | 138 ++++++++++++++++---
.../internal/codegen/as/ASBlockWalker.java | 1 +
.../codegen/js/flexjs/JSFlexJSEmitter.java | 95 +++++++++++++
.../codegen/js/jx/BinaryOperatorEmitter.java | 124 +++++++++++++++++
.../codegen/js/jx/IdentifierEmitter.java | 57 ++++++++
.../codegen/js/jx/MemberAccessEmitter.java | 87 +++++++++++-
.../codegen/js/jx/PackageHeaderEmitter.java | 5 +-
.../internal/projects/FlexJSProject.java | 12 +-
.../feature-tests/as/ASFeatureTestsBase.java | 19 ++-
.../mxml/tags/MXMLFeatureTestsBase.java | 19 ++-
.../org/apache/flex/utils/AntTestAdapter.java | 54 ++++++--
.../org/apache/flex/utils/EnvProperties.java | 13 +-
.../src/org/apache/flex/utils/ITestAdapter.java | 33 ++++-
.../org/apache/flex/utils/MavenTestAdapter.java | 86 +++++++++---
.../apache/flex/utils/TestAdapterFactory.java | 41 ++++++
.../internal/tree/mxml/MXMLNodeBaseTests.java | 35 ++---
externs/cordova/build.xml | 42 ++++++
externs/cordova/compile-config.xml | 44 ++++++
externs/cordova/cordova-compile-config.xml | 39 ++++++
.../cordova/externs/cordova_file_plugin-4-11.js | 26 ++++
externs/js/missing.js | 86 +++++++++++-
22 files changed, 966 insertions(+), 114 deletions(-)
----------------------------------------------------------------------
[10/18] git commit: [flex-falcon]
[refs/heads/feature/maven-migration] - Merge remote-tracking branch
'origin/develop' into develop
Posted by cd...@apache.org.
Merge remote-tracking branch 'origin/develop' into develop
Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/46755c13
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/46755c13
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/46755c13
Branch: refs/heads/feature/maven-migration
Commit: 46755c13f22607d0f9f5a72920aa93347f595658
Parents: c183efe d4aaeab
Author: Christofer Dutz <ch...@codecentric.de>
Authored: Fri Mar 11 15:17:34 2016 +0100
Committer: Christofer Dutz <ch...@codecentric.de>
Committed: Fri Mar 11 15:17:34 2016 +0100
----------------------------------------------------------------------
.../js/flexjs/TestFlexJSGlobalClasses.java | 138 ++++++++++++++++---
.../internal/codegen/as/ASBlockWalker.java | 1 +
.../codegen/js/flexjs/JSFlexJSEmitter.java | 95 +++++++++++++
.../codegen/js/jx/BinaryOperatorEmitter.java | 124 +++++++++++++++++
.../codegen/js/jx/IdentifierEmitter.java | 57 ++++++++
.../codegen/js/jx/MemberAccessEmitter.java | 87 +++++++++++-
.../codegen/js/jx/PackageHeaderEmitter.java | 5 +-
.../internal/projects/FlexJSProject.java | 12 +-
.../feature-tests/as/ASFeatureTestsBase.java | 19 ++-
.../mxml/tags/MXMLFeatureTestsBase.java | 19 ++-
.../org/apache/flex/utils/AntTestAdapter.java | 54 ++++++--
.../org/apache/flex/utils/EnvProperties.java | 13 +-
.../src/org/apache/flex/utils/ITestAdapter.java | 33 ++++-
.../org/apache/flex/utils/MavenTestAdapter.java | 86 +++++++++---
.../apache/flex/utils/TestAdapterFactory.java | 41 ++++++
.../internal/tree/mxml/MXMLNodeBaseTests.java | 35 ++---
externs/js/missing.js | 72 ++++++++++
17 files changed, 781 insertions(+), 110 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/46755c13/compiler.tests/feature-tests/mxml/tags/MXMLFeatureTestsBase.java
----------------------------------------------------------------------
diff --cc compiler.tests/feature-tests/mxml/tags/MXMLFeatureTestsBase.java
index c4fdf26,c36ad0f..deb1a38
--- a/compiler.tests/feature-tests/mxml/tags/MXMLFeatureTestsBase.java
+++ b/compiler.tests/feature-tests/mxml/tags/MXMLFeatureTestsBase.java
@@@ -93,13 -90,9 +90,13 @@@ public class MXMLFeatureTestsBas
String libraryPath = "-library-path=" + StringUtils.join(swcs.toArray(new String[swcs.size()]), ",");
List<String> args = new ArrayList<String>();
+ // Force the testsuite to use en_US as locale, otherwise
+ // the testsuite will only pass on systems with en_US as
+ // locale.
+ args.add("-locale=en_US");
args.add("-external-library-path=" + testAdapter.getPlayerglobal().getPath());
args.add(libraryPath);
- args.add("-namespace=" + NAMESPACE_2009 + "," + testAdapter.getManifestPath());
+ args.add("-namespace=" + NAMESPACE_2009 + "," + testAdapter.getFlexManifestPath("mxml-2009"));
if (otherOptions != null)
{
Collections.addAll(args, otherOptions);
[05/18] git commit: [flex-falcon]
[refs/heads/feature/maven-migration] - Continued work on getting the unit
tests running.
Posted by cd...@apache.org.
Continued work on getting the unit tests running.
Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/73bc3279
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/73bc3279
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/73bc3279
Branch: refs/heads/feature/maven-migration
Commit: 73bc32797de5bd9d4f519eec2252c24d73348ca8
Parents: c5220ae
Author: Christofer Dutz <ch...@codecentric.de>
Authored: Thu Mar 10 23:00:26 2016 +0100
Committer: Christofer Dutz <ch...@codecentric.de>
Committed: Thu Mar 10 23:00:26 2016 +0100
----------------------------------------------------------------------
compiler-build-tools/pom.xml | 1 -
compiler.jx/pom.xml | 66 +++++++++++++++++++++++++++++++++++++++
compiler/pom.xml | 6 ++++
migrate-to-maven.sh | 7 +++++
4 files changed, 79 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/73bc3279/compiler-build-tools/pom.xml
----------------------------------------------------------------------
diff --git a/compiler-build-tools/pom.xml b/compiler-build-tools/pom.xml
index 1f89ea8..230c9fd 100644
--- a/compiler-build-tools/pom.xml
+++ b/compiler-build-tools/pom.xml
@@ -49,7 +49,6 @@
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
- <scope>test</scope>
</dependency>
</dependencies>
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/73bc3279/compiler.jx/pom.xml
----------------------------------------------------------------------
diff --git a/compiler.jx/pom.xml b/compiler.jx/pom.xml
index 60da13e..0b90a3c 100644
--- a/compiler.jx/pom.xml
+++ b/compiler.jx/pom.xml
@@ -14,6 +14,66 @@
<name>Apache Flex - FlexJS Compiler: FalconJx Cross Compiler</name>
+ <build>
+ <plugins>
+ <!-- Make the surefire execute all unit-tests -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.19</version>
+ <configuration>
+ <includes>
+ <include>org/**/Test*.java</include>
+ </includes>
+ <systemPropertyVariables>
+ <buildType>Maven</buildType>
+ <flexVersion>${flex.version}</flexVersion>
+ <flashVersion>${flash.version}</flashVersion>
+ <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>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-failsafe-plugin</artifactId>
+ <version>2.18.1</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>integration-test</goal>
+ <goal>verify</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <!--includes>
+ <include>as/**/*Tests.java</include>
+ <include>mxml/**/*Tests.java</include>
+ <include>properties/**/*Tests.java</include>
+ </includes-->
+ <systemPropertyVariables>
+ <buildType>Maven</buildType>
+ <flexVersion>${flex.version}</flexVersion>
+ <flashVersion>${flash.version}</flashVersion>
+ <airVersion>${air.version}</airVersion>
+ <mavenLocalRepoDir>${settings.localRepository}</mavenLocalRepoDir>
+ <FLASHPLAYER_DEBUGGER>${env.FLASHPLAYER_DEBUGGER}</FLASHPLAYER_DEBUGGER>
+ </systemPropertyVariables>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
<dependencies>
<dependency>
<groupId>org.apache.flex.flexjs.compiler</groupId>
@@ -43,6 +103,12 @@
</dependency>
<dependency>
+ <groupId>org.apache.flex.flexjs.compiler</groupId>
+ <artifactId>compiler-build-tools</artifactId>
+ <version>0.6.0-SNAPSHOT</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.10</version>
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/73bc3279/compiler/pom.xml
----------------------------------------------------------------------
diff --git a/compiler/pom.xml b/compiler/pom.xml
index 2f07609..a2ee9b6 100644
--- a/compiler/pom.xml
+++ b/compiler/pom.xml
@@ -427,6 +427,12 @@
</dependency>
<dependency>
+ <groupId>org.apache.flex.flexjs.compiler</groupId>
+ <artifactId>compiler-build-tools</artifactId>
+ <version>0.6.0-SNAPSHOT</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.10</version>
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/73bc3279/migrate-to-maven.sh
----------------------------------------------------------------------
diff --git a/migrate-to-maven.sh b/migrate-to-maven.sh
index d2ee1de..4ad854a 100755
--- a/migrate-to-maven.sh
+++ b/migrate-to-maven.sh
@@ -67,6 +67,13 @@ git mv compiler.tests/feature-tests/as compiler/src/test/java
git mv compiler.tests/feature-tests/mxml compiler/src/test/java
git mv compiler.tests/feature-tests/properties compiler/src/test/java
git mv compiler.tests/functional-tests/f compiler/src/test/java
+# Clean up
+git rm -r generated
+git rm -r lib
+git rm -r results
+git rm -r temp
+git rm -r tools
+git rm -r utils
#############################################
## Convert the compiler.jx module
[12/18] git commit: [flex-falcon]
[refs/heads/feature/maven-migration] - fix rat
Posted by cd...@apache.org.
fix rat
Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/54aa0880
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/54aa0880
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/54aa0880
Branch: refs/heads/feature/maven-migration
Commit: 54aa0880fdf4f04850bd2bb3e2beb0d8e30bb168
Parents: d4aaeab
Author: Alex Harui <ah...@apache.org>
Authored: Thu Mar 10 22:47:26 2016 -0800
Committer: Alex Harui <ah...@apache.org>
Committed: Fri Mar 11 08:25:42 2016 -0800
----------------------------------------------------------------------
build.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/54aa0880/build.xml
----------------------------------------------------------------------
diff --git a/build.xml b/build.xml
index 75a2c9d..b8bdf68 100644
--- a/build.xml
+++ b/build.xml
@@ -1019,7 +1019,7 @@
<exclude name="RELEASE_NOTES_JX"/>
<exclude name="NOTICE.jx"/>
<exclude name="NOTICE.base"/>
- <include name="NOTICE.fdb"/>
+ <exclude name="NOTICE.fdb"/>
<exclude name="NOTICE.oem"/>
<exclude name="NOTICE.swfutils"/>
</fileset>
[18/18] git commit: [flex-falcon]
[refs/heads/feature/maven-migration] - Continued fine-tuning the conversion.
Posted by cd...@apache.org.
Continued fine-tuning the conversion.
Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/9d43e31d
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/9d43e31d
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/9d43e31d
Branch: refs/heads/feature/maven-migration
Commit: 9d43e31da4e5beff9c86816daf6c9a4052f46b73
Parents: 8ea63f7
Author: Christofer Dutz <ch...@codecentric.de>
Authored: Sat Mar 12 13:11:07 2016 +0100
Committer: Christofer Dutz <ch...@codecentric.de>
Committed: Sat Mar 12 13:11:07 2016 +0100
----------------------------------------------------------------------
migrate-to-maven.sh | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/9d43e31d/migrate-to-maven.sh
----------------------------------------------------------------------
diff --git a/migrate-to-maven.sh b/migrate-to-maven.sh
index 4ad854a..ebe4fad 100755
--- a/migrate-to-maven.sh
+++ b/migrate-to-maven.sh
@@ -22,9 +22,16 @@ git mv flex-compiler-oem/src/macromedia flex-compiler-oem/src/main/java
#############################################
# Extract the UnknownTreePatternInputOutput generator.
git mv compiler/src/org/apache/flex/compiler/internal/as/codegen/UnknownTreePatternInputOutput.java compiler-build-tools/src/main/java/org/apache/flex/compiler/internal/as/codegen
+# Extract the test-adapter code.
+mkdir -p compiler-build-tools/src/main/java/org/apache/flex/utils
+git mv compiler.tests/src/org/apache/flex/utils/* compiler-build-tools/src/main/java/org/apache/flex/utils
+# Create a copy of the FilenameNormalization as we need this in both projects.
+cp compiler/src/org/apache/flex/utils/FilenameNormalization.java compiler-build-tools/src/main/java/org/apache/flex/utils
+git add compiler-build-tools/src/main/java/org/apache/flex/utils/FilenameNormalization.java
# Extract the IASNodeAdapter as this is needed for generating code in the compiler.
mkdir -p compiler-jburg-types/src/main/java/org/apache/flex/compiler/internal/as/codegen
git mv compiler/src/org/apache/flex/compiler/internal/as/codegen/IASNodeAdapter.java compiler-jburg-types/src/main/java/org/apache/flex/compiler/internal/as/codegen
+
# Convert the compiler project itself
mkdir -p compiler/src/main/java
mkdir -p compiler/src/main/resources
@@ -62,7 +69,6 @@ mkdir -p compiler/src/test/java
mkdir -p compiler/temp
mkdir -p compiler/results
git mv compiler.tests/unit-tests/org compiler/src/test/java
-git mv compiler.tests/src/org/apache/flex/utils compiler/src/test/java/org/apache/flex
git mv compiler.tests/feature-tests/as compiler/src/test/java
git mv compiler.tests/feature-tests/mxml compiler/src/test/java
git mv compiler.tests/feature-tests/properties compiler/src/test/java
@@ -87,6 +93,8 @@ git mv compiler.jx/src/org compiler.jx/src/main/java
# Move the tests from the separate project into the compiler.jx project
mkdir -p compiler.jx/src/test/java
git mv compiler.jx.tests/src/org compiler.jx/src/test/java
+# Remove the duplicate EnvProperties
+git rm -r compiler.jx.tests/src/org compiler.jx/src/test/java/org/apache/flex/utils
mkdir -p compiler.jx/src/test/resources
git mv compiler.jx.tests/test-files/* compiler.jx/src/test/resources
[13/18] git commit: [flex-falcon]
[refs/heads/feature/maven-migration] - add a few more files to the package
Posted by cd...@apache.org.
add a few more files to the package
Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/c4472af2
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/c4472af2
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/c4472af2
Branch: refs/heads/feature/maven-migration
Commit: c4472af2b7cc67fd9e0272649d65c12d790d3c71
Parents: 54aa088
Author: Alex Harui <ah...@apache.org>
Authored: Fri Mar 11 06:16:39 2016 -0800
Committer: Alex Harui <ah...@apache.org>
Committed: Fri Mar 11 08:25:43 2016 -0800
----------------------------------------------------------------------
build.xml | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c4472af2/build.xml
----------------------------------------------------------------------
diff --git a/build.xml b/build.xml
index b8bdf68..efa9c1d 100644
--- a/build.xml
+++ b/build.xml
@@ -462,8 +462,10 @@
<copy todir="${basedir}/temp/externs" includeEmptyDirs="false">
<fileset dir="${basedir}/externs">
<include name="**/*.xml"/>
- <include name="js/missing.js"/>
+ <include name="**/missing.js"/>
<include name="js/src/**"/>
+ <include name="cordova/externs/**"/>
+ <include name="createjs/externs/**"/>
</fileset>
</copy>
</target>
[17/18] git commit: [flex-falcon]
[refs/heads/feature/maven-migration] - Merge branch 'develop' of
https://git-wip-us.apache.org/repos/asf/flex-falcon into
feature/maven-migration
Posted by cd...@apache.org.
Merge branch 'develop' of https://git-wip-us.apache.org/repos/asf/flex-falcon 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/8ea63f7e
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/8ea63f7e
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/8ea63f7e
Branch: refs/heads/feature/maven-migration
Commit: 8ea63f7e628eba9734af459cdae027d675aec296
Parents: e203e4a ea7610b
Author: Christofer Dutz <ch...@codecentric.de>
Authored: Sat Mar 12 12:59:10 2016 +0100
Committer: Christofer Dutz <ch...@codecentric.de>
Committed: Sat Mar 12 12:59:10 2016 +0100
----------------------------------------------------------------------
build.xml | 5 +-
compiler.jx.tests/build.xml | 5 +
.../codegen/externals/ExternalsTestBase.java | 5 +-
.../codegen/js/flexjs/TestFlexJSFile.java | 15 +-
.../codegen/js/flexjs/TestFlexJSProject.java | 71 ++++-----
.../codegen/js/goog/TestGoogProject.java | 26 ++--
.../codegen/js/vf2js/TestVF2JSFile.java | 9 +-
.../codegen/js/vf2js/TestVF2JSProject.java | 13 +-
.../mxml/vf2js/TestVF2JSMXMLApplication.java | 9 +-
.../compiler/internal/test/AMDTestBase.java | 4 +-
.../flex/compiler/internal/test/TestBase.java | 25 ++--
.../internal/test/VF2JSMXMLTestBase.java | 6 +-
.../flex/compiler/utils/EnvProperties.java | 146 ------------------
.../org/apache/flex/utils/EnvProperties.java | 149 +++++++++++++++++++
.../org/apache/flex/utils/EnvProperties.java | 12 +-
15 files changed, 261 insertions(+), 239 deletions(-)
----------------------------------------------------------------------
[02/18] git commit: [flex-falcon]
[refs/heads/feature/maven-migration] - - Forced the integration-tests to run
with locale en_US as otherwise the tests will fail on non-us systems.
Posted by cd...@apache.org.
- Forced the integration-tests to run with locale en_US as otherwise the tests will fail on non-us systems.
Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/03132bc5
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/03132bc5
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/03132bc5
Branch: refs/heads/feature/maven-migration
Commit: 03132bc5e55cdd0c3349b349835bcf047ce2c63d
Parents: 5ff0219
Author: Christofer Dutz <ch...@codecentric.de>
Authored: Tue Mar 8 15:37:23 2016 +0100
Committer: Christofer Dutz <ch...@codecentric.de>
Committed: Tue Mar 8 15:37:23 2016 +0100
----------------------------------------------------------------------
compiler.tests/feature-tests/mxml/tags/MXMLFeatureTestsBase.java | 4 ++++
1 file changed, 4 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/03132bc5/compiler.tests/feature-tests/mxml/tags/MXMLFeatureTestsBase.java
----------------------------------------------------------------------
diff --git a/compiler.tests/feature-tests/mxml/tags/MXMLFeatureTestsBase.java b/compiler.tests/feature-tests/mxml/tags/MXMLFeatureTestsBase.java
index fd5fc16..c4fdf26 100644
--- a/compiler.tests/feature-tests/mxml/tags/MXMLFeatureTestsBase.java
+++ b/compiler.tests/feature-tests/mxml/tags/MXMLFeatureTestsBase.java
@@ -93,6 +93,10 @@ public class MXMLFeatureTestsBase
String libraryPath = "-library-path=" + StringUtils.join(swcs.toArray(new String[swcs.size()]), ",");
List<String> args = new ArrayList<String>();
+ // Force the testsuite to use en_US as locale, otherwise
+ // the testsuite will only pass on systems with en_US as
+ // locale.
+ args.add("-locale=en_US");
args.add("-external-library-path=" + testAdapter.getPlayerglobal().getPath());
args.add(libraryPath);
args.add("-namespace=" + NAMESPACE_2009 + "," + testAdapter.getManifestPath());
[08/18] git commit: [flex-falcon]
[refs/heads/feature/maven-migration] - handle differences in Array, Int, Uint,
Date
Posted by cd...@apache.org.
handle differences in Array, Int, Uint, Date
Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/8e270130
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/8e270130
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/8e270130
Branch: refs/heads/feature/maven-migration
Commit: 8e2701303c98d6a1ccde5d85c327ac96330ef014
Parents: 49c3296
Author: Alex Harui <ah...@apache.org>
Authored: Wed Mar 9 11:49:41 2016 -0800
Committer: Alex Harui <ah...@apache.org>
Committed: Thu Mar 10 19:32:14 2016 -0800
----------------------------------------------------------------------
.../js/flexjs/TestFlexJSGlobalClasses.java | 104 ++++++++++++++++
.../codegen/js/flexjs/JSFlexJSEmitter.java | 74 +++++++++++
.../codegen/js/jx/BinaryOperatorEmitter.java | 124 +++++++++++++++++++
.../codegen/js/jx/IdentifierEmitter.java | 57 +++++++++
.../codegen/js/jx/MemberAccessEmitter.java | 32 ++++-
externs/js/missing.js | 72 +++++++++++
6 files changed, 462 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/8e270130/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSGlobalClasses.java
----------------------------------------------------------------------
diff --git a/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSGlobalClasses.java b/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSGlobalClasses.java
index 1f0360f..a3a50c1 100644
--- a/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSGlobalClasses.java
+++ b/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSGlobalClasses.java
@@ -28,6 +28,7 @@ import org.apache.flex.compiler.internal.tree.as.VariableNode;
import org.apache.flex.compiler.tree.as.IASNode;
import org.apache.flex.compiler.tree.as.IBinaryOperatorNode;
import org.apache.flex.compiler.tree.as.IForLoopNode;
+import org.apache.flex.compiler.tree.as.IFunctionCallNode;
import org.apache.flex.compiler.tree.as.IFunctionNode;
import org.apache.flex.compiler.tree.as.IUnaryOperatorNode;
import org.apache.flex.compiler.tree.as.IVariableNode;
@@ -103,6 +104,109 @@ public class TestFlexJSGlobalClasses extends TestGoogGlobalClasses
assertOut("var /** @type {Array} */ a = new Array(['Hello', 'World'])");
}
+ @Test
+ public void testArrayConstCaseInsensitive()
+ {
+ IVariableNode node = getVariable("var a:Number = Array.CASEINSENSITIVE");
+ asBlockWalker.visitVariable(node);
+ assertOut("var /** @type {number} */ a = 1");
+ }
+
+ @Test
+ public void testArrayConstNumeric()
+ {
+ IVariableNode node = getVariable("var a:Number = Array.NUMERIC");
+ asBlockWalker.visitVariable(node);
+ assertOut("var /** @type {number} */ a = 16");
+ }
+
+ @Ignore
+ public void testArrayRemoveAt()
+ {
+ // requires FP19 or newer
+ IBinaryOperatorNode node = getBinaryNode("var a:Array = new Array(); a.removeAt(2)");
+ IFunctionCallNode parentNode = (IFunctionCallNode)(node.getParent());
+ asBlockWalker.visitFunctionCall(parentNode);
+ assertOut("a.splice(2, 1)");
+ }
+
+ @Ignore
+ public void testArrayInsertAt()
+ {
+ // requires FP19 or newer
+ IBinaryOperatorNode node = getBinaryNode("var a:Array = new Array(); a.insertAt(2, 'foo')");
+ IFunctionCallNode parentNode = (IFunctionCallNode)(node.getParent());
+ asBlockWalker.visitFunctionCall(parentNode);
+ assertOut("a.splice(2, 0, 'foo')");
+ }
+
+ @Test
+ public void testIntConstMaxValue()
+ {
+ IVariableNode node = getVariable("var a:Number = int.MAX_VALUE");
+ asBlockWalker.visitVariable(node);
+ assertOut("var /** @type {number} */ a = 2147483648");
+ }
+
+ @Test
+ public void testIntConstMinValue()
+ {
+ IVariableNode node = getVariable("var a:Number = int.MIN_VALUE");
+ asBlockWalker.visitVariable(node);
+ assertOut("var /** @type {number} */ a = -2147483648");
+ }
+
+ @Test
+ public void testUintConstMaxValue()
+ {
+ IVariableNode node = getVariable("var a:Number = uint.MAX_VALUE");
+ asBlockWalker.visitVariable(node);
+ assertOut("var /** @type {number} */ a = 4294967295");
+ }
+
+ @Test
+ public void testUintConstMinValue()
+ {
+ IVariableNode node = getVariable("var a:Number = uint.MIN_VALUE");
+ asBlockWalker.visitVariable(node);
+ assertOut("var /** @type {number} */ a = 0");
+ }
+
+ @Test
+ public void testDateGetMinutes()
+ {
+ IVariableNode node = getVariable("var a:Date = new Date(); var b:Number = a.minutes");
+ node = (IVariableNode)(node.getParent().getChild(1));
+ asBlockWalker.visitVariable(node);
+ assertOut("var /** @type {number} */ b = a.getMinutes()");
+ }
+
+ @Test
+ public void testDateSetMinutes()
+ {
+ IBinaryOperatorNode node = getBinaryNode("var a:Date = new Date(); a.minutes = 10");
+ asBlockWalker.visitBinaryOperator(node);
+ assertOut("a.setMinutes(10, a.getSeconds(), a.getMilliseconds())");
+ }
+
+ @Test
+ public void testDateGetMinutesMethod()
+ {
+ IVariableNode node = getVariable("var a:Date = new Date(); var b:Number = a.getMinutes()");
+ node = (IVariableNode)(node.getParent().getChild(1));
+ asBlockWalker.visitVariable(node);
+ assertOut("var /** @type {number} */ b = a.getMinutes()");
+ }
+
+ @Test
+ public void testDateSetMinutesMethod()
+ {
+ IBinaryOperatorNode node = getBinaryNode("var a:Date = new Date(); a.setMinutes(10, 0, 0)");
+ IFunctionCallNode parentNode = (IFunctionCallNode)(node.getParent());
+ asBlockWalker.visitFunctionCall(parentNode);
+ assertOut("a.setMinutes(10, 0, 0)");
+ }
+
@Override
@Test
public void testVector()
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/8e270130/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/flexjs/JSFlexJSEmitter.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/flexjs/JSFlexJSEmitter.java b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/flexjs/JSFlexJSEmitter.java
index 72a59f1..de50ace 100644
--- a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/flexjs/JSFlexJSEmitter.java
+++ b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/flexjs/JSFlexJSEmitter.java
@@ -53,6 +53,7 @@ import org.apache.flex.compiler.internal.codegen.js.jx.SelfReferenceEmitter;
import org.apache.flex.compiler.internal.codegen.js.jx.SuperCallEmitter;
import org.apache.flex.compiler.internal.codegen.js.jx.VarDeclarationEmitter;
import org.apache.flex.compiler.internal.codegen.mxml.flexjs.MXMLFlexJSEmitter;
+import org.apache.flex.compiler.internal.definitions.AccessorDefinition;
import org.apache.flex.compiler.internal.projects.FlexJSProject;
import org.apache.flex.compiler.internal.projects.FlexProject;
import org.apache.flex.compiler.internal.tree.as.BinaryOperatorAsNode;
@@ -62,6 +63,7 @@ import org.apache.flex.compiler.internal.tree.as.FunctionCallNode;
import org.apache.flex.compiler.internal.tree.as.IdentifierNode;
import org.apache.flex.compiler.internal.tree.as.LabeledStatementNode;
import org.apache.flex.compiler.internal.tree.as.MemberAccessExpressionNode;
+import org.apache.flex.compiler.internal.tree.as.NumericLiteralNode;
import org.apache.flex.compiler.projects.ICompilerProject;
import org.apache.flex.compiler.tree.ASTNodeID;
import org.apache.flex.compiler.tree.as.IASNode;
@@ -508,6 +510,52 @@ public class JSFlexJSEmitter extends JSGoogEmitter implements IJSFlexJSEmitter
}
@Override
+ public void walkArguments(IExpressionNode[] nodes)
+ {
+ if (nodes.length == 2)
+ {
+ ICompilerProject project = getWalker().getProject();;
+ IFunctionCallNode fcNode = (IFunctionCallNode)(nodes[0].getParent().getParent());
+ IExpressionNode nameNode = fcNode.getNameNode();
+ IDefinition def = nameNode.resolve(project);
+ if (def != null && def.getBaseName().equals("insertAt"))
+ {
+ if (def.getParent() != null &&
+ def.getParent().getQualifiedName().equals("Array"))
+ {
+ if (nameNode instanceof MemberAccessExpressionNode)
+ {
+ IExpressionNode[] newArgs = new IExpressionNode[3];
+ newArgs[0] = nodes[0];
+ newArgs[2] = nodes[1];
+ newArgs[1] = new NumericLiteralNode("0");
+ nodes = newArgs;
+ }
+ }
+ }
+ }
+ super.walkArguments(nodes);
+ if (nodes.length == 1)
+ {
+ ICompilerProject project = getWalker().getProject();;
+ IFunctionCallNode fcNode = (IFunctionCallNode)(nodes[0].getParent().getParent());
+ IExpressionNode nameNode = fcNode.getNameNode();
+ IDefinition def = nameNode.resolve(project);
+ if (def != null && def.getBaseName().equals("removeAt"))
+ {
+ if (def.getParent() != null &&
+ def.getParent().getQualifiedName().equals("Array"))
+ {
+ if (nameNode instanceof MemberAccessExpressionNode)
+ {
+ write(", 1");
+ }
+ }
+ }
+ }
+ }
+
+ @Override
public void emitE4XFilter(IMemberAccessExpressionNode node)
{
getWalker().walk(node.getLeftOperandNode());
@@ -813,6 +861,32 @@ public class JSFlexJSEmitter extends JSGoogEmitter implements IJSFlexJSEmitter
* @param obj
* @return
*/
+ public boolean isDateProperty(IExpressionNode obj)
+ {
+ FlexProject project = (FlexProject)getWalker().getProject();
+ if (obj.getNodeID() == ASTNodeID.MemberAccessExpressionID)
+ {
+ IDefinition leftDef;
+ IExpressionNode leftNode = ((MemberAccessExpressionNode)obj).getLeftOperandNode();
+ IExpressionNode rightNode = ((MemberAccessExpressionNode)obj).getRightOperandNode();
+ leftDef = leftNode.resolveType(project);
+ IDefinition rightDef = rightNode.resolve(project);
+ if (leftDef != null && leftDef.getQualifiedName().equals("Date") && rightDef instanceof AccessorDefinition)
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * resolveType on an XML expression returns null
+ * (see IdentiferNode.resolveType).
+ * So, we have to walk the tree ourselves and resolve
+ * individual pieces.
+ * @param obj
+ * @return
+ */
public boolean isXML(IExpressionNode obj)
{
// See if the left side is XML or XMLList
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/8e270130/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/BinaryOperatorEmitter.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/BinaryOperatorEmitter.java b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/BinaryOperatorEmitter.java
index 03a0f2c..e37f0e1 100644
--- a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/BinaryOperatorEmitter.java
+++ b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/BinaryOperatorEmitter.java
@@ -217,6 +217,11 @@ public class BinaryOperatorEmitter extends JSSubEmitter implements
return;
}
}
+ else if (((JSFlexJSEmitter)getEmitter()).isDateProperty((MemberAccessExpressionNode)leftSide))
+ {
+ specialCaseDate(node, (MemberAccessExpressionNode)leftSide);
+ return;
+ }
}
super_emitBinaryOperator(node);
@@ -368,4 +373,123 @@ public class BinaryOperatorEmitter extends JSSubEmitter implements
if (ASNodeUtils.hasParenOpen(node))
write(ASEmitterTokens.PAREN_CLOSE);
}
+
+ private enum DateProperties
+ {
+ FULLYEAR("fullYear", "setFullYear"),
+ MONTH("month", "setMonth"),
+ DATE("date", "setDate"),
+ FULLYEARUTC("fullYearUTC", "setUTCFullYear"),
+ MONTHUTC("monthUTC", "setUTCMonth"),
+ DATEUTC("dateUTC", "setUTCDate"),
+ HOURS("hours", "setHours"),
+ MINUTES("minutes", "setMinutes"),
+ SECONDS("seconds", "setSeconds"),
+ MILLISECONDS("milliseconds", "setMilliseconds"),
+ HOURSUTC("hoursUTC", "setUTCHours"),
+ MINUTESUTC("minutesUTC", "setUTCMinutes"),
+ SECONDSUTC("secondsUTC", "setUTCSeconds"),
+ MILLISECONDSUTC("millisecondsUTC", "setUTCMilliseconds");
+
+ DateProperties(String value, String functionName)
+ {
+ this.value = value;
+ this.functionName = functionName;
+ }
+
+ private String value;
+ private String functionName;
+
+ public String getFunctionName()
+ {
+ return functionName;
+ }
+ }
+
+ void specialCaseDate(IBinaryOperatorNode node, MemberAccessExpressionNode leftSide)
+ {
+ MemberAccessExpressionNode dateNode = (MemberAccessExpressionNode)leftSide;
+ IIdentifierNode rightSide = (IIdentifierNode)dateNode.getRightOperandNode();
+ getWalker().walk(dateNode.getLeftOperandNode());
+ String rightName = rightSide.getName();
+ DateProperties prop = DateProperties.valueOf(rightName.toUpperCase());
+ write(ASEmitterTokens.MEMBER_ACCESS);
+ write(prop.getFunctionName());
+ write(ASEmitterTokens.PAREN_OPEN);
+ getWalker().walk(node.getRightOperandNode());
+ switch (prop)
+ {
+ case FULLYEAR:
+ write(ASEmitterTokens.COMMA);
+ write(ASEmitterTokens.SPACE);
+ getWalker().walk(dateNode.getLeftOperandNode());
+ write(ASEmitterTokens.MEMBER_ACCESS);
+ write("getMonth()");
+ // fall through
+ case MONTH:
+ write(ASEmitterTokens.COMMA);
+ write(ASEmitterTokens.SPACE);
+ getWalker().walk(dateNode.getLeftOperandNode());
+ write(ASEmitterTokens.MEMBER_ACCESS);
+ write("getDate()");
+ break;
+ case FULLYEARUTC:
+ write(ASEmitterTokens.COMMA);
+ write(ASEmitterTokens.SPACE);
+ getWalker().walk(dateNode.getLeftOperandNode());
+ write(ASEmitterTokens.MEMBER_ACCESS);
+ write("getMonthUTC()");
+ // fall through
+ case MONTHUTC:
+ write(ASEmitterTokens.COMMA);
+ write(ASEmitterTokens.SPACE);
+ getWalker().walk(dateNode.getLeftOperandNode());
+ write(ASEmitterTokens.MEMBER_ACCESS);
+ write("getDateUTC()");
+ break;
+ case HOURS:
+ write(ASEmitterTokens.COMMA);
+ write(ASEmitterTokens.SPACE);
+ getWalker().walk(dateNode.getLeftOperandNode());
+ write(ASEmitterTokens.MEMBER_ACCESS);
+ write("getMinutes()");
+ // fall through
+ case MINUTES:
+ write(ASEmitterTokens.COMMA);
+ write(ASEmitterTokens.SPACE);
+ getWalker().walk(dateNode.getLeftOperandNode());
+ write(ASEmitterTokens.MEMBER_ACCESS);
+ write("getSeconds()");
+ // fall through
+ case SECONDS:
+ write(ASEmitterTokens.COMMA);
+ write(ASEmitterTokens.SPACE);
+ getWalker().walk(dateNode.getLeftOperandNode());
+ write(ASEmitterTokens.MEMBER_ACCESS);
+ write("getMilliseconds()");
+ break;
+ case HOURSUTC:
+ write(ASEmitterTokens.COMMA);
+ write(ASEmitterTokens.SPACE);
+ getWalker().walk(dateNode.getLeftOperandNode());
+ write(ASEmitterTokens.MEMBER_ACCESS);
+ write("getUTCMinutes()");
+ // fall through
+ case MINUTESUTC:
+ write(ASEmitterTokens.COMMA);
+ write(ASEmitterTokens.SPACE);
+ getWalker().walk(dateNode.getLeftOperandNode());
+ write(ASEmitterTokens.MEMBER_ACCESS);
+ write("getUTCSeconds()");
+ // fall through
+ case SECONDSUTC:
+ write(ASEmitterTokens.COMMA);
+ write(ASEmitterTokens.SPACE);
+ getWalker().walk(dateNode.getLeftOperandNode());
+ write(ASEmitterTokens.MEMBER_ACCESS);
+ write("getUTCMilliseconds()");
+ break;
+ }
+ write(ASEmitterTokens.PAREN_CLOSE);
+ }
}
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/8e270130/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/IdentifierEmitter.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/IdentifierEmitter.java b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/IdentifierEmitter.java
index cf1faa5..7d64896 100644
--- a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/IdentifierEmitter.java
+++ b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/IdentifierEmitter.java
@@ -65,6 +65,63 @@ public class IdentifierEmitter extends JSSubEmitter implements
if (nodeDef != null && nodeDef.isStatic())
{
String sname = nodeDef.getParent().getQualifiedName();
+ if (sname.equals("Array"))
+ {
+ String baseName = nodeDef.getBaseName();
+ if (baseName.equals("CASEINSENSITIVE"))
+ {
+ write("1");
+ return;
+ }
+ else if (baseName.equals("DESCENDING"))
+ {
+ write("2");
+ return;
+ }
+ else if (baseName.equals("UNIQUESORT"))
+ {
+ write("4");
+ return;
+ }
+ else if (baseName.equals("RETURNINDEXEDARRAY"))
+ {
+ write("8");
+ return;
+ }
+ else if (baseName.equals("NUMERIC"))
+ {
+ write("16");
+ return;
+ }
+ }
+ else if (sname.equals("int"))
+ {
+ String baseName = nodeDef.getBaseName();
+ if (baseName.equals("MAX_VALUE"))
+ {
+ write("2147483648");
+ return;
+ }
+ else if (baseName.equals("MIN_VALUE"))
+ {
+ write("-2147483648");
+ return;
+ }
+ }
+ else if (sname.equals("uint"))
+ {
+ String baseName = nodeDef.getBaseName();
+ if (baseName.equals("MAX_VALUE"))
+ {
+ write("4294967295");
+ return;
+ }
+ else if (baseName.equals("MIN_VALUE"))
+ {
+ write("0");
+ return;
+ }
+ }
if (sname.length() > 0)
{
write(getEmitter().formatQualifiedName(sname));
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/8e270130/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/MemberAccessEmitter.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/MemberAccessEmitter.java b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/MemberAccessEmitter.java
index df1f00a..2fcc160 100644
--- a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/MemberAccessEmitter.java
+++ b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/MemberAccessEmitter.java
@@ -61,12 +61,12 @@ public class MemberAccessEmitter extends JSSubEmitter implements
IASNode leftNode = node.getLeftOperandNode();
IASNode rightNode = node.getRightOperandNode();
+ JSFlexJSEmitter fjs = (JSFlexJSEmitter)getEmitter();
IDefinition def = node.resolve(getProject());
if (def == null)
{
IASNode parentNode = node.getParent();
// could be XML
- JSFlexJSEmitter fjs = (JSFlexJSEmitter)getEmitter();
boolean isXML = false;
boolean isProxy = false;
if (leftNode instanceof MemberAccessExpressionNode)
@@ -137,6 +137,36 @@ public class MemberAccessEmitter extends JSSubEmitter implements
}
}
}
+ else if (fjs.isDateProperty(node))
+ {
+ writeLeftSide(node, leftNode, rightNode);
+ write(".get");
+ String rightName = ((IIdentifierNode)rightNode).getName();
+ String firstChar = rightName.substring(0, 1);
+ firstChar = firstChar.toUpperCase();
+ rightName = rightName.substring(1);
+ write(firstChar);
+ write(rightName);
+ write(ASEmitterTokens.PAREN_OPEN);
+ write(ASEmitterTokens.PAREN_CLOSE);
+ return;
+ }
+ else if (def.getParent() != null &&
+ def.getParent().getQualifiedName().equals("Array"))
+ {
+ if (def.getBaseName().equals("removeAt"))
+ {
+ writeLeftSide(node, leftNode, rightNode);
+ write(".splice");
+ return;
+ }
+ else if (def.getBaseName().equals("insertAt"))
+ {
+ writeLeftSide(node, leftNode, rightNode);
+ write(".splice");
+ return;
+ }
+ }
boolean isStatic = false;
if (def != null && def.isStatic())
isStatic = true;
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/8e270130/externs/js/missing.js
----------------------------------------------------------------------
diff --git a/externs/js/missing.js b/externs/js/missing.js
index d53e13b..c0241d4 100644
--- a/externs/js/missing.js
+++ b/externs/js/missing.js
@@ -173,3 +173,75 @@ function trace(rest) {}
* @const
*/
var console;
+
+
+/**
+ * @type {number}
+ * @const
+ */
+Array.CASEINSENSITIVE = 1;
+
+/**
+ * @type {number}
+ * @const
+ */
+Array.DESCENDING = 2;
+
+/**
+ * @type {number}
+ * @const
+ */
+Array.UNIQUESORT = 4;
+
+/**
+ * @type {number}
+ * @const
+ */
+Array.RETURNINDEXEDARRAY = 8;
+
+/**
+ * @type {number}
+ * @const
+ */
+Array.NUMERIC = 16;
+
+
+/**
+ * @param {number} index The index.
+ * @param {Object} element The Object.
+ */
+Array.prototype.insertAt = function(index, element) {};
+
+/**
+ * @param {number} index The index.
+ */
+Array.prototype.removeAt = function(index) {};
+
+
+
+/**
+ * @type {number}
+ * @const
+ */
+int.MAX_VALUE = 2147483648;
+
+
+/**
+ * @type {number}
+ * @const
+ */
+int.MIN_VALUE = -2147483648;
+
+
+/**
+ * @type {number}
+ * @const
+ */
+uint.MAX_VALUE = 4294967295;
+
+
+/**
+ * @type {number}
+ * @const
+ */
+uint.MIN_VALUE = 0;
[06/18] git commit: [flex-falcon]
[refs/heads/feature/maven-migration] - Merge remote-tracking branch
'origin/develop' into develop
Posted by cd...@apache.org.
Merge remote-tracking branch 'origin/develop' into develop
Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/c183efe0
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/c183efe0
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/c183efe0
Branch: refs/heads/feature/maven-migration
Commit: c183efe041bed3e23c894e47381c066e981b1cdc
Parents: 03132bc 49c3296
Author: Christofer Dutz <ch...@codecentric.de>
Authored: Thu Mar 10 23:51:46 2016 +0100
Committer: Christofer Dutz <ch...@codecentric.de>
Committed: Thu Mar 10 23:51:46 2016 +0100
----------------------------------------------------------------------
build.xml | 24 ++++++++++-
externs/cordova/build.xml | 42 +++++++++++++++++++
externs/cordova/compile-config.xml | 44 ++++++++++++++++++++
externs/cordova/cordova-compile-config.xml | 39 +++++++++++++++++
.../cordova/externs/cordova_file_plugin-4-11.js | 26 ++++++++++++
externs/js/missing.js | 14 ++++++-
6 files changed, 185 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
[15/18] git commit: [flex-falcon]
[refs/heads/feature/maven-migration] - Streamlined the two EnvProperties -
The one in compiler.tests now contains the missing ASJS property - Moved the
EnvProperties in compiler.jx.tests to be in the same package as the
Posted by cd...@apache.org.
Streamlined the two EnvProperties
- The one in compiler.tests now contains the missing ASJS property
- Moved the EnvProperties in compiler.jx.tests to be in the same package as the one in compiler.tests
- Replaced the code of the EnvProperties in compiler.jx.tests with the one in compiler.tests
Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/3152e676
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/3152e676
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/3152e676
Branch: refs/heads/feature/maven-migration
Commit: 3152e6765f28298d7992d6e9e8391f9a35aeda97
Parents: 1270e03
Author: Christofer Dutz <ch...@codecentric.de>
Authored: Sat Mar 12 12:13:15 2016 +0100
Committer: Christofer Dutz <ch...@codecentric.de>
Committed: Sat Mar 12 12:13:15 2016 +0100
----------------------------------------------------------------------
.../flex/compiler/internal/test/TestBase.java | 2 +-
.../flex/compiler/utils/EnvProperties.java | 146 ------------------
.../org/apache/flex/utils/EnvProperties.java | 149 +++++++++++++++++++
.../org/apache/flex/utils/EnvProperties.java | 12 +-
4 files changed, 161 insertions(+), 148 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/3152e676/compiler.jx.tests/src/org/apache/flex/compiler/internal/test/TestBase.java
----------------------------------------------------------------------
diff --git a/compiler.jx.tests/src/org/apache/flex/compiler/internal/test/TestBase.java b/compiler.jx.tests/src/org/apache/flex/compiler/internal/test/TestBase.java
index edaa29f..f54a8cd 100644
--- a/compiler.jx.tests/src/org/apache/flex/compiler/internal/test/TestBase.java
+++ b/compiler.jx.tests/src/org/apache/flex/compiler/internal/test/TestBase.java
@@ -60,7 +60,7 @@ import org.apache.flex.compiler.tree.as.IASNode;
import org.apache.flex.compiler.tree.as.IFileNode;
import org.apache.flex.compiler.tree.mxml.IMXMLFileNode;
import org.apache.flex.compiler.units.ICompilationUnit;
-import org.apache.flex.compiler.utils.EnvProperties;
+import org.apache.flex.utils.EnvProperties;
import org.apache.flex.compiler.visitor.as.IASBlockWalker;
import org.apache.flex.compiler.visitor.mxml.IMXMLBlockWalker;
import org.apache.flex.utils.FilenameNormalization;
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/3152e676/compiler.jx.tests/src/org/apache/flex/compiler/utils/EnvProperties.java
----------------------------------------------------------------------
diff --git a/compiler.jx.tests/src/org/apache/flex/compiler/utils/EnvProperties.java b/compiler.jx.tests/src/org/apache/flex/compiler/utils/EnvProperties.java
deleted file mode 100644
index cbb1497..0000000
--- a/compiler.jx.tests/src/org/apache/flex/compiler/utils/EnvProperties.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-package org.apache.flex.compiler.utils;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.util.Properties;
-
-import org.apache.flex.utils.FilenameNormalization;
-
-/**
- * EnvProperties checks in following order for a value.
- *
- * 1) unittest.properties 2) environment variables 3) for key FLEX_HOME &
- * PLAYERGLOBAL_HOME sets a default value.
- */
-public class EnvProperties
-{
-
- /**
- * FLEX_HOME
- */
- public String SDK;
-
- /**
- * PLAYERGLOBAL_HOME
- */
- public String FPSDK;
-
- /**
- * AIR_HOME
- */
- public String AIRSDK;
-
- /**
- * FLASHPLAYER_DEBUGGER
- */
- public String FDBG;
-
- /**
- * ASJS_HOME
- */
- public String ASJS;
-
- /**
- * PLAYERGLOBAL_VERSION
- */
- public String FPVER;
-
- private static EnvProperties env;
-
- public static EnvProperties initiate()
- {
- if (env == null)
- {
- env = new EnvProperties();
- env.setup();
- }
- return env;
- }
-
- private void setup()
- {
- String prefix = "";
- Properties p = new Properties();
- String envFileName = FilenameNormalization
- .normalize("../env.properties");
- try {
- File f = new File(envFileName);
- if (f.exists())
- {
- p.load(new FileInputStream( f ));
- prefix = "env.";
- }
- } catch (FileNotFoundException e) {
- System.out.println(envFileName + " not found");
- try {
- File f = new File("unittest.properties");
- p.load(new FileInputStream( f ));
- } catch (FileNotFoundException e1) {
- System.out.println("unittest.properties not found");
- } catch (IOException e1) {
- }
- } catch (IOException e) {
- }
-
- SDK = p.getProperty(prefix + "FLEX_HOME", System.getenv("FLEX_HOME"));
- if (SDK == null)
- {
- SDK = FilenameNormalization
- .normalize("../../flex-sdk");
- File mxmlc = new File(SDK + "/lib/mxmlc.jar");
- if (!mxmlc.exists())
- SDK = FilenameNormalization
- .normalize("../compiler/generated/dist/sdk");
- }
- System.out.println("environment property - FLEX_HOME = " + SDK);
-
- FPSDK = p.getProperty(prefix + "PLAYERGLOBAL_HOME",
- System.getenv("PLAYERGLOBAL_HOME"));
- if (FPSDK == null)
- FPSDK = FilenameNormalization
- .normalize("../compiler/generated/dist/sdk/frameworks/libs/player");
- System.out.println("environment property - PLAYERGLOBAL_HOME = "
- + FPSDK);
-
- FPVER = p.getProperty(prefix + "PLAYERGLOBAL_VERSION", System.getenv("PLAYERGLOBAL_VERSION"));
- if (FPVER == null)
- FPVER = "11.1";
- System.out.println("environment property - PLAYERGLOBAL_VERSION = " + FPVER);
-
- AIRSDK = p.getProperty(prefix + "AIR_HOME", System.getenv("AIR_HOME"));
- System.out.println("environment property - AIR_HOME = " + AIRSDK);
-
- FDBG = p.getProperty("FLASHPLAYER_DEBUGGER",
- System.getenv("FLASHPLAYER_DEBUGGER"));
- System.out.println("environment property - FLASHPLAYER_DEBUGGER = "
- + FDBG);
-
- ASJS = p.getProperty(prefix + "ASJS_HOME", System.getenv("ASJS_HOME"));
- if (ASJS == null)
- ASJS = FilenameNormalization
- .normalize("../../flex-asjs");
- System.out.println("environment property - ASJS_HOME = " + ASJS);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/3152e676/compiler.jx.tests/src/org/apache/flex/utils/EnvProperties.java
----------------------------------------------------------------------
diff --git a/compiler.jx.tests/src/org/apache/flex/utils/EnvProperties.java b/compiler.jx.tests/src/org/apache/flex/utils/EnvProperties.java
new file mode 100644
index 0000000..97d4835
--- /dev/null
+++ b/compiler.jx.tests/src/org/apache/flex/utils/EnvProperties.java
@@ -0,0 +1,149 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.flex.utils;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.util.Properties;
+
+
+/**
+ * EnvProperties checks in following order for a value.
+ *
+ * 1) unittest.properties
+ * 2) environment variables
+ * 3) for key FLEX_HOME & PLAYERGLOBAL_HOME sets a default value.
+ */
+public class EnvProperties {
+
+ /**
+ * FLEX_HOME
+ */
+ public String SDK;
+
+ /**
+ * TLF_HOME
+ */
+ public String TLF;
+
+ /**
+ * PLAYERGLOBAL_HOME
+ */
+ public String FPSDK;
+
+ /**
+ * AIR_HOME
+ */
+ public String AIRSDK;
+
+ /**
+ * FLASHPLAYER_DEBUGGER
+ */
+ public String FDBG;
+
+ /**
+ * ASJS_HOME
+ */
+ public String ASJS;
+
+ /**
+ * PLAYERGLOBAL_VERSION
+ */
+ public String FPVER;
+
+
+ private static EnvProperties env;
+
+ public static EnvProperties initiate() {
+ if(env == null) {
+ env = new EnvProperties();
+ env.setup();
+ }
+ return env;
+ }
+
+ private void setup()
+ {
+ String prefix = "";
+ Properties p = new Properties();
+ String envFileName = FilenameNormalization.normalize("../env.properties");
+ try {
+ File f = new File(envFileName);
+ if (f.exists())
+ {
+ p.load(new FileInputStream( f ));
+ prefix = "env.";
+ }
+ } catch (FileNotFoundException e) {
+ System.out.println(envFileName + " not found");
+ try {
+ File f = new File("unittest.properties");
+ p.load(new FileInputStream( f ));
+ } catch (FileNotFoundException e1) {
+ System.out.println("unittest.properties not found");
+ } catch (IOException e1) {
+ // Ignore
+ }
+ } catch (IOException e) {
+ // Ignore
+ }
+
+ SDK = p.getProperty(prefix + "FLEX_HOME", System.getenv("FLEX_HOME"));
+ if(SDK == null)
+ {
+ SDK = FilenameNormalization.normalize("../../flex-sdk");
+ File mxmlc = new File(SDK + "/lib/mxmlc.jar");
+ if (!mxmlc.exists())
+ SDK = FilenameNormalization.normalize("../compiler/generated/dist/sdk");
+ }
+ System.out.println("environment property - FLEX_HOME = " + SDK);
+
+ FPSDK = p.getProperty(prefix + "PLAYERGLOBAL_HOME", System.getenv("PLAYERGLOBAL_HOME"));
+ if(FPSDK == null)
+ FPSDK = FilenameNormalization.normalize("../compiler/generated/dist/sdk/frameworks/libs/player");
+ System.out.println("environment property - PLAYERGLOBAL_HOME = " + FPSDK);
+
+ FPVER = p.getProperty(prefix + "PLAYERGLOBAL_VERSION", System.getenv("PLAYERGLOBAL_VERSION"));
+ if (FPVER == null)
+ FPVER = "11.1";
+ System.out.println("environment property - PLAYERGLOBAL_VERSION = " + FPVER);
+
+ TLF = p.getProperty(prefix + "TLF_HOME", System.getenv("TLF_HOME"));
+ if (TLF == null)
+ {
+ TLF = FilenameNormalization.normalize("../../flex-tlf");
+ }
+ System.out.println("environment property - TLF_HOME = " + TLF);
+
+ AIRSDK = p.getProperty(prefix + "AIR_HOME", System.getenv("AIR_HOME"));
+ System.out.println("environment property - AIR_HOME = " + AIRSDK);
+
+ FDBG = p.getProperty(prefix + "FLASHPLAYER_DEBUGGER", System.getenv("FLASHPLAYER_DEBUGGER"));
+ System.out.println("environment property - FLASHPLAYER_DEBUGGER = " + FDBG);
+
+ ASJS = p.getProperty(prefix + "ASJS_HOME", System.getenv("ASJS_HOME"));
+ if (ASJS == null)
+ ASJS = FilenameNormalization.normalize("../../flex-asjs");
+ System.out.println("environment property - ASJS_HOME = " + ASJS);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/3152e676/compiler.tests/src/org/apache/flex/utils/EnvProperties.java
----------------------------------------------------------------------
diff --git a/compiler.tests/src/org/apache/flex/utils/EnvProperties.java b/compiler.tests/src/org/apache/flex/utils/EnvProperties.java
index b204b1b..be22fee 100644
--- a/compiler.tests/src/org/apache/flex/utils/EnvProperties.java
+++ b/compiler.tests/src/org/apache/flex/utils/EnvProperties.java
@@ -61,6 +61,11 @@ public class EnvProperties {
public String FDBG;
/**
+ * ASJS_HOME
+ */
+ public String ASJS;
+
+ /**
* PLAYERGLOBAL_VERSION
*/
public String FPVER;
@@ -131,9 +136,14 @@ public class EnvProperties {
AIRSDK = p.getProperty(prefix + "AIR_HOME", System.getenv("AIR_HOME"));
System.out.println("environment property - AIR_HOME = " + AIRSDK);
-
+
FDBG = p.getProperty(prefix + "FLASHPLAYER_DEBUGGER", System.getenv("FLASHPLAYER_DEBUGGER"));
System.out.println("environment property - FLASHPLAYER_DEBUGGER = " + FDBG);
+
+ ASJS = p.getProperty(prefix + "ASJS_HOME", System.getenv("ASJS_HOME"));
+ if (ASJS == null)
+ ASJS = FilenameNormalization.normalize("../../flex-asjs");
+ System.out.println("environment property - ASJS_HOME = " + ASJS);
}
}
[16/18] git commit: [flex-falcon]
[refs/heads/feature/maven-migration] - Adjusted the tesst in
compiler.jx.tests to make use of the test-adapters introduced to
compiler.tests
Posted by cd...@apache.org.
Adjusted the tesst in compiler.jx.tests to make use of the test-adapters introduced to compiler.tests
Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/ea7610bd
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/ea7610bd
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/ea7610bd
Branch: refs/heads/feature/maven-migration
Commit: ea7610bdad966a411e2b096e904069dfb260712f
Parents: 3152e67
Author: Christofer Dutz <ch...@codecentric.de>
Authored: Sat Mar 12 12:57:46 2016 +0100
Committer: Christofer Dutz <ch...@codecentric.de>
Committed: Sat Mar 12 12:57:46 2016 +0100
----------------------------------------------------------------------
compiler.jx.tests/build.xml | 5 ++
.../codegen/externals/ExternalsTestBase.java | 5 +-
.../codegen/js/flexjs/TestFlexJSFile.java | 15 +++--
.../codegen/js/flexjs/TestFlexJSProject.java | 71 ++++++++++----------
.../codegen/js/goog/TestGoogProject.java | 26 ++++---
.../codegen/js/vf2js/TestVF2JSFile.java | 9 +--
.../codegen/js/vf2js/TestVF2JSProject.java | 13 ++--
.../mxml/vf2js/TestVF2JSMXMLApplication.java | 9 ++-
.../compiler/internal/test/AMDTestBase.java | 4 +-
.../flex/compiler/internal/test/TestBase.java | 23 +++----
.../internal/test/VF2JSMXMLTestBase.java | 6 +-
11 files changed, 97 insertions(+), 89 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/ea7610bd/compiler.jx.tests/build.xml
----------------------------------------------------------------------
diff --git a/compiler.jx.tests/build.xml b/compiler.jx.tests/build.xml
index 83aa8ef..4f07725 100644
--- a/compiler.jx.tests/build.xml
+++ b/compiler.jx.tests/build.xml
@@ -48,6 +48,7 @@
<src path="${compiler.tests}/src"/>
<compilerarg value="-Xlint:all,-path"/>
<classpath>
+ <pathelement location="${compiler.tests}/../compiler.tests/classes"/>
<fileset dir="${compiler}/lib" includes="**/*.jar"/>
<fileset dir="${compiler.tests}/lib" includes="**/*.jar"/>
</classpath>
@@ -64,6 +65,7 @@
failureproperty="tests.unit.failed">
<classpath>
<pathelement location="${compiler.tests}/classes"/>
+ <pathelement location="${compiler.tests}/../compiler.tests/classes"/>
<fileset dir="${compiler}/lib" includes="**/*.jar"/>
<fileset dir="${compiler.tests}/lib" includes="**/*.jar"/>
</classpath>
@@ -90,6 +92,7 @@
failureproperty="tests.unit.failed">
<classpath>
<pathelement location="${compiler.tests}/classes"/>
+ <pathelement location="${compiler.tests}/../compiler.tests/classes"/>
<fileset dir="${compiler}/lib" includes="**/*.jar"/>
<fileset dir="${compiler.tests}/lib" includes="**/*.jar"/>
</classpath>
@@ -113,6 +116,7 @@
failureproperty="tests.unit.failed">
<classpath>
<pathelement location="${compiler.tests}/classes"/>
+ <pathelement location="${compiler.tests}/../compiler.tests/classes"/>
<fileset dir="${compiler}/lib" includes="**/*.jar"/>
<fileset dir="${compiler.tests}/lib" includes="**/*.jar"/>
</classpath>
@@ -136,6 +140,7 @@
failureproperty="tests.unit.failed">
<classpath>
<pathelement location="${compiler.tests}/classes"/>
+ <pathelement location="${compiler.tests}/../compiler.tests/classes"/>
<fileset dir="${compiler}/lib" includes="**/*.jar"/>
<fileset dir="${compiler.tests}/lib" includes="**/*.jar"/>
</classpath>
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/ea7610bd/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/externals/ExternalsTestBase.java
----------------------------------------------------------------------
diff --git a/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/externals/ExternalsTestBase.java b/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/externals/ExternalsTestBase.java
index cfb088f..c1526c0 100644
--- a/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/externals/ExternalsTestBase.java
+++ b/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/externals/ExternalsTestBase.java
@@ -28,7 +28,7 @@ import org.apache.flex.compiler.clients.EXTERNC;
import org.apache.flex.compiler.clients.ExternCConfiguration;
import org.apache.flex.compiler.internal.codegen.externals.reference.MethodReference;
import org.apache.flex.compiler.internal.codegen.externals.reference.ReferenceModel;
-import org.apache.flex.utils.FilenameNormalization;
+import org.apache.flex.utils.TestAdapterFactory;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
@@ -38,7 +38,8 @@ import com.google.javascript.rhino.jstype.JSType;
public abstract class ExternalsTestBase
{
- private static File unitTestBaseDir = new File(FilenameNormalization.normalize("test-files/externals_unit_tests"));
+ private static File unitTestBaseDir =
+ new File(TestAdapterFactory.getTestAdapter().getUnitTestBaseDir(), "externals_unit_tests");
// Only used for testing, all configuration must happen in configure()
protected ExternCConfiguration config;
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/ea7610bd/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSFile.java
----------------------------------------------------------------------
diff --git a/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSFile.java b/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSFile.java
index 892bddd..3e72c22 100644
--- a/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSFile.java
+++ b/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSFile.java
@@ -27,6 +27,7 @@ import org.apache.flex.compiler.internal.driver.js.goog.JSGoogConfiguration;
import org.apache.flex.compiler.internal.projects.FlexJSProject;
import org.apache.flex.compiler.internal.test.FlexJSTestBase;
import org.apache.flex.compiler.tree.as.IFileNode;
+import org.apache.flex.utils.TestAdapterFactory;
import org.junit.Test;
/**
@@ -50,8 +51,8 @@ public class TestFlexJSFile extends FlexJSTestBase
String fileName = "LocalFunction";
IFileNode node = compileAS(fileName, true,
- "test-files"
- + File.separator + "flexjs" + File.separator + "files",
+ new File(TestAdapterFactory.getTestAdapter().getUnitTestBaseDir(),
+ "flexjs/files").getPath(),
false);
asBlockWalker.visitFile(node);
@@ -68,8 +69,8 @@ public class TestFlexJSFile extends FlexJSTestBase
String fileName = "controllers/MyController";
IFileNode node = compileAS(fileName, true,
- "test-files"
- + File.separator + "flexjs" + File.separator + "files",
+ new File(TestAdapterFactory.getTestAdapter().getUnitTestBaseDir(),
+ "flexjs/files").getPath(),
false);
asBlockWalker.visitFile(node);
@@ -85,8 +86,10 @@ public class TestFlexJSFile extends FlexJSTestBase
{
String fileName = "models/MyModel";
- IFileNode node = compileAS(fileName, true, "test-files"
- + File.separator + "flexjs" + File.separator + "files", false);
+ IFileNode node = compileAS(fileName, true,
+ new File(TestAdapterFactory.getTestAdapter().getUnitTestBaseDir(),
+ "flexjs/files").getPath(),
+ false);
asBlockWalker.visitFile(node);
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/ea7610bd/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSProject.java
----------------------------------------------------------------------
diff --git a/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSProject.java b/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSProject.java
index 2b45164..a82736c 100644
--- a/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSProject.java
+++ b/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSProject.java
@@ -33,6 +33,7 @@ import org.apache.flex.compiler.internal.driver.js.flexjs.FlexJSBackend;
import org.apache.flex.compiler.internal.driver.js.goog.JSGoogConfiguration;
import org.apache.flex.compiler.internal.projects.FlexJSProject;
import org.apache.flex.utils.FilenameNormalization;
+import org.apache.flex.utils.TestAdapterFactory;
import org.junit.Ignore;
import org.junit.Test;
@@ -71,8 +72,8 @@ public class TestFlexJSProject extends TestGoogProject
String fileName = "Test";
- sourcePath = "test-files"
- + File.separator + projectDirPath + "/interfaces";
+ sourcePath = new File(TestAdapterFactory.getTestAdapter().getUnitTestBaseDir(),
+ projectDirPath + "/interfaces").getPath();
List<String> compiledFileNames = compileProject(fileName, testDirPath);
@@ -86,9 +87,9 @@ public class TestFlexJSProject extends TestGoogProject
String fileName = "Base";
- sourcePath = "test-files"
- + File.separator + projectDirPath + "/super";
-
+ sourcePath = new File(TestAdapterFactory.getTestAdapter().getUnitTestBaseDir(),
+ projectDirPath + "/super").getPath();
+
List<String> compiledFileNames = compileProject(fileName, testDirPath);
assertProjectOut(compiledFileNames, testDirPath);
@@ -101,9 +102,9 @@ public class TestFlexJSProject extends TestGoogProject
String fileName = "MainClass";
- sourcePath = "test-files"
- + File.separator + projectDirPath + "/internal";
-
+ sourcePath = new File(TestAdapterFactory.getTestAdapter().getUnitTestBaseDir(),
+ projectDirPath + "/internal").getPath();
+
List<String> compiledFileNames = compileProject(fileName, testDirPath);
assertProjectOut(compiledFileNames, testDirPath);
@@ -116,9 +117,9 @@ public class TestFlexJSProject extends TestGoogProject
String fileName = "Base";
- sourcePath = "test-files"
- + File.separator + projectDirPath + "/circular";
-
+ sourcePath = new File(TestAdapterFactory.getTestAdapter().getUnitTestBaseDir(),
+ projectDirPath + "/circular").getPath();
+
List<String> compiledFileNames = compileProject(fileName, testDirPath);
assertProjectOut(compiledFileNames, testDirPath);
@@ -132,10 +133,10 @@ public class TestFlexJSProject extends TestGoogProject
String fileName = "AmbiguousDefinition";
externs.add("Event");
-
- sourcePath = "test-files"
- + File.separator + projectDirPath + "/package_conflicts_ambiguous_definition";
-
+
+ sourcePath = new File(TestAdapterFactory.getTestAdapter().getUnitTestBaseDir(),
+ projectDirPath + "/package_conflicts_ambiguous_definition").getPath();
+
StringBuilder sb = new StringBuilder();
compileProject(fileName, testDirPath, sb, false);
@@ -155,10 +156,10 @@ public class TestFlexJSProject extends TestGoogProject
String fileName = "SamePackageAsConflict";
externs.add("Event");
-
- sourcePath = "test-files"
- + File.separator + projectDirPath + "/package_conflicts_same_package_as_conflict";
-
+
+ sourcePath = new File(TestAdapterFactory.getTestAdapter().getUnitTestBaseDir(),
+ projectDirPath + "/package_conflicts_same_package_as_conflict").getPath();
+
List<String> compiledFileNames = compileProject(fileName, testDirPath);
externs.clear();
@@ -174,10 +175,10 @@ public class TestFlexJSProject extends TestGoogProject
String fileName = "DifferentPackageAsConflict";
externs.add("Event");
-
- sourcePath = "test-files"
- + File.separator + projectDirPath + "/package_conflicts_different_package_as_conflict";
-
+
+ sourcePath = new File(TestAdapterFactory.getTestAdapter().getUnitTestBaseDir(),
+ projectDirPath + "/package_conflicts_different_package_as_conflict").getPath();
+
List<String> compiledFileNames = compileProject(fileName, testDirPath);
externs.clear();
@@ -193,10 +194,10 @@ public class TestFlexJSProject extends TestGoogProject
String fileName = "UseWindow";
externs.add("Event");
-
- sourcePath = "test-files"
- + File.separator + projectDirPath + "/package_conflicts_use_window";
-
+
+ sourcePath = new File(TestAdapterFactory.getTestAdapter().getUnitTestBaseDir(),
+ projectDirPath + "/package_conflicts_use_window").getPath();
+
List<String> compiledFileNames = compileProject(fileName, testDirPath);
externs.clear();
@@ -212,10 +213,10 @@ public class TestFlexJSProject extends TestGoogProject
String fileName = "NoConflictNoWindow";
externs.add("Event");
-
- sourcePath = "test-files"
- + File.separator + projectDirPath + "/package_conflicts_no_conflict_no_window";
-
+
+ sourcePath = new File(TestAdapterFactory.getTestAdapter().getUnitTestBaseDir(),
+ projectDirPath + "/package_conflicts_no_conflict_no_window").getPath();
+
List<String> compiledFileNames = compileProject(fileName, testDirPath);
externs.clear();
@@ -231,10 +232,10 @@ public class TestFlexJSProject extends TestGoogProject
String fileName = "NoConflictUseWindow";
externs.add("Event");
-
- sourcePath = "test-files"
- + File.separator + projectDirPath + "/package_conflicts_no_conflict_use_window";
-
+
+ sourcePath = new File(TestAdapterFactory.getTestAdapter().getUnitTestBaseDir(),
+ projectDirPath + "/package_conflicts_no_conflict_use_window").getPath();
+
List<String> compiledFileNames = compileProject(fileName, testDirPath);
externs.clear();
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/ea7610bd/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/goog/TestGoogProject.java
----------------------------------------------------------------------
diff --git a/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/goog/TestGoogProject.java b/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/goog/TestGoogProject.java
index 5339554..c79e967 100644
--- a/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/goog/TestGoogProject.java
+++ b/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/goog/TestGoogProject.java
@@ -19,18 +19,18 @@
package org.apache.flex.compiler.internal.codegen.js.goog;
-import static org.hamcrest.core.Is.is;
-import static org.junit.Assert.assertThat;
-
-import java.io.File;
-import java.util.List;
-
import org.apache.flex.compiler.driver.IBackend;
import org.apache.flex.compiler.internal.driver.js.goog.GoogBackend;
import org.apache.flex.compiler.internal.test.ASTestBase;
-import org.apache.flex.utils.FilenameNormalization;
+import org.apache.flex.utils.TestAdapterFactory;
import org.junit.Test;
+import java.io.File;
+import java.util.List;
+
+import static org.hamcrest.core.Is.is;
+import static org.junit.Assert.assertThat;
+
/**
* This class tests the production of valid 'goog' JS code from an external
* project.
@@ -57,8 +57,8 @@ public class TestGoogProject extends ASTestBase
@Override
protected void addSourcePaths(List<File> sourcePaths)
{
- sourcePaths.add(new File(FilenameNormalization.normalize("test-files"
- + File.separator + projectDirPath + "/imports")));
+ sourcePaths.add(new File(TestAdapterFactory.getTestAdapter().getUnitTestBaseDir(),
+ projectDirPath + "/imports"));
super.addSourcePaths(sourcePaths);
}
@@ -86,11 +86,9 @@ public class TestGoogProject extends ASTestBase
String compiledResult = readCodeFile(new File(compiledFilePath));
//System.out.println(compiledResult);
-
- String expectedFilePath = new File("test-files").getAbsolutePath()
- + File.separator + testDirPath + File.separator
- + compiledFileName + "_result" + "."
- + backend.getOutputExtension();
+
+ String expectedFilePath = new File(TestAdapterFactory.getTestAdapter().getUnitTestBaseDir(),
+ testDirPath + "/" + compiledFileName + "_result" + "." + backend.getOutputExtension()).getPath();
String expectedResult = readCodeFile(new File(expectedFilePath));
assertThat(compiledResult, is(expectedResult));
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/ea7610bd/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/vf2js/TestVF2JSFile.java
----------------------------------------------------------------------
diff --git a/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/vf2js/TestVF2JSFile.java b/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/vf2js/TestVF2JSFile.java
index 56bb290..5c1c913 100644
--- a/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/vf2js/TestVF2JSFile.java
+++ b/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/vf2js/TestVF2JSFile.java
@@ -27,6 +27,7 @@ import org.apache.flex.compiler.internal.driver.js.vf2js.VF2JSBackend;
import org.apache.flex.compiler.internal.test.VF2JSTestBase;
import org.apache.flex.compiler.tree.as.IFileNode;
import org.apache.flex.utils.FilenameNormalization;
+import org.apache.flex.utils.TestAdapterFactory;
import org.junit.Ignore;
import org.junit.Test;
@@ -45,8 +46,8 @@ public class TestVF2JSFile extends VF2JSTestBase
String fileName = "SimpleAS";
IFileNode node = compileAS(fileName, true,
- "test-files"
- + File.separator + "vf2js" + File.separator + "files",
+ new File(TestAdapterFactory.getTestAdapter().getUnitTestBaseDir(),
+ "vf2js/files").getPath(),
false);
asBlockWalker.visitFile(node);
@@ -63,8 +64,8 @@ public class TestVF2JSFile extends VF2JSTestBase
String fileName = "Version";
IFileNode node = compileAS(fileName, true,
- "test-files"
- + File.separator + "vf2js" + File.separator + "files",
+ new File(TestAdapterFactory.getTestAdapter().getUnitTestBaseDir(),
+ "vf2js/files").getPath(),
false);
asBlockWalker.visitFile(node);
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/ea7610bd/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/vf2js/TestVF2JSProject.java
----------------------------------------------------------------------
diff --git a/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/vf2js/TestVF2JSProject.java b/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/vf2js/TestVF2JSProject.java
index d7711d7..ebab98c 100644
--- a/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/vf2js/TestVF2JSProject.java
+++ b/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/vf2js/TestVF2JSProject.java
@@ -27,6 +27,7 @@ import org.apache.flex.compiler.internal.codegen.js.goog.TestGoogProject;
import org.apache.flex.compiler.internal.driver.js.vf2js.VF2JSBackend;
import org.apache.flex.compiler.internal.projects.FlexJSProject;
import org.apache.flex.utils.FilenameNormalization;
+import org.apache.flex.utils.TestAdapterFactory;
import org.junit.Ignore;
import org.junit.Test;
@@ -95,14 +96,14 @@ public class TestVF2JSProject extends TestGoogProject
@Override
protected void addSourcePaths(List<File> sourcePaths)
{
- sourcePaths.add(new File(FilenameNormalization.normalize("test-files"
- + File.separator + projectDirPath + "/interfaces")));
+ sourcePaths.add(new File(TestAdapterFactory.getTestAdapter().getUnitTestBaseDir(),
+ projectDirPath + "/interfaces"));
- sourcePaths.add(new File(FilenameNormalization.normalize("test-files"
- + File.separator + projectDirPath + "/sdk")));
+ sourcePaths.add(new File(TestAdapterFactory.getTestAdapter().getUnitTestBaseDir(),
+ projectDirPath + "/sdk"));
- sourcePaths.add(new File(FilenameNormalization.normalize("test-files"
- + File.separator + projectDirPath + "/super")));
+ sourcePaths.add(new File(TestAdapterFactory.getTestAdapter().getUnitTestBaseDir(),
+ projectDirPath + "/super"));
super.addSourcePaths(sourcePaths);
}
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/ea7610bd/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 086b554..2a5d268 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
@@ -27,6 +27,7 @@ import java.util.List;
import org.apache.flex.compiler.internal.test.VF2JSMXMLTestBase;
import org.apache.flex.compiler.tree.mxml.IMXMLFileNode;
import org.apache.flex.utils.FilenameNormalization;
+import org.apache.flex.utils.TestAdapterFactory;
import org.junit.Test;
public class TestVF2JSMXMLApplication extends VF2JSMXMLTestBase
@@ -84,11 +85,9 @@ public class TestVF2JSMXMLApplication extends VF2JSMXMLTestBase
String compiledResult = readCodeFile(new File(compiledFilePath));
//System.out.println(compiledResult);
-
- String expectedFilePath = new File("test-files").getAbsolutePath()
- + File.separator + testDirPath + File.separator
- + compiledFileName + "_result" + "."
- + backend.getOutputExtension();
+
+ String expectedFilePath = new File(TestAdapterFactory.getTestAdapter().getUnitTestBaseDir(),
+ testDirPath + "/" + compiledFileName + "_result" + "." + backend.getOutputExtension()).getPath();
String expectedResult = readCodeFile(new File(expectedFilePath));
assertThat(compiledResult, is(expectedResult));
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/ea7610bd/compiler.jx.tests/src/org/apache/flex/compiler/internal/test/AMDTestBase.java
----------------------------------------------------------------------
diff --git a/compiler.jx.tests/src/org/apache/flex/compiler/internal/test/AMDTestBase.java b/compiler.jx.tests/src/org/apache/flex/compiler/internal/test/AMDTestBase.java
index 3728b06..faa7ea0 100644
--- a/compiler.jx.tests/src/org/apache/flex/compiler/internal/test/AMDTestBase.java
+++ b/compiler.jx.tests/src/org/apache/flex/compiler/internal/test/AMDTestBase.java
@@ -34,6 +34,7 @@ import org.apache.flex.compiler.tree.as.ISetterNode;
import org.apache.flex.compiler.tree.as.ITypeNode;
import org.apache.flex.compiler.tree.as.IVariableNode;
import org.apache.flex.utils.FilenameNormalization;
+import org.apache.flex.utils.TestAdapterFactory;
/**
* This class tests the production of AMD JavaScript for AS package.
@@ -58,7 +59,8 @@ public abstract class AMDTestBase extends TestBase
asEmitter = backend.createEmitter(writer);
asBlockWalker = backend.createWalker(project, errors, asEmitter);
- projectPath = "test-files/amd/simple-project/src";
+ projectPath = new File(TestAdapterFactory.getTestAdapter().getUnitTestBaseDir(),
+ "amd/simple-project/src").getPath();
String target = getTypeUnderTest().replace(".", File.separator);
String targetDir = projectPath + File.separator
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/ea7610bd/compiler.jx.tests/src/org/apache/flex/compiler/internal/test/TestBase.java
----------------------------------------------------------------------
diff --git a/compiler.jx.tests/src/org/apache/flex/compiler/internal/test/TestBase.java b/compiler.jx.tests/src/org/apache/flex/compiler/internal/test/TestBase.java
index f54a8cd..d51e7ec 100644
--- a/compiler.jx.tests/src/org/apache/flex/compiler/internal/test/TestBase.java
+++ b/compiler.jx.tests/src/org/apache/flex/compiler/internal/test/TestBase.java
@@ -64,6 +64,7 @@ import org.apache.flex.utils.EnvProperties;
import org.apache.flex.compiler.visitor.as.IASBlockWalker;
import org.apache.flex.compiler.visitor.mxml.IMXMLBlockWalker;
import org.apache.flex.utils.FilenameNormalization;
+import org.apache.flex.utils.TestAdapterFactory;
import org.junit.After;
import org.junit.Before;
import org.junit.Ignore;
@@ -134,7 +135,7 @@ public class TestBase implements ITestBase
libraries = new ArrayList<File>();
namespaceMappings = new ArrayList<IMXMLNamespaceMapping>();
- tempDir = new File(FilenameNormalization.normalize("temp")); // ensure this exists
+ tempDir = new File(TestAdapterFactory.getTestAdapter().getTempDir()); // ensure this exists
}
@After
@@ -215,9 +216,8 @@ public class TestBase implements ITestBase
protected IASNode compile(String input, boolean isFileName,
String inputDir, boolean useTempFile)
{
- File tempFile = (useTempFile) ? writeCodeToTempFile(input, isFileName,
- inputDir) : new File(FilenameNormalization.normalize(inputDir
- + File.separator + input + inputFileExtension));
+ File tempFile = (useTempFile) ? writeCodeToTempFile(input, isFileName, inputDir) :
+ new File(inputDir + "/" + input + inputFileExtension);
addDependencies();
@@ -258,9 +258,8 @@ public class TestBase implements ITestBase
{
List<String> compiledFileNames = new ArrayList<String>();
- String mainFileName = "test-files"
- + File.separator + inputDirName + File.separator
- + inputFileName + inputFileExtension;
+ String mainFileName = new File(TestAdapterFactory.getTestAdapter().getUnitTestBaseDir(),
+ inputDirName + "/" + inputFileName + inputFileExtension).getPath();
addDependencies();
@@ -473,7 +472,7 @@ public class TestBase implements ITestBase
.getSimpleName();
tempASFile = File.createTempFile(tempFileName, inputFileExtension,
- tempDir);
+ new File(TestAdapterFactory.getTestAdapter().getTempDir()));
tempASFile.deleteOnExit();
String code = "";
@@ -559,11 +558,9 @@ public class TestBase implements ITestBase
protected String getCodeFromFile(String fileName, boolean isJS,
String sourceDir)
{
- String testFileDir = FilenameNormalization.normalize("test-files");
-
- File testFile = new File(testFileDir
- + File.separator + sourceDir + File.separator + fileName
- + (isJS ? ".js" : inputFileExtension));
+ File testFile = new File(TestAdapterFactory.getTestAdapter().getUnitTestBaseDir(),
+ sourceDir + "/" + fileName
+ + (isJS ? ".js" : inputFileExtension));
return readCodeFile(testFile);
}
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/ea7610bd/compiler.jx.tests/src/org/apache/flex/compiler/internal/test/VF2JSMXMLTestBase.java
----------------------------------------------------------------------
diff --git a/compiler.jx.tests/src/org/apache/flex/compiler/internal/test/VF2JSMXMLTestBase.java b/compiler.jx.tests/src/org/apache/flex/compiler/internal/test/VF2JSMXMLTestBase.java
index 37b40e9..a421d5e 100644
--- a/compiler.jx.tests/src/org/apache/flex/compiler/internal/test/VF2JSMXMLTestBase.java
+++ b/compiler.jx.tests/src/org/apache/flex/compiler/internal/test/VF2JSMXMLTestBase.java
@@ -36,6 +36,7 @@ import org.apache.flex.compiler.tree.mxml.IMXMLFileNode;
import org.apache.flex.compiler.tree.mxml.IMXMLNode;
import org.apache.flex.compiler.units.ICompilationUnit;
import org.apache.flex.utils.FilenameNormalization;
+import org.apache.flex.utils.TestAdapterFactory;
import org.junit.Ignore;
import com.google.common.collect.ImmutableSet;
@@ -66,9 +67,8 @@ public class VF2JSMXMLTestBase extends MXMLTestBase
{
List<String> compiledFileNames = new ArrayList<String>();
- String mainFileName = "test-files"
- + File.separator + inputDirName + File.separator
- + inputFileName + inputFileExtension;
+ String mainFileName = new File(TestAdapterFactory.getTestAdapter().getUnitTestBaseDir(),
+ inputDirName + "/" + inputFileName + inputFileExtension).getPath();
addDependencies();
[03/18] git commit: [flex-falcon]
[refs/heads/feature/maven-migration] - Added cordova to externs.
Posted by cd...@apache.org.
Added cordova to externs.
Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/8d8b2f2e
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/8d8b2f2e
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/8d8b2f2e
Branch: refs/heads/feature/maven-migration
Commit: 8d8b2f2e92843a2221ceb7f2e00ae84c3f581a09
Parents: 5ff0219
Author: Peter Ent <pe...@apache.org>
Authored: Wed Mar 9 10:53:14 2016 -0500
Committer: Peter Ent <pe...@apache.org>
Committed: Wed Mar 9 10:53:14 2016 -0500
----------------------------------------------------------------------
build.xml | 24 ++++++++++-
externs/cordova/build.xml | 42 +++++++++++++++++++
externs/cordova/compile-config.xml | 44 ++++++++++++++++++++
externs/cordova/cordova-compile-config.xml | 39 +++++++++++++++++
.../cordova/externs/cordova_file_plugin-4-11.js | 26 ++++++++++++
5 files changed, 173 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/8d8b2f2e/build.xml
----------------------------------------------------------------------
diff --git a/build.xml b/build.xml
index ad753f1..75a2c9d 100644
--- a/build.xml
+++ b/build.xml
@@ -581,8 +581,8 @@
</target>
- <target name="extern.swcs" depends="externc.js.swc, externc.jquery.swc, externc.jasmine.swc, externc.GCL.swc, externc.createjs.swc, externc.google_maps.swc, externc.node.swc" />
- <target name="extern.swcs.clean" depends="externc.js.swc.clean, externc.jquery.swc.clean, externc.jasmine.swc.clean, externc.GCL.swc.clean, externc.createjs.swc.clean, externc.google_maps.swc.clean, externc.node.swc.clean" />
+ <target name="extern.swcs" depends="externc.js.swc, externc.cordova.swc, externc.jquery.swc, externc.jasmine.swc, externc.GCL.swc, externc.createjs.swc, externc.google_maps.swc, externc.node.swc" />
+ <target name="extern.swcs.clean" depends="externc.js.swc.clean, externc.cordova.swc.clean, externc.jquery.swc.clean, externc.jasmine.swc.clean, externc.GCL.swc.clean, externc.createjs.swc.clean, externc.google_maps.swc.clean, externc.node.swc.clean" />
<target name="extern.swcs.wipe" depends="extern.swcs.clean" >
<delete failonerror="false" includeEmptyDirs="true" >
<fileset dir="${basedir}/externs/js">
@@ -611,6 +611,9 @@
<target name="externc.js.swc.clean" >
<delete dir="${basedir}/externs/js/out" failonerror="false" includeEmptyDirs="true"/>
</target>
+ <target name="externc.cordova.swc.clean" >
+ <delete dir="${basedir}/externs/cordova/out" failonerror="false" includeEmptyDirs="true"/>
+ </target>
<target name="externc.jquery.swc.clean" >
<delete dir="${basedir}/externs/jquery/out" failonerror="false" includeEmptyDirs="true"/>
</target>
@@ -679,6 +682,22 @@
</java>
</target>
+ <target name="externc.cordova.swc" >
+ <java jar="${basedir}/compiler.jx/lib/externc.jar" fork="true"
+ failonerror="false">
+ <arg value="+flexlib=externs" />
+ <arg value="-debug" />
+ <arg value="-load-config=${basedir}/externs/cordova/cordova-compile-config.xml" />
+ </java>
+ <java jar="${basedir}/compiler/generated/dist/sdk/lib/falcon-compc.jar" fork="true"
+ failonerror="true">
+ <arg value="+flexlib=externs/frameworks" />
+ <arg value="-debug" />
+ <arg value="-load-config=${basedir}/externs/cordova/compile-config.xml" />
+ <arg value="-output=${basedir}/externs/cordova/out/bin/cordova.swc" />
+ </java>
+ </target>
+
<target name="externc.jquery.swc" >
<java jar="${basedir}/compiler.jx/lib/externc.jar" fork="true"
failonerror="false">
@@ -872,6 +891,7 @@
<!-- generated -->
<mkdir dir="${basedir}/temp/js/libs"/>
<copy tofile="${basedir}/temp/js/libs/js.swc" file="${basedir}/externs/js/out/bin/js.swc" />
+ <copy tofile="${basedir}/temp/js/libs/cordova.swc" file="${basedir}/externs/cordova/out/bin/cordova.swc" />
<copy tofile="${basedir}/temp/js/libs/jquery.swc" file="${basedir}/externs/jquery/out/bin/jquery-1.9.swc" />
<copy tofile="${basedir}/temp/js/libs/GCL.swc" file="${basedir}/externs/GCL/out/bin/GCL.swc" />
<copy tofile="${basedir}/temp/js/libs/node.swc" file="${basedir}/externs/node/out/bin/node.swc" />
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/8d8b2f2e/externs/cordova/build.xml
----------------------------------------------------------------------
diff --git a/externs/cordova/build.xml b/externs/cordova/build.xml
new file mode 100644
index 0000000..c95119e
--- /dev/null
+++ b/externs/cordova/build.xml
@@ -0,0 +1,42 @@
+<?xml version="1.0" ?>
+
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+
+<project name="cordova" default="main" basedir=".">
+
+ <property name="cordova.version" value="4.11" />
+
+ <target name="main" depends="preprocess" />
+
+ <!-- we need to insert a line near the beginning of the file to make the
+ compiler happy. -->
+ <target name="preprocess">
+ <antcall target="preprocessfile" >
+ <param name="file" value="cordova_file_plugin-4-11.js" />
+ </antcall>
+ </target>
+
+ <target name="preprocessfile" >
+ <basename property="file.base" file="${file}" suffix=".js"/>
+ <echo>file.base is ${file.base}</echo>
+ <replace file="${basedir}/externs/${file}" token="// Namespace" value="/** @const */" />
+ </target>
+
+</project>
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/8d8b2f2e/externs/cordova/compile-config.xml
----------------------------------------------------------------------
diff --git a/externs/cordova/compile-config.xml b/externs/cordova/compile-config.xml
new file mode 100644
index 0000000..def8957
--- /dev/null
+++ b/externs/cordova/compile-config.xml
@@ -0,0 +1,44 @@
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+<flex-config>
+
+ <compiler>
+ <accessible>true</accessible>
+
+ <external-library-path>
+ <path-element>../js/out/bin/js.swc</path-element>
+ </external-library-path>
+
+ <source-path>
+ <path-element>out/as/constants</path-element>
+ </source-path>
+
+ <warn-no-constructor>false</warn-no-constructor>
+ </compiler>
+
+ <include-sources>
+ <path-element>out/as/constants</path-element>
+ </include-sources>
+
+ <include-file>
+ <name>externs/cordova_file_plugin-4-11.js</name>
+ <path>externs/cordova_file_plugin-4-11.js</path>
+ </include-file>
+
+</flex-config>
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/8d8b2f2e/externs/cordova/cordova-compile-config.xml
----------------------------------------------------------------------
diff --git a/externs/cordova/cordova-compile-config.xml b/externs/cordova/cordova-compile-config.xml
new file mode 100644
index 0000000..d2e3dcb
--- /dev/null
+++ b/externs/cordova/cordova-compile-config.xml
@@ -0,0 +1,39 @@
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License</name></exclude> you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+<flex-config>
+
+ <compiler>
+ <accessible>true</accessible>
+
+ <locale/>
+
+ <source-path>
+ <path-element>src</path-element>
+ </source-path>
+
+ <warn-no-constructor>false</warn-no-constructor>
+ </compiler>
+
+ <external>
+ <path-element>externs/cordova_file_plugin-4-11.js</path-element>
+ </external>
+
+ <as-root>out/as</as-root>
+
+</flex-config>
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/8d8b2f2e/externs/cordova/externs/cordova_file_plugin-4-11.js
----------------------------------------------------------------------
diff --git a/externs/cordova/externs/cordova_file_plugin-4-11.js b/externs/cordova/externs/cordova_file_plugin-4-11.js
new file mode 100644
index 0000000..96c6a5f
--- /dev/null
+++ b/externs/cordova/externs/cordova_file_plugin-4-11.js
@@ -0,0 +1,26 @@
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * @fileoverview Definitions for objects in the Apache Cordova project:
+ * https://cordova.apache.org
+ *
+ * @externs
+ */
+
+
+/**
+ * @type {!Object}
+ * @const
+ */
+var cordova;
[14/18] git commit: [flex-falcon]
[refs/heads/feature/maven-migration] - createjs externs are generated
Posted by cd...@apache.org.
createjs externs are generated
Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/1270e033
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/1270e033
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/1270e033
Branch: refs/heads/feature/maven-migration
Commit: 1270e033fdff9a784c8a0a007d536365ef0c2633
Parents: c4472af
Author: Alex Harui <ah...@apache.org>
Authored: Fri Mar 11 07:57:03 2016 -0800
Committer: Alex Harui <ah...@apache.org>
Committed: Fri Mar 11 08:25:43 2016 -0800
----------------------------------------------------------------------
build.xml | 1 -
1 file changed, 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/1270e033/build.xml
----------------------------------------------------------------------
diff --git a/build.xml b/build.xml
index efa9c1d..87d8a64 100644
--- a/build.xml
+++ b/build.xml
@@ -465,7 +465,6 @@
<include name="**/missing.js"/>
<include name="js/src/**"/>
<include name="cordova/externs/**"/>
- <include name="createjs/externs/**"/>
</fileset>
</copy>
</target>