You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by ah...@apache.org on 2016/05/26 23:05:35 UTC

[51/51] [abbrv] git commit: [flex-asjs] [refs/heads/spark] - Updated cordova-build.xml and added Flash Builder launch configurations to use cordova-build.xml from within Flash Builder.

Updated cordova-build.xml and added Flash Builder launch configurations to use cordova-build.xml from within Flash Builder.


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

Branch: refs/heads/spark
Commit: f88b37a4b3dbdc23aa49a4bb9ba75fa0e6e23b4e
Parents: e656a9b
Author: Peter Ent <pe...@apache.org>
Authored: Wed May 25 11:07:54 2016 -0400
Committer: Alex Harui <ah...@apache.org>
Committed: Thu May 26 16:04:24 2016 -0700

----------------------------------------------------------------------
 cordova-build.xml                              | 61 ++++++++++++++-------
 ide/flashbuilder/FlexJS (Cordova Build).launch | 18 ++++++
 ide/flashbuilder/FlexJS (Cordova Run).launch   | 20 +++++++
 installer.xml                                  | 15 ++++-
 4 files changed, 93 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f88b37a4/cordova-build.xml
----------------------------------------------------------------------
diff --git a/cordova-build.xml b/cordova-build.xml
index d7fb343..e224d2e 100644
--- a/cordova-build.xml
+++ b/cordova-build.xml
@@ -18,7 +18,7 @@
 
 -->
 
-<project name="createproject" default="main">
+<project name="cordova-app" default="main">
 
 	<!-- this ANT script assumes you are in the following directory structure:
 	
@@ -35,44 +35,64 @@
 	     3. This ANT script will remove ./app/<APP>/www contents are replace it with
 	     the contents of bin/js-debug.
 	     
-	     Optionally, you can run the Cordova application using ant run <platform>
+	     Optionally, you can run the Cordova application using ant run
 	     
 	-->
 	
 	<target name="main" depends="create, compilejs, copyfiles" description="Creates the Cordova app if needed, compiles the FlexJS app, copies the results to Cordova app">
-		<echo message="Building app ${appname} for platform ${platform}" />
 	</target>
 	
 	<!-- Set up properties and conditions -->
 	
-	<condition property="platform" value="android">
+	<property environment="env"/>
+    
+    <condition property="isWindows" value="windows">
+        <os family="windows" />
+    </condition>
+    
+    <condition property="projectdir" value="${user.dir}">
+    	<not>
+    		<isset property="projectdir" />
+    	</not>
+    </condition>
+	
 	<!-- override with -Dplatform=other-platform-name -->
+	<condition property="platform" value="android">
 		<not>
 			<isset property="platform" />
 		</not>
     </condition>
     
-    
-	<basename property="directory.name" file="${user.dir}" />
 	<!-- override with -Dappname=other-app-name -->
+	<basename property="directory.name" file="${projectdir}" />
     <condition property="appname" value="${directory.name}">
     	<not>
     		<isset property="appname" />
     	</not>
     </condition>
+    
+    <condition property="cordova.executable" value="cordova">
+    	<not>
+    		<isset property="isWindows" />
+    	</not>
+    </condition>
+    <condition property="cordova.executable" value="cordova.cmd">
+    	<isset property="isWindows" />
+    </condition>
 	
-	<property name="cordova.target.dir" value="${user.dir}/app/${appname}" />
+	<property name="cordova.target.dir" value="${projectdir}/app/${appname}" />
     <available file="${cordova.target.dir}" type="dir" property="app.dir.exists"/>
+    
 	
-	<!-- Step 1: create the Cordova template project unless it already exists -->
+	<!-- Create the Cordova template project unless it already exists -->
 	
 	<target name="makedir" unless="app.dir.exists">
-		<mkdir dir="${user.dir}/app" />
+		<mkdir dir="${projectdir}/app" />
 	</target>
 	
 	<target name="create" unless="app.dir.exists" depends="makedir" description="Creates the Cordova application template">
     	<!-- create the project -->
-		<exec executable="cordova" dir="${user.dir}/app">
+		<exec executable="${cordova.executable}" dir="${projectdir}/app">
 			<arg value="create" />
 			<arg value="${appname}" />
 		</exec>
@@ -80,23 +100,23 @@
 		<echo>Adding in platform(s). This may take awhile.</echo>
 
 		<!-- add in the platforms -->
-		<exec executable="cordova" dir="${cordova.target.dir}">
+		<exec executable="${cordova.executable}" dir="${cordova.target.dir}">
 			<arg value="platform" />
 			<arg value="add" />
 			<arg value="${platform}" />
 		</exec>
     </target>
     
-    <!-- Step 2: Compile the FlexJS application -->
+    <!-- Compile the FlexJS application -->
     
     <target name="compilejs" description="Compiles the FlexJS app into JavaScript">
     	<echo message="Compiling FlexJS app" />
-    	<exec executable="mxmlc" dir="${user.dir}/src">
+    	<exec executable="mxmlc" dir="${projectdir}/src">
     		<arg value="${appname}.mxml" />
     	</exec>
     </target>
     
-    <!-- Step 3: Clean www directory -->
+    <!-- Clean www directory -->
     
     <target name="purge">
     	<delete includeEmptyDirs="true">
@@ -104,12 +124,12 @@
     	</delete>
     </target>
     
-    <!-- Step 4: Copy files from step 2 -->
+    <!-- Copy files from step above -->
     
     <target name="copyfiles" depends="purge">
     	<echo message="Copying files from project" />
     	<copy todir="${cordova.target.dir}/www">
-    		<fileset dir="${user.dir}/bin/js-debug" />
+    		<fileset dir="${projectdir}/bin/js-debug" />
     	</copy>
     </target>
     
