You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by er...@apache.org on 2012/12/06 13:08:38 UTC
svn commit: r1417812 - in
/incubator/flex/whiteboard/aharui/flexjs/publisher: ./ README
build.properties build.xml
Author: erikdebruin
Date: Thu Dec 6 12:08:37 2012
New Revision: 1417812
URL: http://svn.apache.org/viewvc?rev=1417812&view=rev
Log:
Sorry Alex, my late night hacking turned out to be a little too late and I committed to your whiteboard instead of the root. Fixing now.
Modified:
incubator/flex/whiteboard/aharui/flexjs/publisher/ (props changed)
incubator/flex/whiteboard/aharui/flexjs/publisher/README
incubator/flex/whiteboard/aharui/flexjs/publisher/build.properties
incubator/flex/whiteboard/aharui/flexjs/publisher/build.xml
Propchange: incubator/flex/whiteboard/aharui/flexjs/publisher/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Thu Dec 6 12:08:37 2012
@@ -0,0 +1 @@
+release
Modified: incubator/flex/whiteboard/aharui/flexjs/publisher/README
URL: http://svn.apache.org/viewvc/incubator/flex/whiteboard/aharui/flexjs/publisher/README?rev=1417812&r1=1417811&r2=1417812&view=diff
==============================================================================
--- incubator/flex/whiteboard/aharui/flexjs/publisher/README (original)
+++ incubator/flex/whiteboard/aharui/flexjs/publisher/README Thu Dec 6 12:08:37 2012
@@ -1,20 +1,98 @@
-1. create a directory 'closure' somewhere
-2. get Closure Library and install it in 'closure/library'
- - svn checkout http://closure-library.googlecode.com/svn/trunk/ library
-3. download Closure Compiler and unzip in 'closure/compiler'
- - http://closure-compiler.googlecode.com/files/compiler-latest.zip
-4. install Closure Linter into 'closure/linter'
- - https://developers.google.com/closure/utilities/docs/linter_howto
-5. get Closure Builder and install it in 'closure/builder'
- - svn checkout http://closure-library.googlecode.com/svn/trunk/closure/bin/build/ builder
-6. edit 'build.properties' to reflect the location of the 'closure' directory
-7. build FalconJS (see README)
-8. run the publish script with the 'ant -Dapp.name=[your.app.name.here] -Dapp.location=[your.app.location.here]'
-
-ATTENTION!
-As of 2012-12-06, the FalconJS compiler doesn't output JS that can be parsed
-by the new tool set. While this is being corrected, you'll have to create your
-own 'intermediate' JS project, or modify one of the examples (I've included
-'FlexJSTest_dummy' in the repo). Make sure to not include the 'falconJS'
-dependency (?) in the build.xml and if you don't want to loose your work,
-make sure to set CLEAN_INTERMEDIATE_JS to 'false' in build.properties.
+ASJS Publisher
+==============
+
+ The ASJS Publisher is a tool to cross-compile projects from ActionScript (AS)
+ to Javascript (JS). On the AS side, a project needs to be built with the
+ FlexJS AS framework (instead of the regular Flex SDK). The Publisher collects
+ the project's AS code and uses the FalconJS compiler to create JS code. This
+ JS code is then combined with the FlexJS JS framework using the Google Closure
+ Builder. This tool takes all the JS files, calculates dependencies and creates
+ one, highly optimized and minified, JS file: FlexJS.js. This one file is
+ combined with a minimal HTML file and together these contain all code needed
+ to play the project in a browser.
+
+ The Publisher also contains some targets that help with developing the FlexJS
+ JS framework, like a Linter to check the correct use of coding conventions. For
+ more information, read on.
+
+Using the Publisher
+===================
+
+Prerequisites
+-------------
+
+ The ASJS Publisher relies on the Google Closure Tools:
+
+ https://developers.google.com/closure/
+
+ In particular it uses the Library, Linter, Compiler and Builder. In order
+ to use the Publisher on your machine, you'll have to download/install these
+ tools first.
+
+ 1) Prepare a root directory to hold the various tools.
+
+ 2) Get the Google Closure Library into '<root>/library'
+
+ svn checkout http://closure-library.googlecode.com/svn/trunk/ library
+
+ 3) Install the Google Closure Linter into '<root>/linter'
+
+ https://developers.google.com/closure/utilities/docs/linter_howto
+
+ 4) Download the Google Closure Compiler and unzip into '<root>/compiler'
+
+ http://closure-compiler.googlecode.com/files/compiler-latest.zip
+
+ 5) Get the Google Closure Builder into '<root>/builder'
+
+ svn checkout http://closure-library.googlecode.com/svn/trunk/closure/bin/build/ builder
+
+Preparing for publishing
+------------------------
+
+ 1) The ASJS Publisher uses the FalconJS compiler, which in turn needs the
+ Falcon compiler. Get Falcon from SVN:
+
+ https://svn.apache.org/repos/asf/incubator/flex/falcon/trunk
+
+ And build it using the README as your guide.
+
+ 2) The Publisher is an ant script, 'build.xml', which uses
+ 'build.properties' and command line arguments to set dynamic properties.
+ Before your run you need to edit 'build.properties' to reflect the
+ various system specific properties.
+
+Publishing
+----------
+
+ A full run ('main') of the ant script takes 2 command line arguments:
+ path.name and path.location. Usage is:
+
+ ant -Dapp.name=<your.app.name.here> -Dapp.location=<your.app.location.here>
+
+ 'app.name' is the name of the FlexJS AS project you want to publish. 'app.location'
+ is the full path to the directory this project lives in. If you're working
+ from an intermediate FlexJS JS project (see below), the second argument is
+ not needed, as that type of project lives in the 'intermediate' directory
+ in the Publisher root.
+
+ NOTE: as of 2012-12-06, the FalconJS compiler doesn't output JS that can be
+ parsed by the new tool set. While this is being corrected, you'll have to
+ create your own 'intermediate' JS project, or modify one of the examples
+ (I've included 'FlexJSTest_dummy' in the repo). Make sure to not include the
+ 'falconJS' dependency (?) in the build.xml and if you don't want to loose
+ your work, set CLEAN_INTERMEDIATE_JS to 'false' in build.properties.
+
+ If you're doing work on the FlexJS JS framework, you should use
+
+ ant lint
+
+ regularly, to make sure your code is formatted correctly and in perfect
+ condition to be parsed by the Google Closure Compiler.
+
+That's it, have fun!
+
+The Apache Flex Project
+
+ <http://incubator.apache.org/flex/>
+
Modified: incubator/flex/whiteboard/aharui/flexjs/publisher/build.properties
URL: http://svn.apache.org/viewvc/incubator/flex/whiteboard/aharui/flexjs/publisher/build.properties?rev=1417812&r1=1417811&r2=1417812&view=diff
==============================================================================
--- incubator/flex/whiteboard/aharui/flexjs/publisher/build.properties (original)
+++ incubator/flex/whiteboard/aharui/flexjs/publisher/build.properties Thu Dec 6 12:08:37 2012
@@ -20,27 +20,8 @@
# Clean out the previous run's intermediate files? Set false if working with a dummy set of JS intermediairies.
CLEAN_INTERMEDIATE_JS=false
-# Location of the Google Closure tool set (EDIT THIS).
+# Location of the Google Closure Tools
DIR_CLOSURE=/Users/erik/Documents/ApacheFlex/dependencies/GoogleClosure
-# With a default install there should be no need to edit these:
-DIR_CLOSURE_LIBRARY=${DIR_CLOSURE}/library
-FILE_CLOSURE_BUILDER=${DIR_CLOSURE}/builder/closurebuilder.py
-FILE_CLOSURE_DEPENDENCIES=${DIR_CLOSURE_LIBRARY}/closure/goog/deps.js
-FILE_CLOSURE_JAR=${DIR_CLOSURE}/compiler/compiler.jar
-# Location of the FlexJS framework (from SVN, with default working copy structure there is no need to edit this)
-DIR_FRAMEWORK=${basedir}/../frameworks/js/src
-
-# Location of intermediate and release project files
-DIR_INTERMEDIATE=${basedir}/intermediate
-DIR_RELEASE=${basedir}/release
-# Location of the current project's files, with the 'app' property passed in using the '-Dapp.name=[value]' argument.
-DIR_INTERMEDIATE_APPLICATION=${DIR_INTERMEDIATE}/${app.name}
-DIR_RELEASE_APPLICATION=${DIR_RELEASE}/${app.name}
-
-# Location of the FalconJS mxmlc script (EDIT THIS).
+# Location of the FalconJS mxmlc script
FILE_FALCONJS_COMPILE_SCRIPT=/Users/erik/Documents/ApacheFlex/repo/falcon/compiler.js/bin/mxmlc
-
-# No need to edit these.
-FILE_HTML_TEMPLATE=${basedir}/index.html.template
-FILE_RELEASE=${DIR_RELEASE_APPLICATION}/FlexJS.js
Modified: incubator/flex/whiteboard/aharui/flexjs/publisher/build.xml
URL: http://svn.apache.org/viewvc/incubator/flex/whiteboard/aharui/flexjs/publisher/build.xml?rev=1417812&r1=1417811&r2=1417812&view=diff
==============================================================================
--- incubator/flex/whiteboard/aharui/flexjs/publisher/build.xml (original)
+++ incubator/flex/whiteboard/aharui/flexjs/publisher/build.xml Thu Dec 6 12:08:37 2012
@@ -18,7 +18,23 @@
-->
<project name="asjsPublisher" default="main" basedir=".">
- <property file="${basedir}/build.properties" description="Properties for ASJS-Framework project" />
+ <property file="${basedir}/build.properties" description="Properties for the ASJS Publisher" />
+
+ <property name="DIR_CLOSURE_LIBRARY" value="${DIR_CLOSURE}/library" />
+ <property name="FILE_CLOSURE_BUILDER" value="${DIR_CLOSURE}/builder/closurebuilder.py" />
+ <property name="FILE_CLOSURE_DEPENDENCIES" value="${DIR_CLOSURE_LIBRARY}/closure/goog/deps.js" />
+ <property name="FILE_CLOSURE_JAR" value="${DIR_CLOSURE}/compiler/compiler.jar" />
+
+ <property name="DIR_FRAMEWORK" value="${basedir}/../frameworks/js/src" />
+
+ <property name="DIR_INTERMEDIATE" value="${basedir}/intermediate" />
+ <property name="DIR_RELEASE" value="${basedir}/release" />
+
+ <property name="DIR_INTERMEDIATE_APPLICATION" value="${DIR_INTERMEDIATE}/${app.name}" />
+ <property name="DIR_RELEASE_APPLICATION" value="${DIR_RELEASE}/${app.name}" />
+
+ <property name="FILE_HTML_TEMPLATE" value="${basedir}/index.html.template" />
+ <property name="FILE_RELEASE" value="${DIR_RELEASE_APPLICATION}/FlexJS.js" />
<macrodef name="closureBuilder">
<sequential>
@@ -40,7 +56,7 @@
</macrodef>
<!-- target name="main" description="Compiles framework files" depends="clean,createDirs,falconJS,closureBuilding,createHTML" / -->
- <target name="main" description="Compiles framework files" depends="clean,createDirs,closureBuilding,createHTML" />
+ <target name="main" description="Compiles framework files" depends="clean,createDirs,lint,closureBuilding,createHTML" />
<target name="clean" description="Clean up previous runs" depends="cleanIntermediate,cleanRelease">
<echo>Delete 'intermediate' and 'release' directories</echo>
@@ -81,6 +97,10 @@
</exec>
</target>
+ <target name="lint">
+ <echo>Lint-ing the FlexJS JS framework</echo>
+ </target>
+
<target name="closureBuilding">
<echo>Creating combined and compiled output JS</echo>
<closureBuilder />