flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject [3/4] git commit: [flex-asjs] [refs/heads/core_js_to_as] - clean compile of DragDrop
Date Wed, 11 Nov 2015 00:29:58 GMT
clean compile of DragDrop


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

Branch: refs/heads/core_js_to_as
Commit: 0e16bd14a96e3e787c01c3d01e29d9a8f081fa06
Parents: 0640cad
Author: Alex Harui <aharui@apache.org>
Authored: Tue Nov 10 16:26:32 2015 -0800
Committer: Alex Harui <aharui@apache.org>
Committed: Tue Nov 10 16:29:49 2015 -0800

----------------------------------------------------------------------
 .../projects/DragDrop/as/src/DragDropClasses.as |  1 +
 .../as/src/org/apache/flex/events/DragEvent.as  | 10 ++-
 .../src/org/apache/flex/events/DragEventBase.as |  6 +-
 frameworks/projects/DragDrop/build.xml          | 79 ++++++++++++--------
 .../projects/DragDrop/compile-asjs-config.xml   | 12 ++-
 frameworks/projects/DragDrop/compile-config.xml |  6 --
 6 files changed, 65 insertions(+), 49 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/0e16bd14/frameworks/projects/DragDrop/as/src/DragDropClasses.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/DragDrop/as/src/DragDropClasses.as b/frameworks/projects/DragDrop/as/src/DragDropClasses.as
index 7c7152c..14d0b54 100644
--- a/frameworks/projects/DragDrop/as/src/DragDropClasses.as
+++ b/frameworks/projects/DragDrop/as/src/DragDropClasses.as
@@ -27,6 +27,7 @@ package
  */
 internal class DragDropClasses
 {	  
+    import org.apache.flex.core.DropType; DropType;
     import org.apache.flex.events.DragEvent; DragEvent;   
 }
 

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/0e16bd14/frameworks/projects/DragDrop/as/src/org/apache/flex/events/DragEvent.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/DragDrop/as/src/org/apache/flex/events/DragEvent.as b/frameworks/projects/DragDrop/as/src/org/apache/flex/events/DragEvent.as
index 895fb7f..c7dec05 100644
--- a/frameworks/projects/DragDrop/as/src/org/apache/flex/events/DragEvent.as
+++ b/frameworks/projects/DragDrop/as/src/org/apache/flex/events/DragEvent.as
@@ -21,6 +21,8 @@ package org.apache.flex.events
     import org.apache.flex.core.IDragInitiator;
     COMPILE::JS
     {
+        import org.apache.flex.core.IUIBase;
+        import window.Event;
         import window.MouseEvent;
     }
     
@@ -293,6 +295,7 @@ package org.apache.flex.events
          *  @playerversion AIR 2.6
          *  @productversion FlexJS 0.0
          *  @flexjsignorecoercion org.apache.flex.events.DragEvent