@@ -130,13 +150,14 @@
     -->
     
     <target name="clean" depends="purge" description="Removes files created during the build and copy">
-    	<delete dir="${user.dir}/bin-debug" failonerror="false" />
-    	<delete dir="${user.dir}/bin-release" failonerror="false" />
+    	<delete dir="${projectdir}/bin-debug" failonerror="false" />
+    	<delete dir="${projectdir}/bin-release" failonerror="false" />
     </target>
     
     <target name="super-clean" depends="clean" description="Removes all files and directories except src and its contents">
-    	<delete dir="${user.dir}/bin" />
-    	<delete dir="${user.dir}/app" />
+    	<delete dir="${projectdir}/bin" />
+    	<delete dir="${projectdir}/app" />
     </target>
+    
 
 </project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f88b37a4/ide/flashbuilder/FlexJS (Cordova Build).launch
----------------------------------------------------------------------
diff --git a/ide/flashbuilder/FlexJS (Cordova Build).launch b/ide/flashbuilder/FlexJS (Cordova Build).launch
new file mode 100644
index 0000000..4d9dc2d
--- /dev/null
+++ b/ide/flashbuilder/FlexJS (Cordova Build).launch	
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.ant.AntLaunchConfigurationType">
+<booleanAttribute key="org.eclipse.ant.ui.DEFAULT_VM_INSTALL" value="true"/>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS"/>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES"/>
+<mapAttribute key="org.eclipse.debug.core.environmentVariables">
+<mapEntry key="PATH" value="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"/>
+</mapAttribute>
+<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.ant.ui.AntClasspathProvider"/>
+<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.launching.macosx.MacOSXType/Java SE 8 (MacOS X Default)"/>
+<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.ant.internal.launching.remote.InternalAntRunner"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value=""/>
+<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.ant.ui.AntClasspathProvider"/>
+<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_HIDE_INTERNAL_TARGETS" value="true"/>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="/Users/pent/dev/flex-asjs/cordova-build.xml"/>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS" value="-Dprojectdir=${project_loc}"/>
+<stringAttribute key="process_factory_id" value="org.eclipse.ant.ui.remoteAntProcessFactory"/>
+</launchConfiguration>

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f88b37a4/ide/flashbuilder/FlexJS (Cordova Run).launch
----------------------------------------------------------------------
diff --git a/ide/flashbuilder/FlexJS (Cordova Run).launch b/ide/flashbuilder/FlexJS (Cordova Run).launch
new file mode 100644
index 0000000..354e9cf
--- /dev/null
+++ b/ide/flashbuilder/FlexJS (Cordova Run).launch	
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.ant.AntLaunchConfigurationType">
+<booleanAttribute key="org.eclipse.ant.ui.DEFAULT_VM_INSTALL" value="true"/>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS"/>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES"/>
+<mapAttribute key="org.eclipse.debug.core.environmentVariables">
+<mapEntry key="ANT_HOME" value="/Applications/Adobe Flash Builder 4.7/eclipse/plugins/org.apache.ant_1.8.2.v20110505-1300"/>
+<mapEntry key="PATH" value="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"/>
+</mapAttribute>
+<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.ant.ui.AntClasspathProvider"/>
+<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.launching.macosx.MacOSXType/Java SE 8 (MacOS X Default)"/>
+<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.ant.internal.launching.remote.InternalAntRunner"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value=""/>
+<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.ant.ui.AntClasspathProvider"/>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_ANT_TARGETS" value="run,"/>
+<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_HIDE_INTERNAL_TARGETS" value="true"/>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="/Users/pent/dev/flex-asjs/cordova-build.xml"/>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS" value="-Dprojectdir=${project_loc}"/>
+<stringAttribute key="process_factory_id" value="org.eclipse.ant.ui.remoteAntProcessFactory"/>
+</launchConfiguration>

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f88b37a4/installer.xml
----------------------------------------------------------------------
diff --git a/installer.xml b/installer.xml
index 9070491..0938c4f 100644
--- a/installer.xml
+++ b/installer.xml
@@ -216,7 +216,7 @@
         <property name="falcon.file" value="apache-flex-falconjx-${falcon.version}-bin.zip" />
     </target>
     
-    <target name="install" depends="get-data,find-java,get-md5-data,check-binary,ask-licenses,get-falcon,get-third-party-files,fixup-config-files,hack-fb-files,setup-launch-configs,delete-download-dir" description="Converts binary package to IDE compatible folder">
+    <target name="install" depends="get-data,find-java,get-md5-data,check-binary,ask-licenses,get-falcon,get-third-party-files,fixup-config-files,hack-fb-files,setup-launch-configs,setup-launch-configs-windows,delete-download-dir" description="Converts binary package to IDE compatible folder">
         <echo>${install.complete.echo}</echo>
     </target>
 
@@ -955,6 +955,19 @@ tofile="${FLEXJS_HOME}/frameworks/themes/Halo/Halo.swc" />
             value="&quot;${java.executable}&quot;"/>
         </replace>
     </target>
+    
+    <target name="setup-launch-configs-windows" description="Custom Flash Builder launch configurations for Windows" if="isWindows">
+        <replace file="${FLEXJS_HOME}/ide/flashbuilder/FlexJS (Cordova Build).launch">
+        	<replacefilter
+        	token="PATH"
+        	value="UNIX_PATH" />
+        </replace>
+        <replace file="${FLEXJS_HOME}/ide/flashbuilder/FlexJS (Cordova Run).launch">
+        	<replacefilter
+        	token="PATH"
+        	value="UNIX_PATH" />
+        </replace>
+    </target>
 
     <target name="download_using_mirror" depends="check-cache,get-preferred">
         <antcall target="get-if-not-cached">