launch scripts to convert a new Flex project to a FlexJS project in FB

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

Branch: refs/heads/spark
Commit: a894f963e1e1fdb73e39c2a38239d8a15c2607af
Parents: f9ddca5
Author: Alex Harui <[email protected]>
Authored: Fri Jun 10 22:12:53 2016 -0700
Committer: Alex Harui <[email protected]>
Committed: Fri Jun 10 22:12:53 2016 -0700

----------------------------------------------------------------------
 ...ew Flex Project to FlexJS MVC Project.launch | 19 ++++++
 ...rt New Flex Project to FlexJS Project.launch | 17 ++++++
 ide/flashbuilder/FlexJS (Cordova Build).launch  |  2 +-
 ide/flashbuilder/FlexJS (Cordova Run).launch    |  2 +-
 ide/flashbuilder/antscripts.xml                 | 61 ++++++++++++++++++++
 installer.xml                                   | 20 +++++++
 6 files changed, 119 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/a894f963/ide/flashbuilder/Convert
 New Flex Project to FlexJS MVC Project.launch
----------------------------------------------------------------------
diff --git a/ide/flashbuilder/Convert New Flex Project to FlexJS MVC 
Project.launch b/ide/flashbuilder/Convert New Flex Project to FlexJS MVC 
Project.launch
new file mode 100644
index 0000000..98b6498
--- /dev/null
+++ b/ide/flashbuilder/Convert New Flex Project to FlexJS MVC Project.launch    
@@ -0,0 +1,19 @@
+<?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.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="convert_project_mvc,"/>
+<booleanAttribute 
key="org.eclipse.ui.externaltools.ATTR_HIDE_INTERNAL_TARGETS" value="true"/>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" 
value="$FLEXJS_HOME/ide/flashbuilder/antscripts.xml"/>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS" 
value="-DprojectDir=&quot;${project_loc}&quot;"/>
+<stringAttribute key="process_factory_id" 
value="org.eclipse.ant.ui.remoteAntProcessFactory"/>
+</launchConfiguration>

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/a894f963/ide/flashbuilder/Convert
 New Flex Project to FlexJS Project.launch
----------------------------------------------------------------------
diff --git a/ide/flashbuilder/Convert New Flex Project to FlexJS Project.launch 
b/ide/flashbuilder/Convert New Flex Project to FlexJS Project.launch
new file mode 100644
index 0000000..0224b51
--- /dev/null
+++ b/ide/flashbuilder/Convert New Flex Project to FlexJS Project.launch        
@@ -0,0 +1,17 @@
+<?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.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="$FLEXJS_HOME/ide/flashbuilder/antscripts.xml"/>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS" 
value="-DprojectDir="&quot;{project_loc}&quot;"/>
+<stringAttribute key="process_factory_id" 
value="org.eclipse.ant.ui.remoteAntProcessFactory"/>
+</launchConfiguration>

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/a894f963/ide/flashbuilder/FlexJS
 (Cordova Build).launch
----------------------------------------------------------------------
diff --git a/ide/flashbuilder/FlexJS (Cordova Build).launch 
b/ide/flashbuilder/FlexJS (Cordova Build).launch
index 4d9dc2d..f7223d1 100644
--- a/ide/flashbuilder/FlexJS (Cordova Build).launch    
+++ b/ide/flashbuilder/FlexJS (Cordova Build).launch    
@@ -12,7 +12,7 @@
 <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_LOCATION" 
value="$FLEXJS_HOME/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/a894f963/ide/flashbuilder/FlexJS
 (Cordova Run).launch
----------------------------------------------------------------------
diff --git a/ide/flashbuilder/FlexJS (Cordova Run).launch 
b/ide/flashbuilder/FlexJS (Cordova Run).launch
index 354e9cf..a71cdee 100644
--- a/ide/flashbuilder/FlexJS (Cordova Run).launch      
+++ b/ide/flashbuilder/FlexJS (Cordova Run).launch      
@@ -14,7 +14,7 @@
 <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_LOCATION" 
