Repository: flex-falcon
Updated Branches:
  refs/heads/develop 177b2f313 -> b18bda1b5


Externs: created Node externs to support calling require()


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

Branch: refs/heads/develop
Commit: b18bda1b5ad0f77b48923dc220d050af0f69b8fe
Parents: 177b2f3
Author: Josh Tynjala <[email protected]>
Authored: Mon Jan 11 17:09:03 2016 -0800
Committer: Josh Tynjala <[email protected]>
Committed: Mon Jan 11 17:09:03 2016 -0800

----------------------------------------------------------------------
 build.xml                            | 24 +++++++++++++++--
 externs/node/compile-config.xml      | 43 +++++++++++++++++++++++++++++++
 externs/node/externs/node.js         | 30 +++++++++++++++++++++
 externs/node/node-compile-config.xml | 39 ++++++++++++++++++++++++++++
 4 files changed, 134 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/b18bda1b/build.xml
----------------------------------------------------------------------
diff --git a/build.xml b/build.xml
index b751c71..55d9693 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" />
-    <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" />
+    <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.wipe" depends="extern.swcs.clean" >
         <delete failonerror="false" includeEmptyDirs="true" >
             <fileset dir="${basedir}/externs/js">
@@ -626,6 +626,9 @@
     <target name="externc.google_maps.swc.clean" >
         <delete dir="${basedir}/externs/google_maps/out" failonerror="false" 
includeEmptyDirs="true"/>
     </target>
+    <target name="externc.node.swc.clean" >
+        <delete dir="${basedir}/externs/node/out" failonerror="false" 
includeEmptyDirs="true"/>
+    </target>
     
     <target name="externc.js.swc" >
         <java jar="${basedir}/compiler.jx/lib/externc.jar" fork="true"
@@ -761,6 +764,22 @@
         </java>
     </target>
     
+    <target name="externc.node.swc" >
+        <java jar="${basedir}/compiler.jx/lib/externc.jar" fork="true"
+            failonerror="false">
+            <arg value="+flexlib=externs/frameworks" />
+            <arg value="-debug" />
+            <arg 
value="-load-config=${basedir}/externs/node/node-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/node/compile-config.xml" />
+            <arg value="-output=${basedir}/externs/node/out/bin/node.swc" />
+        </java>
+    </target>
+    
     <target name="binary-package"
         description="Package binary files in zip and tar-gzip file.">
         
@@ -851,6 +870,7 @@
         <copy tofile="${basedir}/temp/js/libs/js.swc" 
file="${basedir}/externs/js/out/bin/js.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" />
         
         <!-- generated -->
         <mkdir dir="${basedir}/temp/externs"/>

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/b18bda1b/externs/node/compile-config.xml
----------------------------------------------------------------------
diff --git a/externs/node/compile-config.xml b/externs/node/compile-config.xml
new file mode 100644
index 0000000..66ae820
--- /dev/null
+++ b/externs/node/compile-config.xml
@@ -0,0 +1,43 @@
+<!--
+
+  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/functions</path-element>
+        </source-path>
+        
+        <warn-no-constructor>false</warn-no-constructor>
+    </compiler>
+    
+    <include-sources>
+        <path-element>out/as/functions</path-element>
+    </include-sources>
+
+    <include-file>
+        <name>externs/node.js</name>
+        <path>externs/node.js</path>
+    </include-file>
+</flex-config>

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/b18bda1b/externs/node/externs/node.js
----------------------------------------------------------------------
diff --git a/externs/node/externs/node.js b/externs/node/externs/node.js
new file mode 100644
index 0000000..ebacb75
--- /dev/null
+++ b/externs/node/externs/node.js
@@ -0,0 +1,30 @@
+/*
+ *
+ *  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.
+ *
+ */
+
+/**
+ * @fileoverview Externs for Node.js
+ * @see https://nodejs.org/api/
+ * @externs
+ */
+
+/**
+ * @param {string} id
+ * @return {*}
+ */
+function require(id) {};

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/b18bda1b/externs/node/node-compile-config.xml
----------------------------------------------------------------------
diff --git a/externs/node/node-compile-config.xml 
b/externs/node/node-compile-config.xml
new file mode 100644
index 0000000..e4f88dc
--- /dev/null
+++ b/externs/node/node-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/node.js</path-element>
+    </external>
+    
+    <as-root>out/as</as-root>
+
+</flex-config>

Reply via email to