+         *  @flexjsignorecoercion window.Event
          */
         public static function createDragEvent(type:String, event:MouseEvent):DragEvent
         {
@@ -312,7 +315,8 @@ package org.apache.flex.events
             COMPILE::JS
             {
                 var out:MouseEvent = new MouseEvent(type);
-                out.initMouseEvent(type, true, true,
+                var e:window.Event = event as window.Event;
+                (out as window.Event).initMouseEvent(type, true, true,
                     e.view, e.detail, e.screenX, e.screenY,
                     e.clientX, e.clientY, e.ctrlKey, e.altKey,
                     e.shiftKey, e.metaKey, e.button, e.relatedTarget);
@@ -331,6 +335,8 @@ package org.apache.flex.events
          *  @playerversion Flash 10.2
          *  @playerversion AIR 2.6
          *  @productversion FlexJS 0.0
+         *  @flexjsignorecoercion org.apache.flex.core.IUIBase
+         *  @flexjsignorecoercion window.Event
          */
         public static function dispatchDragEvent(event:DragEvent, target:IEventDispatcher):void
         {
@@ -340,7 +346,7 @@ package org.apache.flex.events
             }
             COMPILE::JS
             {
-                target.element.dispatchEvent(event);
+                (target as IUIBase).element.dispatchEvent(event as window.Event);
             }
         }
 	}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/0e16bd14/frameworks/projects/DragDrop/as/src/org/apache/flex/events/DragEventBase.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/DragDrop/as/src/org/apache/flex/events/DragEventBase.as b/frameworks/projects/DragDrop/as/src/org/apache/flex/events/DragEventBase.as
index 8f0aa44..aaa8ddf 100644
--- a/frameworks/projects/DragDrop/as/src/org/apache/flex/events/DragEventBase.as
+++ b/frameworks/projects/DragDrop/as/src/org/apache/flex/events/DragEventBase.as
@@ -38,10 +38,14 @@ package org.apache.flex.events
     COMPILE::AS3
 	public class DragEventBase extends MouseEvent
 	{
+        public function DragEventBase(type:String, bubbles:Boolean=false, cancelable:Boolean=false)
+        {
+            super(type, bubbles, cancelable);
+        }
     }
 
     COMPILE::JS
-    public class DragEventBase extends BrowserEvent
+    public class DragEventBase extends goog.events.BrowserEvent
     {
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/0e16bd14/frameworks/projects/DragDrop/build.xml
----------------------------------------------------------------------
diff --git a/frameworks/projects/DragDrop/build.xml b/frameworks/projects/DragDrop/build.xml
index 1db4bb7..1896794 100644
--- a/frameworks/projects/DragDrop/build.xml
+++ b/frameworks/projects/DragDrop/build.xml
@@ -37,7 +37,7 @@
     <target name="main" depends="clean,compile,test" description="Clean build of DragDrop.swc">
     </target>
     
-    <target name="all" depends="main,compile-asjs,lint-js,test-js" description="Full build
of DragDrop.swc">
+    <target name="all" depends="clean,compile-asjs,compile-extern-swc,compile" description="Full
build of DragDrop.swc">
     </target>
     
     <target name="test" unless="is.jenkins">
@@ -98,11 +98,13 @@
             <load-config filename="compile-config.xml" />
             <arg value="+playerglobal.version=${playerglobal.version}" />
             <arg value="+env.AIR_HOME=${env.AIR_HOME}" />
+            <arg value="-define=COMPILE::AS3,true" />
+            <arg value="-define=COMPILE::JS,false" />
         </compc>
     </target>
 
-    <target name="compile-asjs" >
-        <echo message="Cross-compiling DragDrop/asjs"/>
+    <target name="compile-asjs">
+        <echo message="Cross-compiling DragDrop"/>
         <echo message="FALCONJX_HOME: ${FALCONJX_HOME}"/>
         <java jar="${FALCONJX_HOME}/lib/compc.jar" fork="true" >
             <jvmarg value="-Xmx384m" />
@@ -117,45 +119,56 @@
             <arg value="+playerglobal.version=${playerglobal.version}" />
             <arg value="+env.PLAYERGLOBAL_HOME=${env.PLAYERGLOBAL_HOME}" />
             <arg value="+env.AIR_HOME=${env.AIR_HOME}" />
+            <arg value="-external-library-path+=${FALCONJX_HOME}/../externs/js/out/bin/js.swc"
/>
+            <!-- this is not on external-library path otherwise goog.requires are not
generated -->
+            <arg value="-library-path+=${FALCONJX_HOME}/../externs/GCL/out/bin/GCL.swc"
/>
+            <arg value="-define=COMPILE::AS3,false" />
+            <arg value="-define=COMPILE::JS,true" />
         </java>
     </target>
 
-    <target name="lint-js" depends="gjslint, jshint, copy-js" />
+    <target name="compile-extern-swc" description="Compiles .as files into .swc used for
cross-compiling other projects">
+        <echo message="Compiling externs/DragDrop.swc"/>
+        <echo message="FLEX_HOME: ${FLEX_HOME}"/>
+        <echo message="FALCON_HOME: ${FALCON_HOME}"/>
+        <!-- make JS output folder now so include-file doesn't error -->
+        <mkdir dir="${FLEXJS_HOME}/frameworks/externs"/>
+        
+        <!-- Load the <compc> task. We can't do this at the <project> level
-->
+        <!-- because targets that run before flexTasks.jar gets built would fail. -->
+        <taskdef resource="flexTasks.tasks" classpathref="lib.path"/>
+        <!--
+         Link in the classes (and their dependencies) for the MXML tags
+         listed in this project's manifest.xml.
+         Also link the additional classes (and their dependencies)
+         listed in DragDropClasses.as,
+         because these aren't referenced by the manifest classes.
+         Keep the standard metadata when compiling.
+         Include the appropriate CSS files and assets in the SWC.
+         Don't include any resources in the SWC.
+         Write a bundle list of referenced resource bundles
+         into the file bundles.properties in this directory.
+         -->
+        <compc fork="true"
+            output="${FLEXJS_HOME}/frameworks/externs/DragDrop.swc">
+            <jvmarg line="${compc.jvm.args}"/>
+            <load-config filename="compile-asjs-config.xml" />
+            <arg value="+playerglobal.version=${playerglobal.version}" />
+            <arg value="+env.AIR_HOME=${env.AIR_HOME}" />
+            <arg value="-external-library-path+=${FALCONJX_HOME}/../externs/js/out/bin/js.swc"
/>
+            <!-- this is not on external-library path otherwise goog.requires are not
generated -->
+            <arg value="-library-path+=${FALCONJX_HOME}/../externs/GCL/out/bin/GCL.swc"
/>
+            <arg value="-define=COMPILE::AS3,false" />
+            <arg value="-define=COMPILE::JS,true" />
+        </compc>
+    </target>
+
     <target name="copy-js" >
         <copy todir="${FLEXJS_HOME}/frameworks/js/FlexJS/libs">
-            <fileset dir="${basedir}/js/src">
-                <include name="**/**" />
-            </fileset>
             <fileset dir="${basedir}/js/out">
                 <include name="**/**" />
             </fileset>
         </copy>
     </target>
 
-    <target name="gjslint" unless="no.lint">
-        <echo>running gjslint</echo>
-        <exec executable="${gjslint}" dir="${basedir}" failonerror="true">
-            <arg value="--strict" />
-            <arg value="--disable" />
-            <arg value="006,100,214,300" />
-            <!-- 006: wrong indentation -->
-            <!-- 100: cannot have non-primitive value -->
-            <!-- 214: @fileoverview tag missing description -->
-            <!-- 300: missing newline at end of file -->
-            <arg value="--max_line_length" />
-            <arg value="120" />
-            <arg value="-r" />
-            <arg value="${basedir}/js/src" />
-        </exec>
-    </target>
-
-    <target name="jshint" unless="no.lint">
-        <echo>running jshint</echo>
-        <exec executable="${jshint}" dir="${basedir}" failonerror="true">
-            <arg value="--config" />
-            <arg value="${FLEX_HOME}/frameworks/js/jshint.properties" />
-            <arg value="${basedir}/js/src" />
-        </exec>
-    </target>
-
 </project>

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/0e16bd14/frameworks/projects/DragDrop/compile-asjs-config.xml
----------------------------------------------------------------------
diff --git a/frameworks/projects/DragDrop/compile-asjs-config.xml b/frameworks/projects/DragDrop/compile-asjs-config.xml
index 3fcabd6..3152403 100644
--- a/frameworks/projects/DragDrop/compile-asjs-config.xml
+++ b/frameworks/projects/DragDrop/compile-asjs-config.xml
@@ -22,7 +22,6 @@
         <accessible>false</accessible>
         
         <external-library-path>
-            <path-element>${env.AIR_HOME}/frameworks/libs/air/airglobal.swc</path-element>
         </external-library-path>
         
 		<mxml>
@@ -46,12 +45,11 @@
             <!-- asjscompc won't 'link' these classes in, but will list their requires
              if these swcs are on the external-library-path then their requires
              will not be listed -->
-            <path-element>../../libs/Core.swc</path-element>
-            <path-element>../../libs/DragDrop.swc</path-element>
+            <path-element>../../externs/Core.swc</path-element>
         </library-path>
         
         <source-path>
-            <path-element>asjs/src</path-element>
+            <path-element>as/src</path-element>
         </source-path>
         
         <warn-no-constructor>false</warn-no-constructor>
@@ -60,9 +58,9 @@
     <include-file>
     </include-file>
 
-    <include-sources>
-        <path-element>asjs/src</path-element>
-    </include-sources>
+    <include-classes>
+        <class>DragDropClasses</class>
+    </include-classes>
     
     <include-namespaces>
         <uri>library://ns.apache.org/flexjs/basic</uri>

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/0e16bd14/frameworks/projects/DragDrop/compile-config.xml
----------------------------------------------------------------------
diff --git a/frameworks/projects/DragDrop/compile-config.xml b/frameworks/projects/DragDrop/compile-config.xml
index 7506e1d..f8d1526 100644
--- a/frameworks/projects/DragDrop/compile-config.xml
+++ b/frameworks/projects/DragDrop/compile-config.xml
@@ -54,7 +54,6 @@
         
         <source-path>
             <path-element>as/src</path-element>
-            <path-element>asjs/src</path-element>
         </source-path>
         
         <warn-no-constructor>false</warn-no-constructor>
@@ -64,14 +63,9 @@
         <name>js/out/*</name>
         <path>js/out/*</path>
     </include-file>
-    <include-file>
-        <name>js/src/*</name>
-        <path>js/src/*</path>
-    </include-file>
 
     <include-classes>
         <class>DragDropClasses</class>
-        <class>DragDropASJSClasses</class>
     </include-classes>
     
     <include-namespaces>


Mime
View raw message