value="$FLEXJS_HOME/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/a894f963/ide/flashbuilder/antscripts.xml
----------------------------------------------------------------------
diff --git a/ide/flashbuilder/antscripts.xml b/ide/flashbuilder/antscripts.xml
new file mode 100644
index 0000000..fe51e8f
--- /dev/null
+++ b/ide/flashbuilder/antscripts.xml
@@ -0,0 +1,61 @@
+<?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="flashbuilder_antscripts" default="convert_project" basedir=".">
+
+       <property environment="env"/>
+    
+    <condition property="isWindows" value="windows">
+        <os family="windows" />
+    </condition>
+
+    <target name="check_params" >
+        <fail unless="projectDir"
+            message="projectDir parameter not set" />
+        <fail message="projectDir ${projectDir} does not exist">
+            <condition>
+                <not>
+                    <available file="${projectDir}" />
+                </not>
+            </condition>
+        </fail>
+    </target>
+    
+    <target name="convert_project" depends="check_params, cutpath"  
description="Replaces the files in a new Flex project folder with a basic 
FlexJS project">
+        <copy 
file="${basedir}/../../examples/flexjs/HelloWorld/src/HelloWorld.mxml" 
tofile="${projectDir}/src/${projectName}.mxml" overwrite="true" />
+    </target>
+
+    <target name="convert_project_mvc" depends="check_params, cutpath"  
description="Replaces the files in a new Flex project folder with a basic 
FlexJS MVC project">
+        <copy 
file="${basedir}/../../examples/flexjs/DataBindingExample/src/DataBindingExample.mxml"
 tofile="${projectDir}/src/${projectName}.mxml" overwrite="true" />
+        <copy 
file="${basedir}/../../examples/flexjs/DataBindingExample/src/MyInitialView.mxml"
 tofile="${projectDir}/src/MyInitialView.mxml" overwrite="true" />
+        <mkdir dir="${projectDir}/src/models" />
+        <mkdir dir="${projectDir}/src/controllers" />
+        <copy 
file="${basedir}/../../examples/flexjs/DataBindingExample/src/StockDataJSONItemConverter.as"
 tofile="${projectDir}/src/StockDataJSONItemConverter.as" overwrite="true" />
+        <copy 
file="${basedir}/../../examples/flexjs/DataBindingExample/src/models/MyModel.as"
 tofile="${projectDir}/src/models/MyModel.as" overwrite="true" />
+        <copy 
file="${basedir}/../../examples/flexjs/DataBindingExample/src/controllers/MyController.as"
 tofile="${projectDir}/src/controllers/MyController.as" overwrite="true" />
+        <replace file="${projectDir}/src/controllers/MyController.as" 
token="DataBindingExample" value="${projectName}" />
+    </target>
+
+    <target name="cutpath" >
+        <basename file="${projectDir}" property="projectName" />
+        <echo>projectDir: ${projectDir}</echo>
+        <echo>projectName: ${projectName}</echo>
+    </target>
+</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/a894f963/installer.xml
----------------------------------------------------------------------
diff --git a/installer.xml b/installer.xml
index 75814cf..20808bf 100644
--- a/installer.xml
+++ b/installer.xml
@@ -954,6 +954,26 @@ tofile="${FLEXJS_HOME}/frameworks/themes/Halo/Halo.swc" />
             token="$FLEXJS_HOME"
             value="${FLEXJS_HOME}"/>
         </replace>
+        <replace file="${FLEXJS_HOME}/ide/flashbuilder/FlexJS (Cordova 
Build).launch">
+            <replacefilter
+            token="$FLEXJS_HOME"
+            value="${FLEXJS_HOME}"/>
+        </replace>
+        <replace file="${FLEXJS_HOME}/ide/flashbuilder/FlexJS (Cordova 
Run).launch">
+            <replacefilter
+            token="$FLEXJS_HOME"
+            value="${FLEXJS_HOME}"/>
+        </replace>
+        <replace file="${FLEXJS_HOME}/ide/flashbuilder/Convert New Flex 
Project to FlexJS MVC Project.launch">
+            <replacefilter
+            token="$FLEXJS_HOME"
+            value="${FLEXJS_HOME}"/>
+        </replace>
+        <replace file="${FLEXJS_HOME}/ide/flashbuilder/Convert New Flex 
Project to FlexJS Project.launch">
+            <replacefilter
+            token="$FLEXJS_HOME"
+            value="${FLEXJS_HOME}"/>
+        </replace>
         <replace file="${FLEXJS_HOME}/js/bin/mxmlc.bat">
             <replacefilter
             token="@java"

Reply via email to