You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by bi...@apache.org on 2016/03/13 09:45:16 UTC

[01/16] git commit: [flex-utilities] [refs/heads/develop] - Beginnings of npm install functionality for Apache FlexJS. WIP.

Repository: flex-utilities
Updated Branches:
  refs/heads/develop 5bd8a7987 -> b3f5ddc8f


Beginnings of npm install functionality for Apache FlexJS.  WIP.


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

Branch: refs/heads/develop
Commit: f6c7e2afa4ab7e0fa2cec9803d4c34c6140307be
Parents: 5bd8a79
Author: OmPrakash Muppirala <bi...@gmail.com>
Authored: Mon Nov 23 02:21:05 2015 -0800
Committer: OmPrakash Muppirala <bi...@gmail.com>
Committed: Sun Mar 13 00:44:00 2016 -0800

----------------------------------------------------------------------
 .gitignore               |  2 +
 npm-flexjs/package.json  | 27 +++++++++++++
 npm-flexjs/prepublish.js | 93 +++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 122 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/f6c7e2af/.gitignore
----------------------------------------------------------------------
diff --git a/.gitignore b/.gitignore
index a1386da..b5fed5c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -121,3 +121,5 @@ Squiggly/main/generated/
 flex-installer/deps
 MD5Checker/MD5CheckerLog.txt
 
+node_modules
+npm-flexjs.iml

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/f6c7e2af/npm-flexjs/package.json
----------------------------------------------------------------------
diff --git a/npm-flexjs/package.json b/npm-flexjs/package.json
new file mode 100644
index 0000000..d19c3a0
--- /dev/null
+++ b/npm-flexjs/package.json
@@ -0,0 +1,27 @@
+{
+  "name": "apache-flexjs",
+  "version": "0.5.0",
+  "description": "Apache FlexJS",
+  "main": "index.js",
+  "scripts": {
+    "test": "echo \"Error: no test specified\" && exit 1"
+  },
+  "keywords": [
+    "flex",
+    "flexjs",
+    "apache",
+    "flexjs",
+    "actionscript",
+    "as3",
+    "mxml",
+    "angularjs",
+    "reactjs"
+  ],
+  "author": "OmPrakash Muppirala <bi...@apache.org>",
+  "license": "Apache-2.0",
+  "dependencies": {
+    "prompt": "^0.2.14",
+    "request": "^2.67.0",
+    "unzip": "^0.1.11"
+  }
+}

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/f6c7e2af/npm-flexjs/prepublish.js
----------------------------------------------------------------------
diff --git a/npm-flexjs/prepublish.js b/npm-flexjs/prepublish.js
new file mode 100644
index 0000000..1ac5d20
--- /dev/null
+++ b/npm-flexjs/prepublish.js
@@ -0,0 +1,93 @@
+'use strict';
+
+var request = require('request');
+var fs = require('fs');
+var prompt = require('prompt');
+
+var apacheMirrorsCGI = 'http://www.apache.org/dyn/mirrors/mirrors.cgi/';
+
+//FlexJS
+var pathToFlexJSBinary = 'flex/flexjs/0.5.0/binaries/';
+var fileNameFlexJSBinary = 'apache-flex-flexjs-0.5.0-bin.zip';
+
+//Falcon
+var pathToFalconBinary = 'flex/falcon/0.5.0/binaries/';
+var fileNameFalconBinary = 'apache-flex-falconjx-0.5.0-bin.zip';
+
+//Adobe AIR
+var AdobeAIRURL = 'http://airdownload.adobe.com/air/win/download/20.0/';
+var fileNameAdobeAIR = 'AdobeAIRSDK.zip';
+
+//Flash Player Global
+
+var requestJSON = 'asjson=true';
+
+var createDownloadsDirectory = function()
+{
+    try {
+        fs.mkdirSync('downloads');
+    } catch(e) {
+        if ( e.code != 'EEXIST' ) throw e;
+    }
+}
+
+var handleFlexJSMirrorsResponse = function (error, response, body)
+{
+    if (!error && response.statusCode == 200)
+    {
+        var mirrors = JSON.parse(body);
+        var flexJSPreferredDownloadURL = mirrors.preferred + pathToFlexJSBinary + fileNameFlexJSBinary;
+        //Download FlexJS
+        //request(this.flexJSPreferredDownloadURL, handleFlexJSBinaryResponse);
+        request
+            .get(flexJSPreferredDownloadURL)
+            .on('response', function(response) {
+            })
+            .pipe(fs.createWriteStream('downloads//' + fileNameFlexJSBinary));
+    }
+
+};
+
+var handleFalconMirrorsResponse = function (error, response, body)
+{
+    if (!error && response.statusCode == 200)
+    {
+        var mirrors = JSON.parse(body);
+        var falconPreferredDownloadURL = mirrors.preferred + pathToFalconBinary + fileNameFalconBinary;
+        //Download Falcon
+        request
+            .get(falconPreferredDownloadURL)
+            .on('response', function(response) {
+            })
+            .pipe(fs.createWriteStream('downloads//' + fileNameFalconBinary));
+    }
+
+};
+
+var promptForAdobeAIR = function()
+{
+    var schema = {
+        properties: {
+            accept: {
+                description: "Do you accept Adobe's license?",
+                pattern: /^[YNyn\s]{1}$/,
+                message: 'Please respond with either y or n',
+                required: true
+            }
+        }
+    };
+    prompt.start();
+    prompt.get(schema, function (err, result) {
+        console.log('  accept?: ' + result.accept);
+    });
+};
+
+createDownloadsDirectory();
+request(apacheMirrorsCGI + pathToFlexJSBinary + fileNameFlexJSBinary + '?' + requestJSON, handleFlexJSMirrorsResponse);
+request(apacheMirrorsCGI + pathToFalconBinary + fileNameFalconBinary + '?' + requestJSON, handleFalconMirrorsResponse);
+promptForAdobeAIR();
+//promptForFlashPlayerGlobal();
+
+//Download Adobe AIR
+
+//Download Flash Player Global
\ No newline at end of file


[03/16] git commit: [flex-utilities] [refs/heads/develop] - Make download steps easier to follow and modify.

Posted by bi...@apache.org.
Make download steps easier to follow and modify.


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

Branch: refs/heads/develop
Commit: 48c999eb73778d69f1236cec8cae8632019a8566
Parents: 490f910
Author: OmPrakash Muppirala <bi...@gmail.com>
Authored: Sun Nov 29 02:19:02 2015 -0800
Committer: OmPrakash Muppirala <bi...@gmail.com>
Committed: Sun Mar 13 00:44:04 2016 -0800

----------------------------------------------------------------------
 npm-flexjs/download_dependencies.js | 63 ++++++++++++++++++++++++--------
 1 file changed, 47 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/48c999eb/npm-flexjs/download_dependencies.js
----------------------------------------------------------------------
diff --git a/npm-flexjs/download_dependencies.js b/npm-flexjs/download_dependencies.js
index d2cb82e..87a2469 100644
--- a/npm-flexjs/download_dependencies.js
+++ b/npm-flexjs/download_dependencies.js
@@ -27,6 +27,20 @@ var apacheFlexJS = require('./dependencies/ApacheFlexJS');
 var apacheFalcon = require('./dependencies/ApacheFalcon');
 var swfObject = require('./dependencies/SWFObject');
 
+var installSteps = [
+    createDownloadsDirectory,
+    installFlashPlayerGlobal,
+    installAdobeAIR,
+    installApacheFlexJS,
+    installApacheFalcon,
+    installSWFObject];
+var currentStep = 0;
+
+function start()
+{
+    installSteps[0].call();
+}
+
 function createDownloadsDirectory()
 {
     //Create downloads directory if it does not exist already
@@ -38,42 +52,59 @@ function createDownloadsDirectory()
     {
         if ( e.code != 'EEXIST' ) throw e;
     }
+    handleInstallStepComplete();
+}
+
+
+function handleInstallStepComplete(event)
+{
+    currentStep += 1;
+    if(currentStep >= installSteps.length)
+    {
+        allDownloadsComplete();
+    }
+    else
+    {
+        if(installSteps[currentStep] != undefined)
+        {
+            installSteps[currentStep].call();
+        }
+    }
 }
 
-function handleFlashPlayerGlobalComplete(event)
+function installFlashPlayerGlobal()
 {
-    adobeair.on('complete', handleAdobeAIRComplete);
+    flashplayerglobal.on('complete', handleInstallStepComplete);
+    flashplayerglobal.install();
+}
+
+function installAdobeAIR(event)
+{
+    adobeair.on('complete', handleInstallStepComplete);
     adobeair.install();
 }
 
-function handleAdobeAIRComplete(event)
+function installApacheFlexJS(event)
 {
-    apacheFlexJS.on('complete', handleApacheFlexJSComplete);
+    apacheFlexJS.on('complete', handleInstallStepComplete);
     apacheFlexJS.install();
 }
 
-function handleApacheFlexJSComplete(event)
+function installApacheFalcon(event)
 {
-    apacheFalcon.on('complete', handleApacheFalconComplete);
+    apacheFalcon.on('complete', handleInstallStepComplete);
     apacheFalcon.install();
 }
 
-function handleApacheFalconComplete(event)
+function installSWFObject(event)
 {
-    swfObject.on('complete', handleSwfObjectComplete);
+    swfObject.on('complete', handleInstallStepComplete);
     swfObject.install();
 }
 
-function handleSwfObjectComplete(event)
-{
-    allDownloadsComplete();
-}
-
 function allDownloadsComplete()
 {
     console.log('Completed all downloads');
 }
 
-createDownloadsDirectory();
-flashplayerglobal.on('complete', handleFlashPlayerGlobalComplete);
-flashplayerglobal.install();
\ No newline at end of file
+start();


[15/16] git commit: [flex-utilities] [refs/heads/develop] - Add dependencies from package.json

Posted by bi...@apache.org.
Add dependencies from package.json


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

Branch: refs/heads/develop
Commit: b0c1cfab51b1f3f37e25b6b980d66abeba39d38b
Parents: a5747a3
Author: OmPrakash Muppirala <bi...@gmail.com>
Authored: Sun Feb 28 09:37:02 2016 -0800
Committer: OmPrakash Muppirala <bi...@gmail.com>
Committed: Sun Mar 13 00:44:26 2016 -0800

----------------------------------------------------------------------
 npm-flexjs/dependencies/ApacheFlexJS.js | 7 +++++--
 npm-flexjs/package.json                 | 7 ++++++-
 2 files changed, 11 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/b0c1cfab/npm-flexjs/dependencies/ApacheFlexJS.js
----------------------------------------------------------------------
diff --git a/npm-flexjs/dependencies/ApacheFlexJS.js b/npm-flexjs/dependencies/ApacheFlexJS.js
index d806678..1606949 100644
--- a/npm-flexjs/dependencies/ApacheFlexJS.js
+++ b/npm-flexjs/dependencies/ApacheFlexJS.js
@@ -22,14 +22,17 @@ var request = require('request');
 var fs = require('fs');
 var events = require('events');
 var unzip = require('unzip');
+var pjson = require('../package');
 
 var constants = require('../dependencies/Constants');
 
 var ApacheFlexJS = module.exports = Object.create(events.EventEmitter.prototype);
 
+console.error(Object.keys(pjson));
+
 //FlexJS
-var pathToFlexJSBinary = 'flex/flexjs/0.5.0/binaries/';
-var fileNameFlexJSBinary = 'apache-flex-flexjs-0.5.0-bin.zip';
+var pathToFlexJSBinary = pjson.org_apache_flex.flexjs_path_binary; //'flex/flexjs/0.5.0/binaries/';
+var fileNameFlexJSBinary = pjson.org_apache_flex.flexjs_file_name; //'apache-flex-flexjs-0.5.0-bin.zip';
 
 ApacheFlexJS.handleFlexJSMirrorsResponse = function (error, response, body)
 {

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/b0c1cfab/npm-flexjs/package.json
----------------------------------------------------------------------
diff --git a/npm-flexjs/package.json b/npm-flexjs/package.json
index bd3ac59..492234f 100644
--- a/npm-flexjs/package.json
+++ b/npm-flexjs/package.json
@@ -20,6 +20,7 @@
     "merge-dirs": "^0.2.1",
     "mkdirp": "^0.5.1",
     "prompt": "^0.2.14",
+    "read-package-json": "^2.0.3",
     "replace": "^0.3.0",
     "request": "^2.67.0",
     "unzip": "^0.1.11",
@@ -32,5 +33,9 @@
     "asjsc": "./js/bin/asjscnpm",
     "asjscompc": "./js/bin/asjscompcnpm",
     "mxmlc": "./js/bin/mxmlcnpm"
+  },
+  "org_apache_flex": {
+    "flexjs_path_binary": "flex/flexjs/0.5.0/binaries/",
+    "flexjs_file_name": "apache-flex-flexjs-0.5.0-bin.zip"
   }
-}
\ No newline at end of file
+}


[07/16] git commit: [flex-utilities] [refs/heads/develop] - Copy moar files

Posted by bi...@apache.org.
Copy moar files


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

Branch: refs/heads/develop
Commit: 9a6f4aceb37ac61648abc508624e3ab13ba9491a
Parents: e0b7677
Author: OmPrakash Muppirala <bi...@gmail.com>
Authored: Mon Dec 21 19:24:44 2015 -0800
Committer: OmPrakash Muppirala <bi...@gmail.com>
Committed: Sun Mar 13 00:44:11 2016 -0800

----------------------------------------------------------------------
 npm-flexjs/dependencies/ApacheFalcon.js | 31 ++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/9a6f4ace/npm-flexjs/dependencies/ApacheFalcon.js
----------------------------------------------------------------------
diff --git a/npm-flexjs/dependencies/ApacheFalcon.js b/npm-flexjs/dependencies/ApacheFalcon.js
index 5a2996b..60091ba 100644
--- a/npm-flexjs/dependencies/ApacheFalcon.js
+++ b/npm-flexjs/dependencies/ApacheFalcon.js
@@ -206,6 +206,37 @@ function copyFiles()
         constants.FLEXJS_FOLDER + 'bin', {
             forceDelete: true
         });
+
+    //Bin-legacy TODO:FIXME
+
+    //copyfiles.jx copy FalconJX files into SDK
+    try
+    {
+        mkdirp(constants.FLEXJS_FOLDER + 'js/bin');
+        mkdirp(constants.FLEXJS_FOLDER + 'js/lib');
+        mkdirp(constants.FLEXJS_FOLDER + 'js/libs');
+        mkdirp(constants.FLEXJS_FOLDER + 'externs');
+    }
+    catch(e)
+    {
+        if ( e.code != 'EEXIST' ) throw e;
+    }
+
+    wrench.copyDirSyncRecursive(constants.DOWNLOADS_FOLDER + 'falcon/js/lib',
+        constants.FLEXJS_FOLDER + 'js/lib', {
+            forceDelete: true
+        });
+
+    wrench.copyDirSyncRecursive(constants.DOWNLOADS_FOLDER + 'falcon/js/libs',
+        constants.FLEXJS_FOLDER + 'js/libs', {
+            forceDelete: true
+        });
+
+    wrench.copyDirSyncRecursive(constants.DOWNLOADS_FOLDER + 'falcon/externs',
+        constants.FLEXJS_FOLDER + 'externs', {
+            forceDelete: true
+        });
+
 }
 
 ApacheFalcon.falconInstallComplete = function()


[11/16] git commit: [flex-utilities] [refs/heads/develop] - Fix installation errors. Copy the correct mxmlc files.

Posted by bi...@apache.org.
Fix installation errors.  Copy the correct mxmlc files.


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

Branch: refs/heads/develop
Commit: f7577b293e4fb82ddd63a6de28f80209542b7727
Parents: 3cff1f7
Author: OmPrakash Muppirala <bi...@gmail.com>
Authored: Sat Jan 2 01:13:13 2016 -0800
Committer: OmPrakash Muppirala <bi...@gmail.com>
Committed: Sun Mar 13 00:44:19 2016 -0800

----------------------------------------------------------------------
 npm-flexjs/.npmignore                        |  2 +-
 npm-flexjs/dependencies/AdobeAIR.js          | 16 ++------
 npm-flexjs/dependencies/ApacheFalcon.js      | 23 +++++++++++-
 npm-flexjs/dependencies/ApacheFlexJS.js      |  4 +-
 npm-flexjs/dependencies/FlashPlayerGlobal.js |  2 +-
 npm-flexjs/dependencies/SWFObject.js         | 45 ++++++++++++++++++++---
 6 files changed, 69 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/f7577b29/npm-flexjs/.npmignore
----------------------------------------------------------------------
diff --git a/npm-flexjs/.npmignore b/npm-flexjs/.npmignore
index 916dd3d..29b636a 100644
--- a/npm-flexjs/.npmignore
+++ b/npm-flexjs/.npmignore
@@ -1,2 +1,2 @@
 .idea
-.iml
\ No newline at end of file
+*.iml
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/f7577b29/npm-flexjs/dependencies/AdobeAIR.js
----------------------------------------------------------------------
diff --git a/npm-flexjs/dependencies/AdobeAIR.js b/npm-flexjs/dependencies/AdobeAIR.js
index bcfad50..791f5fe 100644
--- a/npm-flexjs/dependencies/AdobeAIR.js
+++ b/npm-flexjs/dependencies/AdobeAIR.js
@@ -32,7 +32,7 @@ var AdobeAIR = module.exports = Object.create(events.EventEmitter.prototype);
 var AdobeAIRURL = 'http://airdownload.adobe.com/air/win/download/19.0/';
 var fileNameAdobeAIR = 'AdobeAIRSDK.zip';
 var adobeAirPromptText = "\
-Apache Flex SDK uses the Adobe AIR SDK to build Adobe AIR applications.\n\
+Apache FlexJS SDK uses the Adobe AIR SDK to build Adobe AIR applications.\n\
 The Adobe AIR SDK is subject to and governed by the\n\
 Adobe AIR SDK License Agreement specified here:\n\
 http://www.adobe.com/products/air/sdk-eula.html.\n\
@@ -66,21 +66,11 @@ function promptForAdobeAIR()
 
 function downloadAdobeAIR()
 {
-    /*var downloadDetails = {
-        url:AdobeAIRURL,
-        remoteFileName:fileNameAdobeAIR,
-        destinationPath:constants.DOWNLOADS_FOLDER,
-        destinationFileName:'adobeair',
-        unzip:true
-    };
-    duc.on('installComplete', handleInstallComplete);
-    duc.install(downloadDetails);*/
-
     console.log('Downloading Adobe AIR from ' + AdobeAIRURL + fileNameAdobeAIR);
     request
         .get(AdobeAIRURL + fileNameAdobeAIR)
         .pipe(fs.createWriteStream(constants.DOWNLOADS_FOLDER + fileNameAdobeAIR)
-            .on('finish', function(){
+            .on('close', function(){
                 console.log('Adobe AIR download complete');
                 extract();
             })
@@ -92,7 +82,7 @@ function extract()
     console.log('Extracting Adobe AIR');
     fs.createReadStream(constants.DOWNLOADS_FOLDER + fileNameAdobeAIR)
         .pipe(unzip.Extract({ path: constants.FLEXJS_FOLDER })
-            .on('finish', function(){
+            .on('close', function(){
                 console.log('Adobe AIR extraction complete');
                 AdobeAIR.emit('complete');
             })

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/f7577b29/npm-flexjs/dependencies/ApacheFalcon.js
----------------------------------------------------------------------
diff --git a/npm-flexjs/dependencies/ApacheFalcon.js b/npm-flexjs/dependencies/ApacheFalcon.js
index 5a7f873..610afbb 100644
--- a/npm-flexjs/dependencies/ApacheFalcon.js
+++ b/npm-flexjs/dependencies/ApacheFalcon.js
@@ -254,6 +254,15 @@ ApacheFalcon.prepareForFalconDependencies = function()
         if ( e.code != 'EEXIST' ) throw e;
     }
 
+    try
+    {
+        mkdirp(constants.FLEXJS_FOLDER + 'lib/external');
+    }
+    catch(e)
+    {
+        if ( e.code != 'EEXIST' ) throw e;
+    }
+
     ApacheFalcon.downloadDependencies();
 };
 
@@ -311,7 +320,19 @@ ApacheFalcon.copyFiles = function()
         constants.FLEXJS_FOLDER + 'externs',
         'overwrite');
 
-// Bin-legacy TODO:FIXME
+    mergedirs.default(constants.DOWNLOADS_FOLDER + 'falcon/compiler/generated/dist/sdk/lib',
+        constants.FLEXJS_FOLDER + 'lib',
+        'overwrite');
+
+    mergedirs.default(constants.DOWNLOADS_FOLDER + 'falcon/compiler/lib',
+        constants.FLEXJS_FOLDER + 'lib/external',
+        'overwrite');
+
+/*    fs.createReadStream(constants.DOWNLOADS_FOLDER + 'falcon/compiler/generated/dist/sdk/lib/' + 'falcon-mxmlc.jar')
+        .pipe(fs.createWriteStream(jsLibFolder + 'mxmlc.jar'));
+
+    fs.createReadStream(constants.DOWNLOADS_FOLDER + 'falcon/compiler/generated/dist/sdk/lib/' + 'falcon-mxmlc.jar')
+        .pipe(fs.createWriteStream(constants.FLEXJS_FOLDER + 'lib/' + 'mxmlc.jar'));*/
 
 // Ant TODO:FIXME
 

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/f7577b29/npm-flexjs/dependencies/ApacheFlexJS.js
----------------------------------------------------------------------
diff --git a/npm-flexjs/dependencies/ApacheFlexJS.js b/npm-flexjs/dependencies/ApacheFlexJS.js
index 23e79f6..d806678 100644
--- a/npm-flexjs/dependencies/ApacheFlexJS.js
+++ b/npm-flexjs/dependencies/ApacheFlexJS.js
@@ -41,7 +41,7 @@ ApacheFlexJS.handleFlexJSMirrorsResponse = function (error, response, body)
         request
             .get(flexJSPreferredDownloadURL)
             .pipe(fs.createWriteStream(constants.DOWNLOADS_FOLDER + fileNameFlexJSBinary)
-                .on('finish', function(){
+                .on('close', function(){
                     console.log('Apache FlexJS download complete');
                     ApacheFlexJS.extract();
                 })
@@ -54,7 +54,7 @@ ApacheFlexJS.extract = function()
     console.log('Extracting Apache FlexJS');
     fs.createReadStream(constants.DOWNLOADS_FOLDER + fileNameFlexJSBinary)
         .pipe(unzip.Extract({ path: constants.FLEXJS_FOLDER })
-            .on('finish', function(){
+            .on('close', function(){
                 console.log('Apache FlexJS extraction complete');
                 ApacheFlexJS.emit('complete');
             })

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/f7577b29/npm-flexjs/dependencies/FlashPlayerGlobal.js
----------------------------------------------------------------------
diff --git a/npm-flexjs/dependencies/FlashPlayerGlobal.js b/npm-flexjs/dependencies/FlashPlayerGlobal.js
index ff15bdf..158c747 100644
--- a/npm-flexjs/dependencies/FlashPlayerGlobal.js
+++ b/npm-flexjs/dependencies/FlashPlayerGlobal.js
@@ -31,7 +31,7 @@ var FlashPlayerGlobal = module.exports = Object.create(events.EventEmitter.proto
 var flashPlayerGlobalURL = 'http://download.macromedia.com/get/flashplayer/updaters/19/';
 var fileNameFlashPlayerGlobal = 'playerglobal19_0.swc';
 var flashPlayerGlobalPromptText = "\
-    Apache Flex SDK uses the Adobe Flash Player's playerglobal.swc to build Adobe Flash applications.\n\
+    Apache FlexJS SDK uses the Adobe Flash Player's playerglobal.swc to build Adobe Flash applications.\n\
     \n\
     The playerglobal.swc file is subject to and governed by the\n\
     Adobe Flex SDK License Agreement specified here:\n\

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/f7577b29/npm-flexjs/dependencies/SWFObject.js
----------------------------------------------------------------------
diff --git a/npm-flexjs/dependencies/SWFObject.js b/npm-flexjs/dependencies/SWFObject.js
index 5212c4f..4716d2e 100644
--- a/npm-flexjs/dependencies/SWFObject.js
+++ b/npm-flexjs/dependencies/SWFObject.js
@@ -21,29 +21,64 @@
 var request = require('request');
 var fs = require('fs');
 var events = require('events');
+var unzip = require('unzip');
+var mkdirp = require('mkdirp');
 
 var constants = require('../dependencies/Constants');
 
 var SWFObject = module.exports = Object.create(events.EventEmitter.prototype);
 
 //SWFObject
-//var swfObjectURL = 'https://github.com/swfobject/swfobject/archive/2.2.zip';
-var swfObjectURL = 'https://swfobject.googlecode.com/files/';
-var fileNameSwfObject = 'swfobject_2_2.zip';
+var swfObjectURL = 'http://github.com/swfobject/swfobject/archive/';
+var fileNameSwfObject = '2.2.zip';
 
 SWFObject.downloadSwfObject = function()
 {
     console.log('Downloading SWFObject');
     request
-        .get(swfObjectURL)
+        .get(swfObjectURL + fileNameSwfObject)
         .pipe(fs.createWriteStream(constants.DOWNLOADS_FOLDER + fileNameSwfObject)
             .on('finish', function(){
                 console.log('SWFObject download complete');
-                SWFObject.emit('complete');
+                extract();
             })
     );
 };
 
+function extract()
+{
+    try
+    {
+        mkdirp(constants.FLEXJS_FOLDER + 'templates/swfobject');
+    }
+    catch(e)
+    {
+        if ( e.code != 'EEXIST' ) throw e;
+    }
+    console.log('Extracting SWFObject');
+    fs.createReadStream(constants.DOWNLOADS_FOLDER + fileNameSwfObject)
+        .pipe(unzip.Parse())
+        .on('entry', function (entry) {
+            var fileName = entry.path;
+            var type = entry.type; // 'Directory' or 'File'
+            var size = entry.size;
+            if (fileName === 'swfobject-2.2/swfobject/expressInstall.swf') {
+                entry.pipe(fs.createWriteStream(constants.FLEXJS_FOLDER + 'templates/swfobject/expressInstall.swf'));
+            }
+            else if(fileName === 'swfobject-2.2/swfobject/swfobject.js') {
+                entry.pipe(fs.createWriteStream(constants.FLEXJS_FOLDER + 'templates/swfobject/swfobject.js'));
+            }
+            else {
+                entry.autodrain();
+            }
+        })
+        .on('finish', function(){
+            console.log('SWFObject extraction complete');
+            SWFObject.emit('complete');
+        })
+
+}
+
 SWFObject.install = function()
 {
     SWFObject.downloadSwfObject();


[08/16] git commit: [flex-utilities] [refs/heads/develop] - All dependencies are getting downloaded now, at least on Windows.

Posted by bi...@apache.org.
All dependencies are getting downloaded now, at least on Windows.


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

Branch: refs/heads/develop
Commit: 5dcd4c8c6e0a314b6127cd04515c8946e2f80ad2
Parents: 9a6f4ac
Author: OmPrakash Muppirala <bi...@gmail.com>
Authored: Sun Dec 27 01:34:31 2015 -0800
Committer: OmPrakash Muppirala <bi...@gmail.com>
Committed: Sun Mar 13 00:44:13 2016 -0800

----------------------------------------------------------------------
 npm-flexjs/dependencies/ApacheFalcon.js         | 167 ++++++++++++++-----
 .../dependencies/DownloadUncompressAndCopy.js   |  36 ++--
 npm-flexjs/package.json                         |   2 +
 3 files changed, 136 insertions(+), 69 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/5dcd4c8c/npm-flexjs/dependencies/ApacheFalcon.js
----------------------------------------------------------------------
diff --git a/npm-flexjs/dependencies/ApacheFalcon.js b/npm-flexjs/dependencies/ApacheFalcon.js
index 60091ba..5a7f873 100644
--- a/npm-flexjs/dependencies/ApacheFalcon.js
+++ b/npm-flexjs/dependencies/ApacheFalcon.js
@@ -34,6 +34,8 @@ var ApacheFalcon = module.exports = Object.create(events.EventEmitter.prototype)
 var pathToFalconBinary = 'flex/falcon/0.5.0/binaries/';
 var fileNameFalconBinary = 'apache-flex-falconjx-0.5.0-bin.zip';
 var falconCompilerLibFolder = 'falcon/compiler/lib/';
+var jsLibFolder = constants.FLEXJS_FOLDER + 'js/lib/';
+var googleClosureCompilerFolder =  constants.FLEXJS_FOLDER + 'js/lib/google/closure-compiler/';
 
 //Antlr
 var antlrURL = 'http://search.maven.org/remotecontent?filepath=org/antlr/antlr-complete/3.5.2/antlr-complete-3.5.2.jar';
@@ -107,6 +109,52 @@ var falconDependencies = [
         destinationPath:constants.DOWNLOADS_FOLDER + falconCompilerLibFolder,
         destinationFileName:'flex-tool-api.jar',
         unzip:false
+    },
+    {
+        url:'http://search.maven.org/remotecontent?filepath=/args4j/args4j/2.0.28/',
+        remoteFileName:'args4j-2.0.28.jar',
+        destinationPath:jsLibFolder,
+        destinationFileName:'args4j.jar',
+        unzip:false
+    },
+    {
+        url:'http://dl.google.com/closure-compiler/',
+        remoteFileName:'compiler-20150609.zip',
+        destinationPath:constants.DOWNLOADS_FOLDER,
+        destinationFileName:'compiler-20150609.zip',
+        pathOfFileToBeCopiedFrom:'compiler.jar',
+        pathOfFileToBeCopiedTo:googleClosureCompilerFolder + 'compiler.jar',
+        unzip:true
+    },
+    {
+        url:'http://archive.apache.org/dist/commons/io/binaries/',
+        remoteFileName:'commons-io-2.4-bin.zip',
+        destinationPath:constants.DOWNLOADS_FOLDER,
+        destinationFileName:'commons-io-2.4-bin.zip',
+        pathOfFileToBeCopiedFrom:'commons-io-2.4/commons-io-2.4.jar',
+        pathOfFileToBeCopiedTo:jsLibFolder + 'commons-io.jar',
+        unzip:true
+    },
+    {
+        url:'http://search.maven.org/remotecontent?filepath=/com/google/guava/guava/17.0/',
+        remoteFileName:'guava-17.0.jar',
+        destinationPath:jsLibFolder,
+        destinationFileName:'guava.jar',
+        unzip:false
+    },
+    {
+        url:'http://search.maven.org/remotecontent?filepath=/org/codeartisans/org.json/20131017/',
+        remoteFileName:'org.json-20131017.jar',
+        destinationPath:jsLibFolder,
+        destinationFileName:'org.json.jar',
+        unzip:false
+    },
+    {
+        url:'http://search.maven.org/remotecontent?filepath=/org/apache/flex/flex-tool-api/1.0.0/',
+        remoteFileName:'flex-tool-api-1.0.0.jar',
+        destinationPath:jsLibFolder,
+        destinationFileName:'flex-tool-api.jar',
+        unzip:false
     }
 ];
 
@@ -151,6 +199,61 @@ ApacheFalcon.prepareForFalconDependencies = function()
     {
         if ( e.code != 'EEXIST' ) throw e;
     }
+    try
+    {
+        fs.mkdirSync(googleClosureCompilerFolder);
+    }
+    catch(e)
+    {
+        if ( e.code != 'EEXIST' ) throw e;
+    }
+
+    try
+    {
+        mkdirp(constants.FLEXJS_FOLDER + 'js/bin');
+    }
+    catch(e)
+    {
+        if ( e.code != 'EEXIST' ) throw e;
+    }
+
+    try
+    {
+        mkdirp(constants.FLEXJS_FOLDER + 'js/lib');
+    }
+    catch(e)
+    {
+        if ( e.code != 'EEXIST' ) throw e;
+    }
+
+    try
+    {
+        mkdirp(constants.FLEXJS_FOLDER + 'js/libs');
+    }
+    catch(e)
+    {
+        if ( e.code != 'EEXIST' ) throw e;
+    }
+
+    try
+    {
+        mkdirp(constants.FLEXJS_FOLDER + 'externs');
+    }
+    catch(e)
+    {
+        if ( e.code != 'EEXIST' ) throw e;
+    }
+
+    //Create downloads directory if it does not exist already
+    try
+    {
+        mkdirp(constants.FLEXJS_FOLDER + 'bin');
+    }
+    catch(e)
+    {
+        if ( e.code != 'EEXIST' ) throw e;
+    }
+
     ApacheFalcon.downloadDependencies();
 };
 
@@ -171,7 +274,7 @@ ApacheFalcon.downloadNextDependency = function()
     }
     else
     {
-        duc.on("installComplete", handleDependencyInstallComplete);
+        duc.once("installComplete", handleDependencyInstallComplete);
         duc.install(falconDependencies[currentStep]);
     }
 };
@@ -183,61 +286,37 @@ function handleDependencyInstallComplete(event)
 
 ApacheFalcon.dependenciesComplete = function()
 {
-    duc.removeListener("installComplete", handleDependencyInstallComplete);
-    copyFiles();
+    ApacheFalcon.copyFiles();
     ApacheFalcon.falconInstallComplete();
 };
 
-function copyFiles()
+ApacheFalcon.copyFiles = function()
 {
-    //Ant TODO:FIXME
+    var mergedirs = require('merge-dirs');
 
     //Bin
-    //Create downloads directory if it does not exist already
-    try
-    {
-        mkdirp(constants.FLEXJS_FOLDER + 'bin');
-    }
-    catch(e)
-    {
-        if ( e.code != 'EEXIST' ) throw e;
-    }
-    wrench.copyDirSyncRecursive(constants.DOWNLOADS_FOLDER + 'falcon/compiler/generated/dist/sdk/bin',
-        constants.FLEXJS_FOLDER + 'bin', {
-            forceDelete: true
-        });
-
-    //Bin-legacy TODO:FIXME
+    mergedirs.default(constants.DOWNLOADS_FOLDER + 'falcon/compiler/generated/dist/sdk/bin',
+        constants.FLEXJS_FOLDER + 'bin',
+        'overwrite');
 
     //copyfiles.jx copy FalconJX files into SDK
-    try
-    {
-        mkdirp(constants.FLEXJS_FOLDER + 'js/bin');
-        mkdirp(constants.FLEXJS_FOLDER + 'js/lib');
-        mkdirp(constants.FLEXJS_FOLDER + 'js/libs');
-        mkdirp(constants.FLEXJS_FOLDER + 'externs');
-    }
-    catch(e)
-    {
-        if ( e.code != 'EEXIST' ) throw e;
-    }
+    mergedirs.default(constants.DOWNLOADS_FOLDER + 'falcon/js/lib',
+        constants.FLEXJS_FOLDER + 'js/lib',
+        'overwrite');
+    mergedirs.default(constants.DOWNLOADS_FOLDER + 'falcon/js/libs',
+        constants.FLEXJS_FOLDER + 'js/libs',
+        'overwrite');
 
-    wrench.copyDirSyncRecursive(constants.DOWNLOADS_FOLDER + 'falcon/js/lib',
-        constants.FLEXJS_FOLDER + 'js/lib', {
-            forceDelete: true
-        });
+    mergedirs.default(constants.DOWNLOADS_FOLDER + 'falcon/externs',
+        constants.FLEXJS_FOLDER + 'externs',
+        'overwrite');
 
-    wrench.copyDirSyncRecursive(constants.DOWNLOADS_FOLDER + 'falcon/js/libs',
-        constants.FLEXJS_FOLDER + 'js/libs', {
-            forceDelete: true
-        });
+// Bin-legacy TODO:FIXME
 
-    wrench.copyDirSyncRecursive(constants.DOWNLOADS_FOLDER + 'falcon/externs',
-        constants.FLEXJS_FOLDER + 'externs', {
-            forceDelete: true
-        });
+// Ant TODO:FIXME
+
+};
 
-}
 
 ApacheFalcon.falconInstallComplete = function()
 {

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/5dcd4c8c/npm-flexjs/dependencies/DownloadUncompressAndCopy.js
----------------------------------------------------------------------
diff --git a/npm-flexjs/dependencies/DownloadUncompressAndCopy.js b/npm-flexjs/dependencies/DownloadUncompressAndCopy.js
index d15e18f..2546359 100644
--- a/npm-flexjs/dependencies/DownloadUncompressAndCopy.js
+++ b/npm-flexjs/dependencies/DownloadUncompressAndCopy.js
@@ -19,9 +19,8 @@
 
 
 var request = require('request');
-var fs = require('fs');
+var fs = require('fs-extra');
 var events = require('events');
-var prompt = require('prompt');
 var unzip = require('unzip');
 var constants = require('../dependencies/Constants');
 
@@ -33,28 +32,12 @@ DownloadUncompressAndCopy.downloadFile = function(item)
     request
         .get(item.url + item.remoteFileName)
         .pipe(fs.createWriteStream(constants.DOWNLOADS_FOLDER + item.remoteFileName)
-            .on('finish', function(){
+            .on('close', function(){
                 console.log('Finished downloading: ' + item.url + item.remoteFileName);
                 if(item.unzip)
                 {//Unzip
                     console.log('Uncompressing:  ' + constants.DOWNLOADS_FOLDER + item.remoteFileName);
                     fs.createReadStream(constants.DOWNLOADS_FOLDER + item.remoteFileName)
-                    /*.pipe(unzip.Extract({ path: item.destinationPath + item.destinationFileName})
-                            .on('finish', function(){
-                                console.log('Finished uncompressing: ' + constants.DOWNLOADS_FOLDER + item.remoteFileName + ' to: ' + item.destinationPath + item.destinationFileName);
-                                if(item.pathOfFileToBeCopiedTo != undefined)
-                                {
-                                    fs.createReadStream(item.pathOfFileToBeCopiedFrom)
-                                        .pipe(fs.createWriteStream(item.pathOfFileToBeCopiedTo)
-                                        .on('finish',function(){
-                                        DownloadUncompressAndCopy.emit('installComplete');
-                                    }));
-                                }
-                                else
-                                {
-                                    DownloadUncompressAndCopy.emit('installComplete');
-                                }
-                            })*/
                         .pipe(unzip.Parse())
                         .on('entry', function (entry) {
                             var fileName = entry.path;
@@ -74,16 +57,19 @@ DownloadUncompressAndCopy.downloadFile = function(item)
                 }
                 else
                 {//Just copy
-                    if((constants.DOWNLOADS_FOLDER + item.remoteFileName == item.destinationPath + item.destinationFileName))
+                    if((constants.DOWNLOADS_FOLDER + item.remoteFileName === item.destinationPath + item.destinationFileName))
                     {
                         DownloadUncompressAndCopy.emit('installComplete');
                     }
-                    else {
+                    else
+                    {
                         fs.createReadStream(constants.DOWNLOADS_FOLDER + item.remoteFileName)
-                            .pipe(fs.createWriteStream(item.destinationPath + item.destinationFileName)
-                                .on('finish',function() {
-                                    DownloadUncompressAndCopy.emit('installComplete');
-                                }));
+                            .pipe(fs.createWriteStream(item.destinationPath + item.destinationFileName))
+                            .on('close', function(){
+                                console.log("Copied " + constants.DOWNLOADS_FOLDER + item.remoteFileName + " to " +
+                                    item.destinationPath + item.destinationFileName);
+                                DownloadUncompressAndCopy.emit('installComplete');
+                            });
                     }
                 }
             })

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/5dcd4c8c/npm-flexjs/package.json
----------------------------------------------------------------------
diff --git a/npm-flexjs/package.json b/npm-flexjs/package.json
index fa3a420..149eb7e 100644
--- a/npm-flexjs/package.json
+++ b/npm-flexjs/package.json
@@ -20,6 +20,8 @@
   "author": "OmPrakash Muppirala <bi...@apache.org>",
   "license": "Apache-2.0",
   "dependencies": {
+    "fs-extra": "^0.26.3",
+    "merge-dirs": "^0.2.1",
     "mkdirp": "^0.5.1",
     "prompt": "^0.2.14",
     "request": "^2.67.0",


[10/16] git commit: [flex-utilities] [refs/heads/develop] - Add shim asjsc and asjscompc because npm install registers global binaries before install starts.

Posted by bi...@apache.org.
Add shim asjsc and asjscompc because npm install registers global binaries before install starts.


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

Branch: refs/heads/develop
Commit: 3cff1f7bd155f5e6ac7f54d7d2f2a3e50aed2672
Parents: 4aef713
Author: OmPrakash Muppirala <bi...@gmail.com>
Authored: Mon Dec 28 01:40:35 2015 -0800
Committer: OmPrakash Muppirala <bi...@gmail.com>
Committed: Sun Mar 13 00:44:17 2016 -0800

----------------------------------------------------------------------
 npm-flexjs/.npmignore                            | 2 ++
 npm-flexjs/dependencies/Constants.js             | 4 ++--
 npm-flexjs/dependencies/download_dependencies.js | 2 +-
 npm-flexjs/js/bin/asjsc                          | 0
 npm-flexjs/js/bin/asjscompc                      | 0
 npm-flexjs/package.json                          | 2 +-
 6 files changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/3cff1f7b/npm-flexjs/.npmignore
----------------------------------------------------------------------
diff --git a/npm-flexjs/.npmignore b/npm-flexjs/.npmignore
new file mode 100644
index 0000000..916dd3d
--- /dev/null
+++ b/npm-flexjs/.npmignore
@@ -0,0 +1,2 @@
+.idea
+.iml
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/3cff1f7b/npm-flexjs/dependencies/Constants.js
----------------------------------------------------------------------
diff --git a/npm-flexjs/dependencies/Constants.js b/npm-flexjs/dependencies/Constants.js
index 513b090..cc5ec1e 100644
--- a/npm-flexjs/dependencies/Constants.js
+++ b/npm-flexjs/dependencies/Constants.js
@@ -22,7 +22,7 @@ module.exports =
 {
     APACHE_MIRROR_RESOLVER_URL : 'http://www.apache.org/dyn/mirrors/mirrors.cgi/',
     REQUEST_JSON_PARAM : 'asjson=true',
-    DOWNLOADS_FOLDER : './flexjs/downloads/',
-    FLEXJS_FOLDER: './flexjs/',
+    DOWNLOADS_FOLDER : './downloads/',
+    FLEXJS_FOLDER: './',
     NODE_MODULES_FOLDER: './node_modules/'
 };
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/3cff1f7b/npm-flexjs/dependencies/download_dependencies.js
----------------------------------------------------------------------
diff --git a/npm-flexjs/dependencies/download_dependencies.js b/npm-flexjs/dependencies/download_dependencies.js
index 60f9f78..09b9858 100644
--- a/npm-flexjs/dependencies/download_dependencies.js
+++ b/npm-flexjs/dependencies/download_dependencies.js
@@ -108,4 +108,4 @@ function allDownloadsComplete()
     console.log('Finished all downloads');
 }
 
-start();
+start();
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/3cff1f7b/npm-flexjs/js/bin/asjsc
----------------------------------------------------------------------
diff --git a/npm-flexjs/js/bin/asjsc b/npm-flexjs/js/bin/asjsc
new file mode 100644
index 0000000..e69de29

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/3cff1f7b/npm-flexjs/js/bin/asjscompc
----------------------------------------------------------------------
diff --git a/npm-flexjs/js/bin/asjscompc b/npm-flexjs/js/bin/asjscompc
new file mode 100644
index 0000000..e69de29

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/3cff1f7b/npm-flexjs/package.json
----------------------------------------------------------------------
diff --git a/npm-flexjs/package.json b/npm-flexjs/package.json
index 3786a97..96386d5 100644
--- a/npm-flexjs/package.json
+++ b/npm-flexjs/package.json
@@ -12,6 +12,7 @@
     "angularjs",
     "reactjs"
   ],
+  "homepage": "http://flex.apache.org",
   "author": "OmPrakash Muppirala <bi...@apache.org>",
   "license": "Apache-2.0",
   "dependencies": {
@@ -24,7 +25,6 @@
     "wrench": "^1.5.8"
   },
   "scripts": {
-    "pre": "npm install",
     "postinstall": "node dependencies/download_dependencies.js"
   },
   "bin": {


[14/16] git commit: [flex-utilities] [refs/heads/develop] - Add mxmlc support

Posted by bi...@apache.org.
Add mxmlc support


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

Branch: refs/heads/develop
Commit: a5747a34c0b9318f768f77684f14fa21c4d37c2f
Parents: eae0c86
Author: OmPrakash Muppirala <bi...@gmail.com>
Authored: Mon Jan 4 15:28:16 2016 -0800
Committer: OmPrakash Muppirala <bi...@gmail.com>
Committed: Sun Mar 13 00:44:24 2016 -0800

----------------------------------------------------------------------
 npm-flexjs/dependencies/ApacheFalcon.js | 8 ++++----
 npm-flexjs/package.json                 | 3 ++-
 2 files changed, 6 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/a5747a34/npm-flexjs/dependencies/ApacheFalcon.js
----------------------------------------------------------------------
diff --git a/npm-flexjs/dependencies/ApacheFalcon.js b/npm-flexjs/dependencies/ApacheFalcon.js
index 554d93c..415927d 100644
--- a/npm-flexjs/dependencies/ApacheFalcon.js
+++ b/npm-flexjs/dependencies/ApacheFalcon.js
@@ -165,12 +165,12 @@ ApacheFalcon.handleFalconMirrorsResponse = function (error, response, body)
     {
         var mirrors = JSON.parse(body);
         var falconPreferredDownloadURL = mirrors.preferred + pathToFalconBinary + fileNameFalconBinary;
-        console.log('Downloading Apache Falcon');
+        console.log('Downloading Apache Flex Falcon Compiler');
         request
             .get(falconPreferredDownloadURL)
             .pipe(fs.createWriteStream(constants.DOWNLOADS_FOLDER + fileNameFalconBinary)
                 .on('finish', function(){
-                    console.log('Apache Falcon download complete');
+                    console.log('Apache Flex Falcon Compiler download complete');
                     ApacheFalcon.extract();
                 })
         );
@@ -179,11 +179,11 @@ ApacheFalcon.handleFalconMirrorsResponse = function (error, response, body)
 
 ApacheFalcon.extract = function()
 {
-    console.log('Extracting Apache Falcon');
+    console.log('Extracting Apache Flex Falcon Compiler');
     fs.createReadStream(constants.DOWNLOADS_FOLDER + fileNameFalconBinary)
         .pipe(unzip.Extract({ path: constants.DOWNLOADS_FOLDER + 'falcon'})
             .on('finish', function(){
-                console.log('Apache Falcon extraction complete');
+                console.log('Apache Flex Falcon Compiler extraction complete');
                 ApacheFalcon.prepareForFalconDependencies();
             })
     );

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/a5747a34/npm-flexjs/package.json
----------------------------------------------------------------------
diff --git a/npm-flexjs/package.json b/npm-flexjs/package.json
index 7c6f756..bd3ac59 100644
--- a/npm-flexjs/package.json
+++ b/npm-flexjs/package.json
@@ -30,6 +30,7 @@
   },
   "bin": {
     "asjsc": "./js/bin/asjscnpm",
-    "asjscompc": "./js/bin/asjscompcnpm"
+    "asjscompc": "./js/bin/asjscompcnpm",
+    "mxmlc": "./js/bin/mxmlcnpm"
   }
 }
\ No newline at end of file


[13/16] git commit: [flex-utilities] [refs/heads/develop] - Fix config files as needed. Remove unnecessary echos from scripts.

Posted by bi...@apache.org.
Fix config files as needed.  Remove unnecessary echos from scripts.


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

Branch: refs/heads/develop
Commit: eae0c86e88fc6d728555cd3d02244de484a8748b
Parents: c873044
Author: OmPrakash Muppirala <bi...@gmail.com>
Authored: Mon Jan 4 01:03:46 2016 -0800
Committer: OmPrakash Muppirala <bi...@gmail.com>
Committed: Sun Mar 13 00:44:23 2016 -0800

----------------------------------------------------------------------
 npm-flexjs/dependencies/ApacheFalcon.js | 66 ++++++++++++++++++++++++++++
 npm-flexjs/js/bin/asjscnpm              | 14 +-----
 npm-flexjs/js/bin/asjscompcnpm          | 15 ++-----
 npm-flexjs/package.json                 |  3 +-
 4 files changed, 73 insertions(+), 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/eae0c86e/npm-flexjs/dependencies/ApacheFalcon.js
----------------------------------------------------------------------
diff --git a/npm-flexjs/dependencies/ApacheFalcon.js b/npm-flexjs/dependencies/ApacheFalcon.js
index 610afbb..554d93c 100644
--- a/npm-flexjs/dependencies/ApacheFalcon.js
+++ b/npm-flexjs/dependencies/ApacheFalcon.js
@@ -24,6 +24,7 @@ var events = require('events');
 var unzip = require('unzip');
 var wrench = require('wrench');
 var mkdirp = require('mkdirp');
+var replace = require('replace');
 
 var constants = require('../dependencies/Constants');
 var duc = require('../dependencies/DownloadUncompressAndCopy');
@@ -296,11 +297,14 @@ function handleDependencyInstallComplete(event)
 ApacheFalcon.dependenciesComplete = function()
 {
     ApacheFalcon.copyFiles();
+    ApacheFalcon.fixConfigFiles();
     ApacheFalcon.falconInstallComplete();
 };
 
 ApacheFalcon.copyFiles = function()
 {
+    console.log('Copying lib and bin directories');
+
     var mergedirs = require('merge-dirs');
 
     //Bin
@@ -338,6 +342,68 @@ ApacheFalcon.copyFiles = function()
 
 };
 
+ApacheFalcon.fixConfigFiles = function()
+{
+
+    console.log('Updating Config files');
+
+    fs.createReadStream(constants.FLEXJS_FOLDER + 'frameworks/flex-config-template.xml')
+        .pipe(fs.createWriteStream(constants.FLEXJS_FOLDER + 'frameworks/flex-config.xml'))
+        .on('close', function(){
+            replace({
+                regex: "@playerversion@",
+                replacement: "19.0",
+                paths: [constants.FLEXJS_FOLDER + 'frameworks/flex-config.xml'],
+                recursive: false,
+                silent: false
+            });
+
+            replace({
+                regex: "@swfversion@",
+                replacement: "30",
+                paths: [constants.FLEXJS_FOLDER + 'frameworks/flex-config.xml'],
+                recursive: false,
+                silent: false
+            });
+
+            replace({
+                regex: "{playerglobalHome}",
+                replacement: "libs/player",
+                paths: [constants.FLEXJS_FOLDER + 'frameworks/flex-config.xml'],
+                recursive: false,
+                silent: false
+            });
+        });
+
+    fs.createReadStream(constants.FLEXJS_FOLDER + 'frameworks/air-config-template.xml')
+        .pipe(fs.createWriteStream(constants.FLEXJS_FOLDER + 'frameworks/air-config.xml'))
+        .on('close', function(){
+            replace({
+                regex: "@playerversion@",
+                replacement: "19.0",
+                paths: [constants.FLEXJS_FOLDER + 'frameworks/air-config.xml'],
+                recursive: false,
+                silent: false
+            });
+
+            replace({
+                regex: "@swfversion@",
+                replacement: "30",
+                paths: [constants.FLEXJS_FOLDER + 'frameworks/air-config.xml'],
+                recursive: false,
+                silent: false
+            });
+
+            replace({
+                regex: "{airHome}/frameworks/libs",
+                replacement: "libs",
+                paths: [constants.FLEXJS_FOLDER + 'frameworks/air-config.xml'],
+                recursive: false,
+                silent: false
+            });
+        });
+
+};
 
 ApacheFalcon.falconInstallComplete = function()
 {

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/eae0c86e/npm-flexjs/js/bin/asjscnpm
----------------------------------------------------------------------
diff --git a/npm-flexjs/js/bin/asjscnpm b/npm-flexjs/js/bin/asjscnpm
index 65ea3a9..6481ed3 100644
--- a/npm-flexjs/js/bin/asjscnpm
+++ b/npm-flexjs/js/bin/asjscnpm
@@ -26,18 +26,8 @@
 #
 
 SCRIPT_HOME=`dirname $0`
-if [ "x${FALCON_HOME}" = "x" ]
-then
-    FALCON_HOME=${SCRIPT_HOME}/../..
-fi
-
-echo Using Falcon codebase: $FALCON_HOME
-
-if [ "x${FLEX_HOME}" = "x" ]
-then
-    FLEX_HOME=${SCRIPT_HOME}/../..
-fi
-echo Using Flex SDK: $FLEX_HOME
+FALCON_HOME=${SCRIPT_HOME}/../..
+FLEX_HOME=${SCRIPT_HOME}/../..
 
 case `uname` in
 		CYGWIN*)

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/eae0c86e/npm-flexjs/js/bin/asjscompcnpm
----------------------------------------------------------------------
diff --git a/npm-flexjs/js/bin/asjscompcnpm b/npm-flexjs/js/bin/asjscompcnpm
index 7df2b89..f2944a8 100644
--- a/npm-flexjs/js/bin/asjscompcnpm
+++ b/npm-flexjs/js/bin/asjscompcnpm
@@ -25,19 +25,10 @@
 # In Windows Command Prompt, use mxmlc.bat instead.
 #
 
-if [ "x${FALCON_HOME}" = "x" ]
-then
-    SCRIPT_HOME=`dirname $0`
-    FALCON_HOME=${SCRIPT_HOME}/../..
-fi
-
-echo Using Falcon codebase: $FALCON_HOME
 
-if [ "x${FLEX_HOME}" = "x" ]
-then
-    FLEX_HOME=${SCRIPT_HOME}/../..
-fi
-echo Using Flex SDK: $FLEX_HOME
+SCRIPT_HOME=`dirname $0`
+FALCON_HOME=${SCRIPT_HOME}/../..
+FLEX_HOME=${SCRIPT_HOME}/../..
 
 case `uname` in
 		CYGWIN*)

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/eae0c86e/npm-flexjs/package.json
----------------------------------------------------------------------
diff --git a/npm-flexjs/package.json b/npm-flexjs/package.json
index acc5c54..7c6f756 100644
--- a/npm-flexjs/package.json
+++ b/npm-flexjs/package.json
@@ -20,6 +20,7 @@
     "merge-dirs": "^0.2.1",
     "mkdirp": "^0.5.1",
     "prompt": "^0.2.14",
+    "replace": "^0.3.0",
     "request": "^2.67.0",
     "unzip": "^0.1.11",
     "wrench": "^1.5.8"
@@ -31,4 +32,4 @@
     "asjsc": "./js/bin/asjscnpm",
     "asjscompc": "./js/bin/asjscompcnpm"
   }
-}
+}
\ No newline at end of file


[12/16] git commit: [flex-utilities] [refs/heads/develop] - Create asjscnpm and asjscompcnpm and fix the paths in Mac

Posted by bi...@apache.org.
Create asjscnpm and asjscompcnpm and fix the paths in Mac


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

Branch: refs/heads/develop
Commit: c873044b651f0be467040e55e9622318c104affe
Parents: f7577b2
Author: OmPrakash Muppirala <bi...@gmail.com>
Authored: Sat Jan 2 18:31:40 2016 -0800
Committer: OmPrakash Muppirala <bi...@gmail.com>
Committed: Sun Mar 13 00:44:21 2016 -0800

----------------------------------------------------------------------
 npm-flexjs/js/bin/asjsc        |  0
 npm-flexjs/js/bin/asjscnpm     | 73 ++++++++++++++++++++++++++++++++++++
 npm-flexjs/js/bin/asjscompc    |  0
 npm-flexjs/js/bin/asjscompcnpm | 74 +++++++++++++++++++++++++++++++++++++
 npm-flexjs/package.json        |  4 +-
 5 files changed, 149 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/c873044b/npm-flexjs/js/bin/asjsc
----------------------------------------------------------------------
diff --git a/npm-flexjs/js/bin/asjsc b/npm-flexjs/js/bin/asjsc
deleted file mode 100644
index e69de29..0000000

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/c873044b/npm-flexjs/js/bin/asjscnpm
----------------------------------------------------------------------
diff --git a/npm-flexjs/js/bin/asjscnpm b/npm-flexjs/js/bin/asjscnpm
new file mode 100644
index 0000000..65ea3a9
--- /dev/null
+++ b/npm-flexjs/js/bin/asjscnpm
@@ -0,0 +1,73 @@
+#!/bin/sh
+
+################################################################################
+##
+##  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.
+##
+################################################################################
+
+
+#
+# mxmlc shell script to launch falcon-mxmlc.jar on OSX, Unix, or Cygwin.
+# In Windows Command Prompt, use mxmlc.bat instead.
+#
+
+SCRIPT_HOME=`dirname $0`
+if [ "x${FALCON_HOME}" = "x" ]
+then
+    FALCON_HOME=${SCRIPT_HOME}/../..
+fi
+
+echo Using Falcon codebase: $FALCON_HOME
+
+if [ "x${FLEX_HOME}" = "x" ]
+then
+    FLEX_HOME=${SCRIPT_HOME}/../..
+fi
+echo Using Flex SDK: $FLEX_HOME
+
+case `uname` in
+		CYGWIN*)
+			OS="Windows"
+		;;
+		*)
+			OS=Unix
+esac
+
+D32=''
+
+if [ $OS = "Windows" ]; then
+
+	FALCON_HOME=`cygpath -m $FALCON_HOME`
+	FLEX_HOME=`cygpath -m $FLEX_HOME`
+
+elif [ $OS = "Unix" ]; then
+
+    check64="`java -version 2>&1 | grep -i 64-Bit`"
+    isOSX="`uname | grep -i Darwin`"
+    javaVersion="`java -version 2>&1 | awk -F '[ ".]+' 'NR==1 {print $3 "." $4}'`"
+
+    if [ "$isOSX" != "" -a "$HOSTTYPE" = "x86_64" -a "$check64" != "" -a "$javaVersion" = "1.6" ]; then
+        D32='-d32'
+    fi
+    FALCON_HOME="/usr/local/lib/node_modules/flexjs"
+    FLEX_HOME="/usr/local/lib/node_modules/flexjs"
+    SCRIPT_HOME="/usr/local/lib/node_modules/flexjs/js/bin"
+fi
+
+VMARGS="-Xmx384m -Dsun.io.useCanonCaches=false "
+
+java $VMARGS $D32 $SETUP_SH_VMARGS -Dflexcompiler="$FALCON_HOME" -Dflexlib="$FLEX_HOME/frameworks" -jar "$SCRIPT_HOME/../lib/mxmlc.jar" +flexlib="$FLEX_HOME/frameworks" -js-output-type=jsc -external-library-path="$SCRIPT_HOME/../libs/js.swc" "$@"

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/c873044b/npm-flexjs/js/bin/asjscompc
----------------------------------------------------------------------
diff --git a/npm-flexjs/js/bin/asjscompc b/npm-flexjs/js/bin/asjscompc
deleted file mode 100644
index e69de29..0000000

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/c873044b/npm-flexjs/js/bin/asjscompcnpm
----------------------------------------------------------------------
diff --git a/npm-flexjs/js/bin/asjscompcnpm b/npm-flexjs/js/bin/asjscompcnpm
new file mode 100644
index 0000000..7df2b89
--- /dev/null
+++ b/npm-flexjs/js/bin/asjscompcnpm
@@ -0,0 +1,74 @@
+#!/bin/sh
+
+################################################################################
+##
+##  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.
+##
+################################################################################
+
+
+#
+# mxmlc shell script to launch falcon-mxmlc.jar on OSX, Unix, or Cygwin.
+# In Windows Command Prompt, use mxmlc.bat instead.
+#
+
+if [ "x${FALCON_HOME}" = "x" ]
+then
+    SCRIPT_HOME=`dirname $0`
+    FALCON_HOME=${SCRIPT_HOME}/../..
+fi
+
+echo Using Falcon codebase: $FALCON_HOME
+
+if [ "x${FLEX_HOME}" = "x" ]
+then
+    FLEX_HOME=${SCRIPT_HOME}/../..
+fi
+echo Using Flex SDK: $FLEX_HOME
+
+case `uname` in
+		CYGWIN*)
+			OS="Windows"
+		;;
+		*)
+			OS=Unix
+esac
+
+D32=''
+
+if [ $OS = "Windows" ]; then
+
+	FALCON_HOME=`cygpath -m $FALCON_HOME`
+	FLEX_HOME=`cygpath -m $FLEX_HOME`
+
+elif [ $OS = "Unix" ]; then
+
+    check64="`java -version 2>&1 | grep -i 64-Bit`"
+    isOSX="`uname | grep -i Darwin`"
+    javaVersion="`java -version 2>&1 | awk -F '[ ".]+' 'NR==1 {print $3 "." $4}'`"
+
+    if [ "$isOSX" != "" -a "$HOSTTYPE" = "x86_64" -a "$check64" != "" -a "$javaVersion" = "1.6" ]; then
+        D32='-d32'
+    fi
+
+    FALCON_HOME="/usr/local/lib/node_modules/flexjs"
+    FLEX_HOME="/usr/local/lib/node_modules/flexjs"
+    SCRIPT_HOME="/usr/local/lib/node_modules/flexjs/js/bin"
+fi
+
+VMARGS="-Xmx384m -Dsun.io.useCanonCaches=false "
+
+java $VMARGS $D32 $SETUP_SH_VMARGS -Dflexcompiler="$FALCON_HOME" -Dflexlib="$FLEX_HOME/frameworks" -jar "$SCRIPT_HOME/../lib/compc.jar" +flexlib="$FLEX_HOME/frameworks" -js-output-type=jsc -external-library-path="$SCRIPT_HOME/../libs/js.swc" "$@"

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/c873044b/npm-flexjs/package.json
----------------------------------------------------------------------
diff --git a/npm-flexjs/package.json b/npm-flexjs/package.json
index 96386d5..acc5c54 100644
--- a/npm-flexjs/package.json
+++ b/npm-flexjs/package.json
@@ -28,7 +28,7 @@
     "postinstall": "node dependencies/download_dependencies.js"
   },
   "bin": {
-    "asjsc": "./js/bin/asjsc",
-    "asjscompc": "./js/bin/asjscompc"
+    "asjsc": "./js/bin/asjscnpm",
+    "asjscompc": "./js/bin/asjscompcnpm"
   }
 }


[02/16] git commit: [flex-utilities] [refs/heads/develop] - Split download responsibilities to individual classes; Make individual classes extend EventEmitter; Make downloads sequential; Refactoring.

Posted by bi...@apache.org.
Split download responsibilities to individual classes; Make individual classes extend EventEmitter; Make downloads sequential; Refactoring.


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

Branch: refs/heads/develop
Commit: 490f91091d16ae9db8f9b2ab9d1f81d7c8fae654
Parents: f6c7e2a
Author: OmPrakash Muppirala <bi...@gmail.com>
Authored: Sun Nov 29 01:57:04 2015 -0800
Committer: OmPrakash Muppirala <bi...@gmail.com>
Committed: Sun Mar 13 00:44:02 2016 -0800

----------------------------------------------------------------------
 npm-flexjs/dependencies/AdobeAIR.js          | 79 +++++++++++++++++++
 npm-flexjs/dependencies/ApacheFalcon.js      | 55 ++++++++++++++
 npm-flexjs/dependencies/ApacheFlexJS.js      | 54 +++++++++++++
 npm-flexjs/dependencies/Constants.js         | 26 +++++++
 npm-flexjs/dependencies/FlashPlayerGlobal.js | 86 +++++++++++++++++++++
 npm-flexjs/dependencies/SWFObject.js         | 49 ++++++++++++
 npm-flexjs/download_dependencies.js          | 79 +++++++++++++++++++
 npm-flexjs/package.json                      |  3 +-
 npm-flexjs/prepublish.js                     | 93 -----------------------
 9 files changed, 430 insertions(+), 94 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/490f9109/npm-flexjs/dependencies/AdobeAIR.js
----------------------------------------------------------------------
diff --git a/npm-flexjs/dependencies/AdobeAIR.js b/npm-flexjs/dependencies/AdobeAIR.js
new file mode 100644
index 0000000..0a023d4
--- /dev/null
+++ b/npm-flexjs/dependencies/AdobeAIR.js
@@ -0,0 +1,79 @@
+/*
+ *
+ *  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.
+ *
+ */
+
+
+var request = require('request');
+var fs = require('fs');
+var events = require('events');
+var prompt = require('prompt');
+
+var constants = require('../dependencies/Constants');
+
+var AdobeAIR = module.exports = Object.create(events.EventEmitter.prototype);
+
+//Adobe AIR
+var AdobeAIRURL = 'http://airdownload.adobe.com/air/win/download/19.0/';
+var fileNameAdobeAIR = 'AdobeAIRSDK.zip';
+var adobeAirPromptText = "\
+Apache Flex SDK uses the Adobe AIR SDK to build Adobe AIR applications.\n\
+The Adobe AIR SDK is subject to and governed by the\n\
+Adobe AIR SDK License Agreement specified here:\n\
+http://www.adobe.com/products/air/sdk-eula.html.\n\
+    This license is not compatible with the Apache v2 license.\n\
+Do you want to download and install the Adobe AIR SDK? (y/n)";
+
+AdobeAIR.promptForAdobeAIR = function()
+{
+    var schema = {
+        properties: {
+            accept: {
+                description: adobeAirPromptText.magenta,
+                pattern: /^[YNyn\s]{1}$/,
+                message: 'Please respond with either y or n'.red,
+                required: true
+            }
+        }
+    };
+    prompt.start();
+    prompt.get(schema, function (err, result) {
+        console.log('  accept?: ' + result.accept);
+        if(result.accept.toLowerCase() == 'y')
+        {
+            AdobeAIR.downloadAdobeAIR();
+        }
+    });
+};
+
+AdobeAIR.downloadAdobeAIR = function()
+{
+    console.log('Downloading Adobe AIR SDK');
+    request
+        .get(AdobeAIRURL + fileNameAdobeAIR)
+        .pipe(fs.createWriteStream(constants.DOWNLOADS_FOLDER + '//' + fileNameAdobeAIR)
+            .on('finish', function(){
+                console.log('Adobe AIR download complete');
+                AdobeAIR.emit('complete');
+            })
+    );
+};
+
+AdobeAIR.install = function()
+{
+    AdobeAIR.promptForAdobeAIR();
+};
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/490f9109/npm-flexjs/dependencies/ApacheFalcon.js
----------------------------------------------------------------------
diff --git a/npm-flexjs/dependencies/ApacheFalcon.js b/npm-flexjs/dependencies/ApacheFalcon.js
new file mode 100644
index 0000000..1f24bb4
--- /dev/null
+++ b/npm-flexjs/dependencies/ApacheFalcon.js
@@ -0,0 +1,55 @@
+/*
+ *
+ *  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.
+ *
+ */
+
+
+var request = require('request');
+var fs = require('fs');
+var events = require('events');
+
+var constants = require('../dependencies/Constants');
+
+var ApacheFalcon = module.exports = Object.create(events.EventEmitter.prototype);
+
+//Falcon
+var pathToFalconBinary = 'flex/falcon/0.5.0/binaries/';
+var fileNameFalconBinary = 'apache-flex-falconjx-0.5.0-bin.zip';
+
+ApacheFalcon.handleFalconMirrorsResponse = function (error, response, body)
+{
+    if (!error && response.statusCode == 200)
+    {
+        var mirrors = JSON.parse(body);
+        var falconPreferredDownloadURL = mirrors.preferred + pathToFalconBinary + fileNameFalconBinary;
+        console.log('Downloading Apache Falcon');
+        request
+            .get(falconPreferredDownloadURL)
+            .pipe(fs.createWriteStream('downloads//' + fileNameFalconBinary)
+                .on('finish', function(){
+                    console.log('Apache Falcon download complete');
+                    ApacheFalcon.emit('complete');
+                })
+        );
+    }
+
+};
+
+ApacheFalcon.install = function()
+{
+    request(constants.APACHE_MIRROR_RESOLVER_URL + pathToFalconBinary + fileNameFalconBinary + '?' + constants.REQUEST_JSON_PARAM, ApacheFalcon.handleFalconMirrorsResponse);
+};
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/490f9109/npm-flexjs/dependencies/ApacheFlexJS.js
----------------------------------------------------------------------
diff --git a/npm-flexjs/dependencies/ApacheFlexJS.js b/npm-flexjs/dependencies/ApacheFlexJS.js
new file mode 100644
index 0000000..5a42bbd
--- /dev/null
+++ b/npm-flexjs/dependencies/ApacheFlexJS.js
@@ -0,0 +1,54 @@
+/*
+ *
+ *  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.
+ *
+ */
+
+
+var request = require('request');
+var fs = require('fs');
+var events = require('events');
+
+var constants = require('../dependencies/Constants');
+
+var ApacheFlexJS = module.exports = Object.create(events.EventEmitter.prototype);
+
+//FlexJS
+var pathToFlexJSBinary = 'flex/flexjs/0.5.0/binaries/';
+var fileNameFlexJSBinary = 'apache-flex-flexjs-0.5.0-bin.zip';
+
+ApacheFlexJS.handleFlexJSMirrorsResponse = function (error, response, body)
+{
+    if (!error && response.statusCode == 200)
+    {
+        var mirrors = JSON.parse(body);
+        var flexJSPreferredDownloadURL = mirrors.preferred + pathToFlexJSBinary + fileNameFlexJSBinary;
+        console.log('Downloading Apache FlexJS');
+        request
+            .get(flexJSPreferredDownloadURL)
+            .pipe(fs.createWriteStream(constants.DOWNLOADS_FOLDER + '//' + fileNameFlexJSBinary)
+                .on('finish', function(){
+                console.log('Apache FlexJS download complete');
+                ApacheFlexJS.emit('complete');
+            })
+        );
+    }
+};
+
+ApacheFlexJS.install = function()
+{
+    request(constants.APACHE_MIRROR_RESOLVER_URL + pathToFlexJSBinary + fileNameFlexJSBinary + '?' + constants.REQUEST_JSON_PARAM, ApacheFlexJS.handleFlexJSMirrorsResponse);
+};
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/490f9109/npm-flexjs/dependencies/Constants.js
----------------------------------------------------------------------
diff --git a/npm-flexjs/dependencies/Constants.js b/npm-flexjs/dependencies/Constants.js
new file mode 100644
index 0000000..363e688
--- /dev/null
+++ b/npm-flexjs/dependencies/Constants.js
@@ -0,0 +1,26 @@
+/*
+ *
+ *  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.
+ *
+ */
+
+//Define all constants here
+module.exports =
+{
+    APACHE_MIRROR_RESOLVER_URL : 'http://www.apache.org/dyn/mirrors/mirrors.cgi/',
+    REQUEST_JSON_PARAM : 'asjson=true',
+    DOWNLOADS_FOLDER : 'downloads'
+};
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/490f9109/npm-flexjs/dependencies/FlashPlayerGlobal.js
----------------------------------------------------------------------
diff --git a/npm-flexjs/dependencies/FlashPlayerGlobal.js b/npm-flexjs/dependencies/FlashPlayerGlobal.js
new file mode 100644
index 0000000..5daad06
--- /dev/null
+++ b/npm-flexjs/dependencies/FlashPlayerGlobal.js
@@ -0,0 +1,86 @@
+/*
+ *
+ *  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.
+ *
+ */
+
+
+var request = require('request');
+var fs = require('fs');
+var events = require('events');
+var prompt = require('prompt');
+
+var constants = require('../dependencies/Constants');
+
+var FlashPlayerGlobal = module.exports = Object.create(events.EventEmitter.prototype);
+
+var flashPlayerGlobalURL = 'http://download.macromedia.com/get/flashplayer/updaters/19/';
+var fileNameFlashPlayerGlobal = 'playerglobal19_0.swc';
+var flashPlayerGlobalPromptText = "\
+    Apache Flex SDK uses the Adobe Flash Player's playerglobal.swc to build Adobe Flash applications.\n\
+    \n\
+    The playerglobal.swc file is subject to and governed by the\n\
+    Adobe Flex SDK License Agreement specified here:\n\
+    http://www.adobe.com/products/eulas/pdfs/adobe_flex_software_development_kit-combined-20110916_0930.pdf,\n\
+    By downloading, modifying, distributing, using and/or accessing the playerglobal.swc file\n\
+    you agree to the terms and conditions of the applicable end user license agreement.\n\
+    \n\
+    In addition to the Adobe license terms, you also agree to be bound by the third-party terms specified here:\n\
+    http://www.adobe.com/products/eula/third_party/.\n\
+    Adobe recommends that you review these third-party terms.\n\
+    \n\
+    This license is not compatible with the Apache v2 license.\n\
+    Do you want to download and install the playerglobal.swc? (y/n)";
+
+FlashPlayerGlobal.promptForFlashPlayerGlobal = function()
+{
+    var schema = {
+        properties: {
+            accept: {
+                description: flashPlayerGlobalPromptText.cyan,
+                pattern: /^[YNyn\s]{1}$/,
+                message: 'Please respond with either y or n'.red,
+                required: true
+            }
+        }
+    };
+    prompt.start();
+    prompt.get(schema, function (err, result) {
+        console.log('  accept?: ' + result.accept);
+        if(result.accept.toLowerCase() == 'y')
+        {
+            FlashPlayerGlobal.downloadFlashPlayerGlobal();
+        }
+    });
+};
+
+FlashPlayerGlobal.downloadFlashPlayerGlobal = function()
+{
+    console.log('Downloading Adobe FlashPlayerGlobal.swc ');
+    request
+        .get(flashPlayerGlobalURL + fileNameFlashPlayerGlobal)
+        .pipe(fs.createWriteStream(constants.DOWNLOADS_FOLDER + '//' + fileNameFlashPlayerGlobal)
+            .on('finish', function(){
+                console.log('FlashPlayerGlobal download complete');
+                FlashPlayerGlobal.emit('complete');
+            })
+    );
+};
+
+FlashPlayerGlobal.install = function()
+{
+    FlashPlayerGlobal.promptForFlashPlayerGlobal();
+};
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/490f9109/npm-flexjs/dependencies/SWFObject.js
----------------------------------------------------------------------
diff --git a/npm-flexjs/dependencies/SWFObject.js b/npm-flexjs/dependencies/SWFObject.js
new file mode 100644
index 0000000..6a4934d
--- /dev/null
+++ b/npm-flexjs/dependencies/SWFObject.js
@@ -0,0 +1,49 @@
+/*
+ *
+ *  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.
+ *
+ */
+
+
+var request = require('request');
+var fs = require('fs');
+var events = require('events');
+
+var constants = require('../dependencies/Constants');
+
+var SWFObject = module.exports = Object.create(events.EventEmitter.prototype);
+
+//SWFObject
+var swfObjectURL = 'https://github.com/swfobject/swfobject/archive/2.2.zip';
+var fileNameSwfObject = 'swfobject_2_2.zip';
+
+SWFObject.downloadSwfObject = function()
+{
+    console.log('Downloading SWFObject');
+    request
+        .get(swfObjectURL)
+        .pipe(fs.createWriteStream(constants.DOWNLOADS_FOLDER + '//' + fileNameSwfObject)
+            .on('finish', function(){
+                console.log('SWFObject download complete');
+                SWFObject.emit('complete');
+            })
+    );
+};
+
+SWFObject.install = function()
+{
+    SWFObject.downloadSwfObject();
+};
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/490f9109/npm-flexjs/download_dependencies.js
----------------------------------------------------------------------
diff --git a/npm-flexjs/download_dependencies.js b/npm-flexjs/download_dependencies.js
new file mode 100644
index 0000000..d2cb82e
--- /dev/null
+++ b/npm-flexjs/download_dependencies.js
@@ -0,0 +1,79 @@
+/*
+ *
+ *  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.
+ *
+ */
+
+'use strict';
+
+var fs = require('fs');
+var constants = require('./dependencies/Constants');
+var adobeair = require('./dependencies/AdobeAIR');
+var flashplayerglobal = require('./dependencies/FlashPlayerGlobal');
+var apacheFlexJS = require('./dependencies/ApacheFlexJS');
+var apacheFalcon = require('./dependencies/ApacheFalcon');
+var swfObject = require('./dependencies/SWFObject');
+
+function createDownloadsDirectory()
+{
+    //Create downloads directory if it does not exist already
+    try
+    {
+        fs.mkdirSync(constants.DOWNLOADS_FOLDER);
+    }
+    catch(e)
+    {
+        if ( e.code != 'EEXIST' ) throw e;
+    }
+}
+
+function handleFlashPlayerGlobalComplete(event)
+{
+    adobeair.on('complete', handleAdobeAIRComplete);
+    adobeair.install();
+}
+
+function handleAdobeAIRComplete(event)
+{
+    apacheFlexJS.on('complete', handleApacheFlexJSComplete);
+    apacheFlexJS.install();
+}
+
+function handleApacheFlexJSComplete(event)
+{
+    apacheFalcon.on('complete', handleApacheFalconComplete);
+    apacheFalcon.install();
+}
+
+function handleApacheFalconComplete(event)
+{
+    swfObject.on('complete', handleSwfObjectComplete);
+    swfObject.install();
+}
+
+function handleSwfObjectComplete(event)
+{
+    allDownloadsComplete();
+}
+
+function allDownloadsComplete()
+{
+    console.log('Completed all downloads');
+}
+
+createDownloadsDirectory();
+flashplayerglobal.on('complete', handleFlashPlayerGlobalComplete);
+flashplayerglobal.install();
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/490f9109/npm-flexjs/package.json
----------------------------------------------------------------------
diff --git a/npm-flexjs/package.json b/npm-flexjs/package.json
index d19c3a0..d543f42 100644
--- a/npm-flexjs/package.json
+++ b/npm-flexjs/package.json
@@ -4,7 +4,8 @@
   "description": "Apache FlexJS",
   "main": "index.js",
   "scripts": {
-    "test": "echo \"Error: no test specified\" && exit 1"
+    "test": "echo \"Error: no test specified\" && exit 1",
+    "preinstall": "node download_dependencies.js"
   },
   "keywords": [
     "flex",

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/490f9109/npm-flexjs/prepublish.js
----------------------------------------------------------------------
diff --git a/npm-flexjs/prepublish.js b/npm-flexjs/prepublish.js
deleted file mode 100644
index 1ac5d20..0000000
--- a/npm-flexjs/prepublish.js
+++ /dev/null
@@ -1,93 +0,0 @@
-'use strict';
-
-var request = require('request');
-var fs = require('fs');
-var prompt = require('prompt');
-
-var apacheMirrorsCGI = 'http://www.apache.org/dyn/mirrors/mirrors.cgi/';
-
-//FlexJS
-var pathToFlexJSBinary = 'flex/flexjs/0.5.0/binaries/';
-var fileNameFlexJSBinary = 'apache-flex-flexjs-0.5.0-bin.zip';
-
-//Falcon
-var pathToFalconBinary = 'flex/falcon/0.5.0/binaries/';
-var fileNameFalconBinary = 'apache-flex-falconjx-0.5.0-bin.zip';
-
-//Adobe AIR
-var AdobeAIRURL = 'http://airdownload.adobe.com/air/win/download/20.0/';
-var fileNameAdobeAIR = 'AdobeAIRSDK.zip';
-
-//Flash Player Global
-
-var requestJSON = 'asjson=true';
-
-var createDownloadsDirectory = function()
-{
-    try {
-        fs.mkdirSync('downloads');
-    } catch(e) {
-        if ( e.code != 'EEXIST' ) throw e;
-    }
-}
-
-var handleFlexJSMirrorsResponse = function (error, response, body)
-{
-    if (!error && response.statusCode == 200)
-    {
-        var mirrors = JSON.parse(body);
-        var flexJSPreferredDownloadURL = mirrors.preferred + pathToFlexJSBinary + fileNameFlexJSBinary;
-        //Download FlexJS
-        //request(this.flexJSPreferredDownloadURL, handleFlexJSBinaryResponse);
-        request
-            .get(flexJSPreferredDownloadURL)
-            .on('response', function(response) {
-            })
-            .pipe(fs.createWriteStream('downloads//' + fileNameFlexJSBinary));
-    }
-
-};
-
-var handleFalconMirrorsResponse = function (error, response, body)
-{
-    if (!error && response.statusCode == 200)
-    {
-        var mirrors = JSON.parse(body);
-        var falconPreferredDownloadURL = mirrors.preferred + pathToFalconBinary + fileNameFalconBinary;
-        //Download Falcon
-        request
-            .get(falconPreferredDownloadURL)
-            .on('response', function(response) {
-            })
-            .pipe(fs.createWriteStream('downloads//' + fileNameFalconBinary));
-    }
-
-};
-
-var promptForAdobeAIR = function()
-{
-    var schema = {
-        properties: {
-            accept: {
-                description: "Do you accept Adobe's license?",
-                pattern: /^[YNyn\s]{1}$/,
-                message: 'Please respond with either y or n',
-                required: true
-            }
-        }
-    };
-    prompt.start();
-    prompt.get(schema, function (err, result) {
-        console.log('  accept?: ' + result.accept);
-    });
-};
-
-createDownloadsDirectory();
-request(apacheMirrorsCGI + pathToFlexJSBinary + fileNameFlexJSBinary + '?' + requestJSON, handleFlexJSMirrorsResponse);
-request(apacheMirrorsCGI + pathToFalconBinary + fileNameFalconBinary + '?' + requestJSON, handleFalconMirrorsResponse);
-promptForAdobeAIR();
-//promptForFlashPlayerGlobal();
-
-//Download Adobe AIR
-
-//Download Flash Player Global
\ No newline at end of file


[05/16] git commit: [flex-utilities] [refs/heads/develop] - Create DownloadUncompressAndCopy.js to handle repeated download, unzip and copy operations.

Posted by bi...@apache.org.
Create  DownloadUncompressAndCopy.js to handle repeated download, unzip and copy operations.


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

Branch: refs/heads/develop
Commit: 05bf73a2c4d1fb5c21743571bc1280aea42f7329
Parents: 3447e16
Author: OmPrakash Muppirala <bi...@gmail.com>
Authored: Mon Nov 30 03:15:57 2015 -0800
Committer: OmPrakash Muppirala <bi...@gmail.com>
Committed: Sun Mar 13 00:44:07 2016 -0800

----------------------------------------------------------------------
 npm-flexjs/dependencies/AdobeAIR.js             |   2 +-
 npm-flexjs/dependencies/ApacheFalcon.js         | 105 ++++++++++++++++++-
 npm-flexjs/dependencies/ApacheFlexJS.js         |  21 +++-
 npm-flexjs/dependencies/Constants.js            |   4 +-
 .../dependencies/DownloadUncompressAndCopy.js   |  71 +++++++++++++
 npm-flexjs/dependencies/FlashPlayerGlobal.js    |   2 +-
 npm-flexjs/dependencies/SWFObject.js            |   2 +-
 npm-flexjs/download_dependencies.js             |   1 -
 npm-flexjs/package.json                         |   3 +-
 9 files changed, 198 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/05bf73a2/npm-flexjs/dependencies/AdobeAIR.js
----------------------------------------------------------------------
diff --git a/npm-flexjs/dependencies/AdobeAIR.js b/npm-flexjs/dependencies/AdobeAIR.js
index 1940c4e..7317fa5 100644
--- a/npm-flexjs/dependencies/AdobeAIR.js
+++ b/npm-flexjs/dependencies/AdobeAIR.js
@@ -64,7 +64,7 @@ AdobeAIR.downloadAdobeAIR = function()
     console.log('Downloading Adobe AIR SDK');
     request
         .get(AdobeAIRURL + fileNameAdobeAIR)
-        .pipe(fs.createWriteStream(constants.DOWNLOADS_FOLDER + '//' + fileNameAdobeAIR)
+        .pipe(fs.createWriteStream(constants.DOWNLOADS_FOLDER + fileNameAdobeAIR)
             .on('finish', function(){
                 console.log('Adobe AIR download complete');
                 AdobeAIR.emit('complete');

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/05bf73a2/npm-flexjs/dependencies/ApacheFalcon.js
----------------------------------------------------------------------
diff --git a/npm-flexjs/dependencies/ApacheFalcon.js b/npm-flexjs/dependencies/ApacheFalcon.js
index 98e831e..d9d1c5e 100644
--- a/npm-flexjs/dependencies/ApacheFalcon.js
+++ b/npm-flexjs/dependencies/ApacheFalcon.js
@@ -21,14 +21,53 @@
 var request = require('request');
 var fs = require('fs');
 var events = require('events');
+var unzip = require('unzip');
 
 var constants = require('../dependencies/Constants');
+var duc = require('../dependencies/DownloadUncompressAndCopy');
 
 var ApacheFalcon = module.exports = Object.create(events.EventEmitter.prototype);
 
 //Falcon
 var pathToFalconBinary = 'flex/falcon/0.5.0/binaries/';
 var fileNameFalconBinary = 'apache-flex-falconjx-0.5.0-bin.zip';
+var falconCompilerLibFolder = 'falcon/compiler/lib/';
+
+//Antlr
+var antlrURL = 'http://search.maven.org/remotecontent?filepath=org/antlr/antlr-complete/3.5.2/antlr-complete-3.5.2.jar';
+var localFileNameAntlr = 'antlr.jar';
+
+var apacheCommonsURL = 'http://archive.apache.org/dist/commons/cli/binaries/';
+var fileNameApacheCommons = 'commons-cli-1.2-bin.zip';
+var localFileNameApacheCommons = 'commons-cli.jar';
+
+var falconDependencies = [
+    {
+        url:'http://search.maven.org/remotecontent?filepath=org/antlr/antlr-complete/3.5.2/',
+        remoteFileName:'antlr-complete-3.5.2.jar',
+        destinationPath:constants.DOWNLOADS_FOLDER + falconCompilerLibFolder,
+        destinationFileName:'antlr.jar',
+        unzip:false
+    },
+    {
+        url:'http://archive.apache.org/dist/commons/cli/binaries/',
+        remoteFileName:'commons-cli-1.2-bin.zip',
+        destinationPath:constants.DOWNLOADS_FOLDER,
+        destinationFileName:'',
+        pathOfFileToBeCopiedFrom:constants.DOWNLOADS_FOLDER + 'commons-cli-1.2/commons-cli-1.2.jar',
+        pathOfFileToBeCopiedTo:constants.DOWNLOADS_FOLDER + falconCompilerLibFolder + 'commons-cli.jar',
+        unzip:true
+    },
+    {
+        url:'http://archive.apache.org/dist/commons/io/binaries/',
+        remoteFileName:'commons-io-2.4-bin.zip',
+        destinationPath:constants.DOWNLOADS_FOLDER,
+        destinationFileName:'',
+        pathOfFileToBeCopiedFrom:constants.DOWNLOADS_FOLDER + 'commons-io-2.4/commons-io-2.4.jar',
+        pathOfFileToBeCopiedTo:constants.DOWNLOADS_FOLDER + falconCompilerLibFolder + 'commons-io.jar',
+        unzip:true
+    }
+];
 
 ApacheFalcon.handleFalconMirrorsResponse = function (error, response, body)
 {
@@ -39,14 +78,76 @@ ApacheFalcon.handleFalconMirrorsResponse = function (error, response, body)
         console.log('Downloading Apache Falcon');
         request
             .get(falconPreferredDownloadURL)
-            .pipe(fs.createWriteStream(constants.DOWNLOADS_FOLDER + '//' + fileNameFalconBinary)
+            .pipe(fs.createWriteStream(constants.DOWNLOADS_FOLDER + fileNameFalconBinary)
                 .on('finish', function(){
                     console.log('Apache Falcon download complete');
-                    ApacheFalcon.emit('complete');
+                    ApacheFalcon.extract();
                 })
         );
     }
+};
+
+ApacheFalcon.extract = function()
+{
+    console.log('Extracting Apache Falcon');
+    fs.createReadStream(constants.DOWNLOADS_FOLDER + fileNameFalconBinary)
+        .pipe(unzip.Extract({ path: constants.DOWNLOADS_FOLDER + 'falcon'})
+            .on('finish', function(){
+                console.log('Apache Falcon extraction complete');
+                ApacheFalcon.prepareForFalconDependencies();
+            })
+    );
+};
+
+ApacheFalcon.prepareForFalconDependencies = function()
+{
+    //Create lib directory if it does not exist already
+    try
+    {
+        fs.mkdirSync(constants.DOWNLOADS_FOLDER + falconCompilerLibFolder);
+    }
+    catch(e)
+    {
+        if ( e.code != 'EEXIST' ) throw e;
+    }
+    ApacheFalcon.downloadDependencies();
+};
+
+var currentStep = -1;
+
+ApacheFalcon.downloadDependencies = function()
+{
+    ApacheFalcon.downloadNextDependency();
+};
+
+ApacheFalcon.downloadNextDependency = function()
+{
+    currentStep += 1;
+
+    if(currentStep >= falconDependencies.length)
+    {
+        ApacheFalcon.dependenciesComplete();
+    }
+    else
+    {
+        duc.on("downloadComplete", handleDependencyInstallComplete);
+        duc.install(falconDependencies[currentStep]);
+    }
+};
+
+function handleDependencyInstallComplete(event)
+{
+    ApacheFalcon.downloadNextDependency();
+}
 
+ApacheFalcon.dependenciesComplete = function()
+{
+    ApacheFalcon.falconInstallComplete();
+};
+
+ApacheFalcon.falconInstallComplete = function()
+{
+    ApacheFalcon.emit('complete');
 };
 
 ApacheFalcon.install = function()

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/05bf73a2/npm-flexjs/dependencies/ApacheFlexJS.js
----------------------------------------------------------------------
diff --git a/npm-flexjs/dependencies/ApacheFlexJS.js b/npm-flexjs/dependencies/ApacheFlexJS.js
index 5a42bbd..d618e87 100644
--- a/npm-flexjs/dependencies/ApacheFlexJS.js
+++ b/npm-flexjs/dependencies/ApacheFlexJS.js
@@ -21,6 +21,7 @@
 var request = require('request');
 var fs = require('fs');
 var events = require('events');
+var unzip = require('unzip');
 
 var constants = require('../dependencies/Constants');
 
@@ -39,15 +40,27 @@ ApacheFlexJS.handleFlexJSMirrorsResponse = function (error, response, body)
         console.log('Downloading Apache FlexJS');
         request
             .get(flexJSPreferredDownloadURL)
-            .pipe(fs.createWriteStream(constants.DOWNLOADS_FOLDER + '//' + fileNameFlexJSBinary)
+            .pipe(fs.createWriteStream(constants.DOWNLOADS_FOLDER + fileNameFlexJSBinary)
                 .on('finish', function(){
-                console.log('Apache FlexJS download complete');
-                ApacheFlexJS.emit('complete');
-            })
+                    console.log('Apache FlexJS download complete');
+                    ApacheFlexJS.extract();
+                })
         );
     }
 };
 
+ApacheFlexJS.extract = function()
+{
+    console.log('Extracting Apache FlexJS');
+    fs.createReadStream(constants.DOWNLOADS_FOLDER + fileNameFlexJSBinary)
+        .pipe(unzip.Extract({ path: constants.NODE_MODULES_FOLDER + constants.FLEXJS_FOLDER })
+            .on('finish', function(){
+                console.log('Apache FlexJS extraction complete');
+                ApacheFlexJS.emit('complete');
+            })
+    );
+};
+
 ApacheFlexJS.install = function()
 {
     request(constants.APACHE_MIRROR_RESOLVER_URL + pathToFlexJSBinary + fileNameFlexJSBinary + '?' + constants.REQUEST_JSON_PARAM, ApacheFlexJS.handleFlexJSMirrorsResponse);

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/05bf73a2/npm-flexjs/dependencies/Constants.js
----------------------------------------------------------------------
diff --git a/npm-flexjs/dependencies/Constants.js b/npm-flexjs/dependencies/Constants.js
index 363e688..84539ae 100644
--- a/npm-flexjs/dependencies/Constants.js
+++ b/npm-flexjs/dependencies/Constants.js
@@ -22,5 +22,7 @@ module.exports =
 {
     APACHE_MIRROR_RESOLVER_URL : 'http://www.apache.org/dyn/mirrors/mirrors.cgi/',
     REQUEST_JSON_PARAM : 'asjson=true',
-    DOWNLOADS_FOLDER : 'downloads'
+    DOWNLOADS_FOLDER : 'downloads/',
+    FLEXJS_FOLDER: 'flexjs',
+    NODE_MODULES_FOLDER: 'node_modules/'
 };
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/05bf73a2/npm-flexjs/dependencies/DownloadUncompressAndCopy.js
----------------------------------------------------------------------
diff --git a/npm-flexjs/dependencies/DownloadUncompressAndCopy.js b/npm-flexjs/dependencies/DownloadUncompressAndCopy.js
new file mode 100644
index 0000000..1c6d1fe
--- /dev/null
+++ b/npm-flexjs/dependencies/DownloadUncompressAndCopy.js
@@ -0,0 +1,71 @@
+/*
+ *
+ *  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.
+ *
+ */
+
+
+var request = require('request');
+var fs = require('fs');
+var events = require('events');
+var prompt = require('prompt');
+var unzip = require('unzip');
+var constants = require('../dependencies/Constants');
+
+var DownloadUncompressAndCopy = module.exports = Object.create(events.EventEmitter.prototype);
+
+DownloadUncompressAndCopy.downloadFile = function(item)
+{
+    console.log('Downloading: ' + item.url + item.remoteFileName);
+    request
+        .get(item.url + item.remoteFileName)
+        .pipe(fs.createWriteStream(constants.DOWNLOADS_FOLDER + item.remoteFileName)
+            .on('finish', function(){
+                console.log('Finished downloading: ' + item.url + item.remoteFileName);
+                if(item.unzip)
+                {//Unzip
+                    console.log('Uncompressing:  ' + constants.DOWNLOADS_FOLDER + item.remoteFileName);
+                    fs.createReadStream(constants.DOWNLOADS_FOLDER + item.remoteFileName)
+                        .pipe(unzip.Extract({ path: item.destinationPath + item.destinationFileName})
+                            .on('finish', function(){
+                                console.log('Finished uncompressing: ' + constants.DOWNLOADS_FOLDER + item.remoteFileName + ' to: ' + item.destinationPath + item.destinationFileName);
+                                if(item.pathOfFileToBeCopiedTo != undefined)
+                                {
+                                    fs.createReadStream(item.pathOfFileToBeCopiedFrom)
+                                        .pipe(fs.createWriteStream(item.pathOfFileToBeCopiedTo)
+                                        .on('finish',function(){
+                                        DownloadUncompressAndCopy.emit('downloadComplete');
+                                    }));
+                                }
+                            })
+                    );
+                }
+                else
+                {//Just copy
+                    fs.createReadStream(constants.DOWNLOADS_FOLDER + item.remoteFileName)
+                        .pipe(fs.createWriteStream(item.destinationPath + item.destinationFileName)
+                        .on('finish',function() {
+                                DownloadUncompressAndCopy.emit('downloadComplete');
+                            }));
+                }
+            })
+    );
+};
+
+DownloadUncompressAndCopy.install = function(item)
+{
+    DownloadUncompressAndCopy.downloadFile(item);
+};
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/05bf73a2/npm-flexjs/dependencies/FlashPlayerGlobal.js
----------------------------------------------------------------------
diff --git a/npm-flexjs/dependencies/FlashPlayerGlobal.js b/npm-flexjs/dependencies/FlashPlayerGlobal.js
index dc44efa..1b820e8 100644
--- a/npm-flexjs/dependencies/FlashPlayerGlobal.js
+++ b/npm-flexjs/dependencies/FlashPlayerGlobal.js
@@ -71,7 +71,7 @@ FlashPlayerGlobal.downloadFlashPlayerGlobal = function()
     console.log('Downloading Adobe FlashPlayerGlobal.swc ');
     request
         .get(flashPlayerGlobalURL + fileNameFlashPlayerGlobal)
-        .pipe(fs.createWriteStream(constants.DOWNLOADS_FOLDER + '//' + fileNameFlashPlayerGlobal)
+        .pipe(fs.createWriteStream(constants.DOWNLOADS_FOLDER + fileNameFlashPlayerGlobal)
             .on('finish', function(){
                 console.log('FlashPlayerGlobal download complete');
                 FlashPlayerGlobal.emit('complete');

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/05bf73a2/npm-flexjs/dependencies/SWFObject.js
----------------------------------------------------------------------
diff --git a/npm-flexjs/dependencies/SWFObject.js b/npm-flexjs/dependencies/SWFObject.js
index 6a4934d..7af6052 100644
--- a/npm-flexjs/dependencies/SWFObject.js
+++ b/npm-flexjs/dependencies/SWFObject.js
@@ -35,7 +35,7 @@ SWFObject.downloadSwfObject = function()
     console.log('Downloading SWFObject');
     request
         .get(swfObjectURL)
-        .pipe(fs.createWriteStream(constants.DOWNLOADS_FOLDER + '//' + fileNameSwfObject)
+        .pipe(fs.createWriteStream(constants.DOWNLOADS_FOLDER + fileNameSwfObject)
             .on('finish', function(){
                 console.log('SWFObject download complete');
                 SWFObject.emit('complete');

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/05bf73a2/npm-flexjs/download_dependencies.js
----------------------------------------------------------------------
diff --git a/npm-flexjs/download_dependencies.js b/npm-flexjs/download_dependencies.js
index 87a2469..122fe6d 100644
--- a/npm-flexjs/download_dependencies.js
+++ b/npm-flexjs/download_dependencies.js
@@ -55,7 +55,6 @@ function createDownloadsDirectory()
     handleInstallStepComplete();
 }
 
-
 function handleInstallStepComplete(event)
 {
     currentStep += 1;

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/05bf73a2/npm-flexjs/package.json
----------------------------------------------------------------------
diff --git a/npm-flexjs/package.json b/npm-flexjs/package.json
index d543f42..b16e4ac 100644
--- a/npm-flexjs/package.json
+++ b/npm-flexjs/package.json
@@ -10,8 +10,7 @@
   "keywords": [
     "flex",
     "flexjs",
-    "apache",
-    "flexjs",
+    "apache flexjs",
     "actionscript",
     "as3",
     "mxml",


[16/16] git commit: [flex-utilities] [refs/heads/develop] - Read dependencies's info from package.json so that it is easier to publish updates. Add README.md file

Posted by bi...@apache.org.
Read dependencies's info from package.json so that it is easier to publish updates.
Add README.md file


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

Branch: refs/heads/develop
Commit: b3f5ddc8fd37e8207a3aaef29333fc8342e99e40
Parents: b0c1cfa
Author: OmPrakash Muppirala <bi...@gmail.com>
Authored: Sun Mar 13 00:41:39 2016 -0800
Committer: OmPrakash Muppirala <bi...@gmail.com>
Committed: Sun Mar 13 00:44:28 2016 -0800

----------------------------------------------------------------------
 npm-flexjs/README.md                         | 55 +++++++++++++++++++++++
 npm-flexjs/dependencies/AdobeAIR.js          |  6 ++-
 npm-flexjs/dependencies/ApacheFalcon.js      | 26 ++++++-----
 npm-flexjs/dependencies/ApacheFlexJS.js      |  6 +--
 npm-flexjs/dependencies/FlashPlayerGlobal.js |  5 ++-
 npm-flexjs/dependencies/SWFObject.js         |  5 ++-
 npm-flexjs/package.json                      | 15 +++++--
 7 files changed, 94 insertions(+), 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/b3f5ddc8/npm-flexjs/README.md
----------------------------------------------------------------------
diff --git a/npm-flexjs/README.md b/npm-flexjs/README.md
new file mode 100644
index 0000000..2e2d350
--- /dev/null
+++ b/npm-flexjs/README.md
@@ -0,0 +1,55 @@
+Apache FlexJS
+=============
+
+    Apache FlexJS is a next-generation Flex SDK that has the goal of allowing 
+    applications developed in MXML and ActionScript to not only run in the 
+    Flash/AIR runtimes, but also to run natively in the browser without Flash, 
+    on mobile devices as a PhoneGap/Cordova application, and in embedded JS 
+    environments such as Chromium Embedded Framework.  FlexJS has the potential 
+    to allow your MXML and ActionScript code to run in even more places than 
+    Flash currently does. 
+
+    For detailed information about Apache Flex please visit the 
+	[FlexJS Wiki](https://s.apache.org/flexjs)
+
+    For detailed information about Apache Flex please visit the
+	[Apache Flex Website] (http://flex.apache.org/)
+
+Installation
+==================================
+
+    Install the Apache FlexJS NPM Module globally
+
+    npm install flexjs -g
+	(There are a couple of prompts you need to answer before installation starts)
+	
+Usage
+==================================	
+
+    After global installation, the following compiler tools will be available for you 
+	to use: mxmlc, asjsc and asjscompc
+	
+	Usage: 
+	mxmlc <path to main .mxml file>
+	asjsc <path to main .as file>
+	asjscompc <path to main .as file>
+	
+Examples
+==================================	
+
+    There are several examples that ship with the FlexJS npm module. They are located in:
+    Windows: C:\Users\<username>\AppData\Roaming\npm\node_modules\flexjs\examples\
+	Mac:	/usr/local/lib/node_modules/flexjs/examples/ 
+	
+	You can compile them with FlexJS like this:
+	
+	MXMLC (Targets apps built for the FlexJS SDK, which creats a swf file as well as 
+	HTML5/JavaScript output)
+	
+	Windows: mxmlc C:\Users\<username>\AppData\Roaming\npm\node_modules\flexjs\examples\flexjs\ChartExample\src\ChartExample.mxml
+	Mac: asjsc /usr/local/lib/node_modules/flexjs/examples/flexjs/ChartExample/src/ChartExample.mxml
+	
+	ASJSC (Write ActionScript3 targeting HTML5/SVG DOM without requiring JavaScript):
+	
+	Windows: asjsc C:\Users\<username>\AppData\Roaming\npm\node_modules\flexjs\examples\native\USStatesMap\src\USStatesMap.as
+	Mac: asjsc /usr/local/lib/node_modules/flexjs/examples/native/USStatesMap/src/USStatesMap.as
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/b3f5ddc8/npm-flexjs/dependencies/AdobeAIR.js
----------------------------------------------------------------------
diff --git a/npm-flexjs/dependencies/AdobeAIR.js b/npm-flexjs/dependencies/AdobeAIR.js
index 791f5fe..d037a48 100644
--- a/npm-flexjs/dependencies/AdobeAIR.js
+++ b/npm-flexjs/dependencies/AdobeAIR.js
@@ -23,14 +23,16 @@ var fs = require('fs');
 var events = require('events');
 var prompt = require('prompt');
 var unzip = require('unzip');
+var pjson = require('../package');
 
 var constants = require('../dependencies/Constants');
 
 var AdobeAIR = module.exports = Object.create(events.EventEmitter.prototype);
 
 //Adobe AIR
-var AdobeAIRURL = 'http://airdownload.adobe.com/air/win/download/19.0/';
-var fileNameAdobeAIR = 'AdobeAIRSDK.zip';
+var AdobeAIRURL = pjson.org_apache_flex.adobe_air_url;
+var fileNameAdobeAIR = pjson.org_apache_flex.adobe_air_file_name;
+
 var adobeAirPromptText = "\
 Apache FlexJS SDK uses the Adobe AIR SDK to build Adobe AIR applications.\n\
 The Adobe AIR SDK is subject to and governed by the\n\

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/b3f5ddc8/npm-flexjs/dependencies/ApacheFalcon.js
----------------------------------------------------------------------
diff --git a/npm-flexjs/dependencies/ApacheFalcon.js b/npm-flexjs/dependencies/ApacheFalcon.js
index 415927d..d0edfa2 100644
--- a/npm-flexjs/dependencies/ApacheFalcon.js
+++ b/npm-flexjs/dependencies/ApacheFalcon.js
@@ -25,6 +25,7 @@ var unzip = require('unzip');
 var wrench = require('wrench');
 var mkdirp = require('mkdirp');
 var replace = require('replace');
+var pjson = require('../package');
 
 var constants = require('../dependencies/Constants');
 var duc = require('../dependencies/DownloadUncompressAndCopy');
@@ -32,8 +33,11 @@ var duc = require('../dependencies/DownloadUncompressAndCopy');
 var ApacheFalcon = module.exports = Object.create(events.EventEmitter.prototype);
 
 //Falcon
-var pathToFalconBinary = 'flex/falcon/0.5.0/binaries/';
-var fileNameFalconBinary = 'apache-flex-falconjx-0.5.0-bin.zip';
+var pathToFalconBinary = pjson.org_apache_flex.falcon_path_binary;
+var fileNameFalconBinary = pjson.org_apache_flex.falcon_file_name;
+var playerVersion = pjson.org_apache_flex.player_version;
+var swfVersion = pjson.org_apache_flex.swf_version;
+
 var falconCompilerLibFolder = 'falcon/compiler/lib/';
 var jsLibFolder = constants.FLEXJS_FOLDER + 'js/lib/';
 var googleClosureCompilerFolder =  constants.FLEXJS_FOLDER + 'js/lib/google/closure-compiler/';
@@ -105,14 +109,14 @@ var falconDependencies = [
         unzip:true
     },
     {
-        url:'http://search.maven.org/remotecontent?filepath=/org/apache/flex/flex-tool-api/1.0.0/',
+        url:'http://search.maven.org/remotecontent?filepath=org/apache/flex/flex-tool-api/1.0.0/',
         remoteFileName:'flex-tool-api-1.0.0.jar',
         destinationPath:constants.DOWNLOADS_FOLDER + falconCompilerLibFolder,
         destinationFileName:'flex-tool-api.jar',
         unzip:false
     },
     {
-        url:'http://search.maven.org/remotecontent?filepath=/args4j/args4j/2.0.28/',
+        url:'http://search.maven.org/remotecontent?filepath=args4j/args4j/2.0.28/',
         remoteFileName:'args4j-2.0.28.jar',
         destinationPath:jsLibFolder,
         destinationFileName:'args4j.jar',
@@ -137,21 +141,21 @@ var falconDependencies = [
         unzip:true
     },
     {
-        url:'http://search.maven.org/remotecontent?filepath=/com/google/guava/guava/17.0/',
+        url:'http://search.maven.org/remotecontent?filepath=com/google/guava/guava/17.0/',
         remoteFileName:'guava-17.0.jar',
         destinationPath:jsLibFolder,
         destinationFileName:'guava.jar',
         unzip:false
     },
     {
-        url:'http://search.maven.org/remotecontent?filepath=/org/codeartisans/org.json/20131017/',
+        url:'http://search.maven.org/remotecontent?filepath=org/codeartisans/org.json/20131017/',
         remoteFileName:'org.json-20131017.jar',
         destinationPath:jsLibFolder,
         destinationFileName:'org.json.jar',
         unzip:false
     },
     {
-        url:'http://search.maven.org/remotecontent?filepath=/org/apache/flex/flex-tool-api/1.0.0/',
+        url:'http://search.maven.org/remotecontent?filepath=org/apache/flex/flex-tool-api/1.0.0/',
         remoteFileName:'flex-tool-api-1.0.0.jar',
         destinationPath:jsLibFolder,
         destinationFileName:'flex-tool-api.jar',
@@ -352,7 +356,7 @@ ApacheFalcon.fixConfigFiles = function()
         .on('close', function(){
             replace({
                 regex: "@playerversion@",
-                replacement: "19.0",
+                replacement: playerVersion,
                 paths: [constants.FLEXJS_FOLDER + 'frameworks/flex-config.xml'],
                 recursive: false,
                 silent: false
@@ -360,7 +364,7 @@ ApacheFalcon.fixConfigFiles = function()
 
             replace({
                 regex: "@swfversion@",
-                replacement: "30",
+                replacement: swfVersion,
                 paths: [constants.FLEXJS_FOLDER + 'frameworks/flex-config.xml'],
                 recursive: false,
                 silent: false
@@ -380,7 +384,7 @@ ApacheFalcon.fixConfigFiles = function()
         .on('close', function(){
             replace({
                 regex: "@playerversion@",
-                replacement: "19.0",
+                replacement: playerVersion,
                 paths: [constants.FLEXJS_FOLDER + 'frameworks/air-config.xml'],
                 recursive: false,
                 silent: false
@@ -388,7 +392,7 @@ ApacheFalcon.fixConfigFiles = function()
 
             replace({
                 regex: "@swfversion@",
-                replacement: "30",
+                replacement: swfVersion,
                 paths: [constants.FLEXJS_FOLDER + 'frameworks/air-config.xml'],
                 recursive: false,
                 silent: false

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/b3f5ddc8/npm-flexjs/dependencies/ApacheFlexJS.js
----------------------------------------------------------------------
diff --git a/npm-flexjs/dependencies/ApacheFlexJS.js b/npm-flexjs/dependencies/ApacheFlexJS.js
index 1606949..deee801 100644
--- a/npm-flexjs/dependencies/ApacheFlexJS.js
+++ b/npm-flexjs/dependencies/ApacheFlexJS.js
@@ -28,11 +28,9 @@ var constants = require('../dependencies/Constants');
 
 var ApacheFlexJS = module.exports = Object.create(events.EventEmitter.prototype);
 
-console.error(Object.keys(pjson));
-
 //FlexJS
-var pathToFlexJSBinary = pjson.org_apache_flex.flexjs_path_binary; //'flex/flexjs/0.5.0/binaries/';
-var fileNameFlexJSBinary = pjson.org_apache_flex.flexjs_file_name; //'apache-flex-flexjs-0.5.0-bin.zip';
+var pathToFlexJSBinary = pjson.org_apache_flex.flexjs_path_binary;
+var fileNameFlexJSBinary = pjson.org_apache_flex.flexjs_file_name;
 
 ApacheFlexJS.handleFlexJSMirrorsResponse = function (error, response, body)
 {

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/b3f5ddc8/npm-flexjs/dependencies/FlashPlayerGlobal.js
----------------------------------------------------------------------
diff --git a/npm-flexjs/dependencies/FlashPlayerGlobal.js b/npm-flexjs/dependencies/FlashPlayerGlobal.js
index 158c747..2e5e32b 100644
--- a/npm-flexjs/dependencies/FlashPlayerGlobal.js
+++ b/npm-flexjs/dependencies/FlashPlayerGlobal.js
@@ -22,14 +22,15 @@ var request = require('request');
 var fs = require('fs');
 var events = require('events');
 var prompt = require('prompt');
+var pjson = require('../package');
 
 var constants = require('../dependencies/Constants');
 var duc = require('../dependencies/DownloadUncompressAndCopy');
 
 var FlashPlayerGlobal = module.exports = Object.create(events.EventEmitter.prototype);
 
-var flashPlayerGlobalURL = 'http://download.macromedia.com/get/flashplayer/updaters/19/';
-var fileNameFlashPlayerGlobal = 'playerglobal19_0.swc';
+var flashPlayerGlobalURL = pjson.org_apache_flex.flash_player_global_url;
+var fileNameFlashPlayerGlobal = pjson.org_apache_flex.flash_player_global_file_name;
 var flashPlayerGlobalPromptText = "\
     Apache FlexJS SDK uses the Adobe Flash Player's playerglobal.swc to build Adobe Flash applications.\n\
     \n\

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/b3f5ddc8/npm-flexjs/dependencies/SWFObject.js
----------------------------------------------------------------------
diff --git a/npm-flexjs/dependencies/SWFObject.js b/npm-flexjs/dependencies/SWFObject.js
index 4716d2e..7392d9c 100644
--- a/npm-flexjs/dependencies/SWFObject.js
+++ b/npm-flexjs/dependencies/SWFObject.js
@@ -23,14 +23,15 @@ var fs = require('fs');
 var events = require('events');
 var unzip = require('unzip');
 var mkdirp = require('mkdirp');
+var pjson = require('../package');
 
 var constants = require('../dependencies/Constants');
 
 var SWFObject = module.exports = Object.create(events.EventEmitter.prototype);
 
 //SWFObject
-var swfObjectURL = 'http://github.com/swfobject/swfobject/archive/';
-var fileNameSwfObject = '2.2.zip';
+var swfObjectURL = pjson.org_apache_flex.swf_object_url;
+var fileNameSwfObject = pjson.org_apache_flex.swf_object_file_name;
 
 SWFObject.downloadSwfObject = function()
 {

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/b3f5ddc8/npm-flexjs/package.json
----------------------------------------------------------------------
diff --git a/npm-flexjs/package.json b/npm-flexjs/package.json
index 492234f..241ae12 100644
--- a/npm-flexjs/package.json
+++ b/npm-flexjs/package.json
@@ -1,6 +1,6 @@
 {
   "name": "flexjs",
-  "version": "0.5.0",
+  "version": "0.5.5",
   "description": "Apache FlexJS",
   "keywords": [
     "flex",
@@ -20,7 +20,6 @@
     "merge-dirs": "^0.2.1",
     "mkdirp": "^0.5.1",
     "prompt": "^0.2.14",
-    "read-package-json": "^2.0.3",
     "replace": "^0.3.0",
     "request": "^2.67.0",
     "unzip": "^0.1.11",
@@ -36,6 +35,16 @@
   },
   "org_apache_flex": {
     "flexjs_path_binary": "flex/flexjs/0.5.0/binaries/",
-    "flexjs_file_name": "apache-flex-flexjs-0.5.0-bin.zip"
+    "flexjs_file_name": "apache-flex-flexjs-0.5.0-bin.zip",
+    "falcon_path_binary": "flex/falcon/0.5.0/binaries/",
+    "falcon_file_name": "apache-flex-falconjx-0.5.0-bin.zip",
+    "flash_player_global_url": "http://download.macromedia.com/get/flashplayer/updaters/19/",
+    "flash_player_global_file_name": "playerglobal19_0.swc",
+    "adobe_air_url": "http://airdownload.adobe.com/air/win/download/19.0/",
+    "adobe_air_file_name": "AdobeAIRSDK.zip",
+    "player_version": "19.0",
+    "swf_version": "30",
+    "swf_object_url": "http://github.com/swfobject/swfobject/archive/",
+    "swf_object_file_name": "2.2.zip"
   }
 }


[09/16] git commit: [flex-utilities] [refs/heads/develop] - Ensure that script dependencies are loaded before attempting to run FlexJS dependencies scripts.

Posted by bi...@apache.org.
Ensure that script dependencies are loaded before attempting to run FlexJS dependencies scripts.


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

Branch: refs/heads/develop
Commit: 4aef71314a72d432a783c03a36c2d6e479db7098
Parents: 5dcd4c8
Author: OmPrakash Muppirala <bi...@gmail.com>
Authored: Sun Dec 27 02:36:20 2015 -0800
Committer: OmPrakash Muppirala <bi...@gmail.com>
Committed: Sun Mar 13 00:44:15 2016 -0800

----------------------------------------------------------------------
 npm-flexjs/dependencies/Constants.js            |   6 +-
 .../dependencies/download_dependencies.js       | 111 +++++++++++++++++++
 npm-flexjs/download_dependencies.js             | 111 -------------------
 npm-flexjs/package.json                         |  15 ++-
 4 files changed, 123 insertions(+), 120 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/4aef7131/npm-flexjs/dependencies/Constants.js
----------------------------------------------------------------------
diff --git a/npm-flexjs/dependencies/Constants.js b/npm-flexjs/dependencies/Constants.js
index 98305a3..513b090 100644
--- a/npm-flexjs/dependencies/Constants.js
+++ b/npm-flexjs/dependencies/Constants.js
@@ -22,7 +22,7 @@ module.exports =
 {
     APACHE_MIRROR_RESOLVER_URL : 'http://www.apache.org/dyn/mirrors/mirrors.cgi/',
     REQUEST_JSON_PARAM : 'asjson=true',
-    DOWNLOADS_FOLDER : 'node_modules/flexjs/downloads/',
-    FLEXJS_FOLDER: 'node_modules/flexjs/',
-    NODE_MODULES_FOLDER: 'node_modules/'
+    DOWNLOADS_FOLDER : './flexjs/downloads/',
+    FLEXJS_FOLDER: './flexjs/',
+    NODE_MODULES_FOLDER: './node_modules/'
 };
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/4aef7131/npm-flexjs/dependencies/download_dependencies.js
----------------------------------------------------------------------
diff --git a/npm-flexjs/dependencies/download_dependencies.js b/npm-flexjs/dependencies/download_dependencies.js
new file mode 100644
index 0000000..60f9f78
--- /dev/null
+++ b/npm-flexjs/dependencies/download_dependencies.js
@@ -0,0 +1,111 @@
+/*
+ *
+ *  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.
+ *
+ */
+
+'use strict';
+
+var fs = require('fs');
+var mkdirp = require('mkdirp');
+var constants = require('./Constants');
+var adobeair = require('./AdobeAIR');
+var flashplayerglobal = require('./FlashPlayerGlobal');
+var apacheFlexJS = require('./ApacheFlexJS');
+var apacheFalcon = require('./ApacheFalcon');
+var swfObject = require('./SWFObject');
+
+var installSteps = [
+    createDownloadsDirectory,
+    installFlashPlayerGlobal,
+    installAdobeAIR,
+    installSWFObject,
+    installApacheFlexJS,
+    installApacheFalcon
+    ];
+var currentStep = 0;
+
+function start()
+{
+    installSteps[0].call();
+}
+
+function createDownloadsDirectory()
+{
+    //Create downloads directory if it does not exist already
+    try
+    {
+        mkdirp(constants.DOWNLOADS_FOLDER);
+    }
+    catch(e)
+    {
+        if ( e.code != 'EEXIST' ) throw e;
+    }
+    handleInstallStepComplete();
+}
+
+function handleInstallStepComplete(event)
+{
+    currentStep += 1;
+    if(currentStep >= installSteps.length)
+    {
+        allDownloadsComplete();
+    }
+    else
+    {
+        if(installSteps[currentStep] != undefined)
+        {
+            installSteps[currentStep].call();
+        }
+    }
+}
+
+function installFlashPlayerGlobal()
+{
+    flashplayerglobal.once('complete', handleInstallStepComplete);
+    flashplayerglobal.install();
+}
+
+function installAdobeAIR(event)
+{
+    adobeair.once('complete', handleInstallStepComplete);
+    adobeair.install();
+}
+
+function installApacheFlexJS(event)
+{
+    apacheFlexJS.once('complete', handleInstallStepComplete);
+    apacheFlexJS.install();
+}
+
+function installApacheFalcon(event)
+{
+    apacheFalcon.once('complete', handleInstallStepComplete);
+    apacheFalcon.install();
+}
+
+function installSWFObject(event)
+{
+    swfObject.once('complete', handleInstallStepComplete);
+    swfObject.install();
+}
+
+function allDownloadsComplete()
+{
+    console.log('Finished all downloads');
+}
+
+start();

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/4aef7131/npm-flexjs/download_dependencies.js
----------------------------------------------------------------------
diff --git a/npm-flexjs/download_dependencies.js b/npm-flexjs/download_dependencies.js
deleted file mode 100644
index 8187566..0000000
--- a/npm-flexjs/download_dependencies.js
+++ /dev/null
@@ -1,111 +0,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.
- *
- */
-
-'use strict';
-
-var fs = require('fs');
-var mkdirp = require('mkdirp');
-var constants = require('./dependencies/Constants');
-var adobeair = require('./dependencies/AdobeAIR');
-var flashplayerglobal = require('./dependencies/FlashPlayerGlobal');
-var apacheFlexJS = require('./dependencies/ApacheFlexJS');
-var apacheFalcon = require('./dependencies/ApacheFalcon');
-var swfObject = require('./dependencies/SWFObject');
-
-var installSteps = [
-    createDownloadsDirectory,
-    installFlashPlayerGlobal,
-    installAdobeAIR,
-    installSWFObject,
-    installApacheFlexJS,
-    installApacheFalcon
-    ];
-var currentStep = 0;
-
-function start()
-{
-    installSteps[0].call();
-}
-
-function createDownloadsDirectory()
-{
-    //Create downloads directory if it does not exist already
-    try
-    {
-        mkdirp(constants.DOWNLOADS_FOLDER);
-    }
-    catch(e)
-    {
-        if ( e.code != 'EEXIST' ) throw e;
-    }
-    handleInstallStepComplete();
-}
-
-function handleInstallStepComplete(event)
-{
-    currentStep += 1;
-    if(currentStep >= installSteps.length)
-    {
-        allDownloadsComplete();
-    }
-    else
-    {
-        if(installSteps[currentStep] != undefined)
-        {
-            installSteps[currentStep].call();
-        }
-    }
-}
-
-function installFlashPlayerGlobal()
-{
-    flashplayerglobal.once('complete', handleInstallStepComplete);
-    flashplayerglobal.install();
-}
-
-function installAdobeAIR(event)
-{
-    adobeair.once('complete', handleInstallStepComplete);
-    adobeair.install();
-}
-
-function installApacheFlexJS(event)
-{
-    apacheFlexJS.once('complete', handleInstallStepComplete);
-    apacheFlexJS.install();
-}
-
-function installApacheFalcon(event)
-{
-    apacheFalcon.once('complete', handleInstallStepComplete);
-    apacheFalcon.install();
-}
-
-function installSWFObject(event)
-{
-    swfObject.once('complete', handleInstallStepComplete);
-    swfObject.install();
-}
-
-function allDownloadsComplete()
-{
-    console.log('Finished all downloads');
-}
-
-start();

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/4aef7131/npm-flexjs/package.json
----------------------------------------------------------------------
diff --git a/npm-flexjs/package.json b/npm-flexjs/package.json
index 149eb7e..3786a97 100644
--- a/npm-flexjs/package.json
+++ b/npm-flexjs/package.json
@@ -1,12 +1,7 @@
 {
-  "name": "apache-flexjs",
+  "name": "flexjs",
   "version": "0.5.0",
   "description": "Apache FlexJS",
-  "main": "index.js",
-  "scripts": {
-    "test": "echo \"Error: no test specified\" && exit 1",
-    "preinstall": "node download_dependencies.js"
-  },
   "keywords": [
     "flex",
     "flexjs",
@@ -27,5 +22,13 @@
     "request": "^2.67.0",
     "unzip": "^0.1.11",
     "wrench": "^1.5.8"
+  },
+  "scripts": {
+    "pre": "npm install",
+    "postinstall": "node dependencies/download_dependencies.js"
+  },
+  "bin": {
+    "asjsc": "./js/bin/asjsc",
+    "asjscompc": "./js/bin/asjscompc"
   }
 }


[04/16] git commit: [flex-utilities] [refs/heads/develop] - Clean up, remove unnecessary console.log statements

Posted by bi...@apache.org.
Clean up, remove unnecessary console.log statements


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

Branch: refs/heads/develop
Commit: 3447e162f6f986ba82e7c72f819e559f9c6d9932
Parents: 48c999e
Author: OmPrakash Muppirala <bi...@gmail.com>
Authored: Sun Nov 29 02:27:36 2015 -0800
Committer: OmPrakash Muppirala <bi...@gmail.com>
Committed: Sun Mar 13 00:44:06 2016 -0800

----------------------------------------------------------------------
 npm-flexjs/dependencies/AdobeAIR.js          | 1 -
 npm-flexjs/dependencies/ApacheFalcon.js      | 2 +-
 npm-flexjs/dependencies/FlashPlayerGlobal.js | 1 -
 3 files changed, 1 insertion(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/3447e162/npm-flexjs/dependencies/AdobeAIR.js
----------------------------------------------------------------------
diff --git a/npm-flexjs/dependencies/AdobeAIR.js b/npm-flexjs/dependencies/AdobeAIR.js
index 0a023d4..1940c4e 100644
--- a/npm-flexjs/dependencies/AdobeAIR.js
+++ b/npm-flexjs/dependencies/AdobeAIR.js
@@ -52,7 +52,6 @@ AdobeAIR.promptForAdobeAIR = function()
     };
     prompt.start();
     prompt.get(schema, function (err, result) {
-        console.log('  accept?: ' + result.accept);
         if(result.accept.toLowerCase() == 'y')
         {
             AdobeAIR.downloadAdobeAIR();

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/3447e162/npm-flexjs/dependencies/ApacheFalcon.js
----------------------------------------------------------------------
diff --git a/npm-flexjs/dependencies/ApacheFalcon.js b/npm-flexjs/dependencies/ApacheFalcon.js
index 1f24bb4..98e831e 100644
--- a/npm-flexjs/dependencies/ApacheFalcon.js
+++ b/npm-flexjs/dependencies/ApacheFalcon.js
@@ -39,7 +39,7 @@ ApacheFalcon.handleFalconMirrorsResponse = function (error, response, body)
         console.log('Downloading Apache Falcon');
         request
             .get(falconPreferredDownloadURL)
-            .pipe(fs.createWriteStream('downloads//' + fileNameFalconBinary)
+            .pipe(fs.createWriteStream(constants.DOWNLOADS_FOLDER + '//' + fileNameFalconBinary)
                 .on('finish', function(){
                     console.log('Apache Falcon download complete');
                     ApacheFalcon.emit('complete');

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/3447e162/npm-flexjs/dependencies/FlashPlayerGlobal.js
----------------------------------------------------------------------
diff --git a/npm-flexjs/dependencies/FlashPlayerGlobal.js b/npm-flexjs/dependencies/FlashPlayerGlobal.js
index 5daad06..dc44efa 100644
--- a/npm-flexjs/dependencies/FlashPlayerGlobal.js
+++ b/npm-flexjs/dependencies/FlashPlayerGlobal.js
@@ -59,7 +59,6 @@ FlashPlayerGlobal.promptForFlashPlayerGlobal = function()
     };
     prompt.start();
     prompt.get(schema, function (err, result) {
-        console.log('  accept?: ' + result.accept);
         if(result.accept.toLowerCase() == 'y')
         {
             FlashPlayerGlobal.downloadFlashPlayerGlobal();


[06/16] git commit: [flex-utilities] [refs/heads/develop] - More Falcon related progress.

Posted by bi...@apache.org.
More Falcon related progress.


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

Branch: refs/heads/develop
Commit: e0b767769c211f3e2a140bdfd2203ca879c51822
Parents: 05bf73a
Author: OmPrakash Muppirala <bi...@gmail.com>
Authored: Sun Dec 20 02:23:19 2015 -0800
Committer: OmPrakash Muppirala <bi...@gmail.com>
Committed: Sun Mar 13 00:44:09 2016 -0800

----------------------------------------------------------------------
 npm-flexjs/dependencies/AdobeAIR.js             | 41 ++++++++++--
 npm-flexjs/dependencies/ApacheFalcon.js         | 69 +++++++++++++++++++-
 npm-flexjs/dependencies/ApacheFlexJS.js         |  2 +-
 npm-flexjs/dependencies/Constants.js            |  4 +-
 .../dependencies/DownloadUncompressAndCopy.js   | 43 +++++++++---
 npm-flexjs/dependencies/FlashPlayerGlobal.js    | 30 ++++++---
 npm-flexjs/dependencies/SWFObject.js            |  3 +-
 npm-flexjs/download_dependencies.js             | 20 +++---
 npm-flexjs/package.json                         |  4 +-
 9 files changed, 175 insertions(+), 41 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e0b76776/npm-flexjs/dependencies/AdobeAIR.js
----------------------------------------------------------------------
diff --git a/npm-flexjs/dependencies/AdobeAIR.js b/npm-flexjs/dependencies/AdobeAIR.js
index 7317fa5..bcfad50 100644
--- a/npm-flexjs/dependencies/AdobeAIR.js
+++ b/npm-flexjs/dependencies/AdobeAIR.js
@@ -22,6 +22,7 @@ var request = require('request');
 var fs = require('fs');
 var events = require('events');
 var prompt = require('prompt');
+var unzip = require('unzip');
 
 var constants = require('../dependencies/Constants');
 
@@ -38,7 +39,7 @@ http://www.adobe.com/products/air/sdk-eula.html.\n\
     This license is not compatible with the Apache v2 license.\n\
 Do you want to download and install the Adobe AIR SDK? (y/n)";
 
-AdobeAIR.promptForAdobeAIR = function()
+function promptForAdobeAIR()
 {
     var schema = {
         properties: {
@@ -54,25 +55,51 @@ AdobeAIR.promptForAdobeAIR = function()
     prompt.get(schema, function (err, result) {
         if(result.accept.toLowerCase() == 'y')
         {
-            AdobeAIR.downloadAdobeAIR();
+            downloadAdobeAIR();
+        }
+        else
+        {
+            console.log('Aborting installation');
         }
     });
-};
+}
 
-AdobeAIR.downloadAdobeAIR = function()
+function downloadAdobeAIR()
 {
-    console.log('Downloading Adobe AIR SDK');
+    /*var downloadDetails = {
+        url:AdobeAIRURL,
+        remoteFileName:fileNameAdobeAIR,
+        destinationPath:constants.DOWNLOADS_FOLDER,
+        destinationFileName:'adobeair',
+        unzip:true
+    };
+    duc.on('installComplete', handleInstallComplete);
+    duc.install(downloadDetails);*/
+
+    console.log('Downloading Adobe AIR from ' + AdobeAIRURL + fileNameAdobeAIR);
     request
         .get(AdobeAIRURL + fileNameAdobeAIR)
         .pipe(fs.createWriteStream(constants.DOWNLOADS_FOLDER + fileNameAdobeAIR)
             .on('finish', function(){
                 console.log('Adobe AIR download complete');
+                extract();
+            })
+    );
+}
+
+function extract()
+{
+    console.log('Extracting Adobe AIR');
+    fs.createReadStream(constants.DOWNLOADS_FOLDER + fileNameAdobeAIR)
+        .pipe(unzip.Extract({ path: constants.FLEXJS_FOLDER })
+            .on('finish', function(){
+                console.log('Adobe AIR extraction complete');
                 AdobeAIR.emit('complete');
             })
     );
-};
+}
 
 AdobeAIR.install = function()
 {
-    AdobeAIR.promptForAdobeAIR();
+    promptForAdobeAIR();
 };
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e0b76776/npm-flexjs/dependencies/ApacheFalcon.js
----------------------------------------------------------------------
diff --git a/npm-flexjs/dependencies/ApacheFalcon.js b/npm-flexjs/dependencies/ApacheFalcon.js
index d9d1c5e..5a2996b 100644
--- a/npm-flexjs/dependencies/ApacheFalcon.js
+++ b/npm-flexjs/dependencies/ApacheFalcon.js
@@ -22,6 +22,8 @@ var request = require('request');
 var fs = require('fs');
 var events = require('events');
 var unzip = require('unzip');
+var wrench = require('wrench');
+var mkdirp = require('mkdirp');
 
 var constants = require('../dependencies/Constants');
 var duc = require('../dependencies/DownloadUncompressAndCopy');
@@ -54,7 +56,7 @@ var falconDependencies = [
         remoteFileName:'commons-cli-1.2-bin.zip',
         destinationPath:constants.DOWNLOADS_FOLDER,
         destinationFileName:'',
-        pathOfFileToBeCopiedFrom:constants.DOWNLOADS_FOLDER + 'commons-cli-1.2/commons-cli-1.2.jar',
+        pathOfFileToBeCopiedFrom:'commons-cli-1.2/commons-cli-1.2.jar',
         pathOfFileToBeCopiedTo:constants.DOWNLOADS_FOLDER + falconCompilerLibFolder + 'commons-cli.jar',
         unzip:true
     },
@@ -63,9 +65,48 @@ var falconDependencies = [
         remoteFileName:'commons-io-2.4-bin.zip',
         destinationPath:constants.DOWNLOADS_FOLDER,
         destinationFileName:'',
-        pathOfFileToBeCopiedFrom:constants.DOWNLOADS_FOLDER + 'commons-io-2.4/commons-io-2.4.jar',
+        pathOfFileToBeCopiedFrom:'commons-io-2.4/commons-io-2.4.jar',
         pathOfFileToBeCopiedTo:constants.DOWNLOADS_FOLDER + falconCompilerLibFolder + 'commons-io.jar',
         unzip:true
+    },
+    {
+        url:'http://search.maven.org/remotecontent?filepath=/com/google/guava/guava/17.0/',
+        remoteFileName:'guava-17.0.jar',
+        destinationPath:constants.DOWNLOADS_FOLDER + falconCompilerLibFolder,
+        destinationFileName:'guava.jar',
+        unzip:false
+    },
+    {
+        url:'http://apacheflexbuild.cloudapp.net:8080/job/flex-falcon/ws/compiler/lib/',
+        remoteFileName:'jburg.jar',
+        destinationPath:constants.DOWNLOADS_FOLDER + falconCompilerLibFolder,
+        destinationFileName:'jburg.jar',
+        unzip:false
+    },
+    {
+        url:'http://jflex.de/',
+        remoteFileName:'jflex-1.6.0.zip',
+        destinationPath:constants.DOWNLOADS_FOLDER,
+        destinationFileName:'',
+        pathOfFileToBeCopiedFrom:'jflex-1.6.0/lib/jflex-1.6.0.jar',
+        pathOfFileToBeCopiedTo:constants.DOWNLOADS_FOLDER + falconCompilerLibFolder + 'jflex.jar',
+        unzip:true
+    },
+    {
+        url:'http://www.java2s.com/Code/JarDownload/lzma/',
+        remoteFileName:'lzma-9.20.jar.zip',
+        destinationPath:constants.DOWNLOADS_FOLDER + 'lzma/',
+        destinationFileName:'lzma-9.20.jar.zip',
+        pathOfFileToBeCopiedFrom:'lzma-9.20.jar',
+        pathOfFileToBeCopiedTo:constants.DOWNLOADS_FOLDER + falconCompilerLibFolder + 'lzma-sdk.jar',
+        unzip:true
+    },
+    {
+        url:'http://search.maven.org/remotecontent?filepath=/org/apache/flex/flex-tool-api/1.0.0/',
+        remoteFileName:'flex-tool-api-1.0.0.jar',
+        destinationPath:constants.DOWNLOADS_FOLDER + falconCompilerLibFolder,
+        destinationFileName:'flex-tool-api.jar',
+        unzip:false
     }
 ];
 
@@ -130,7 +171,7 @@ ApacheFalcon.downloadNextDependency = function()
     }
     else
     {
-        duc.on("downloadComplete", handleDependencyInstallComplete);
+        duc.on("installComplete", handleDependencyInstallComplete);
         duc.install(falconDependencies[currentStep]);
     }
 };
@@ -142,9 +183,31 @@ function handleDependencyInstallComplete(event)
 
 ApacheFalcon.dependenciesComplete = function()
 {
+    duc.removeListener("installComplete", handleDependencyInstallComplete);
+    copyFiles();
     ApacheFalcon.falconInstallComplete();
 };
 
+function copyFiles()
+{
+    //Ant TODO:FIXME
+
+    //Bin
+    //Create downloads directory if it does not exist already
+    try
+    {
+        mkdirp(constants.FLEXJS_FOLDER + 'bin');
+    }
+    catch(e)
+    {
+        if ( e.code != 'EEXIST' ) throw e;
+    }
+    wrench.copyDirSyncRecursive(constants.DOWNLOADS_FOLDER + 'falcon/compiler/generated/dist/sdk/bin',
+        constants.FLEXJS_FOLDER + 'bin', {
+            forceDelete: true
+        });
+}
+
 ApacheFalcon.falconInstallComplete = function()
 {
     ApacheFalcon.emit('complete');

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e0b76776/npm-flexjs/dependencies/ApacheFlexJS.js
----------------------------------------------------------------------
diff --git a/npm-flexjs/dependencies/ApacheFlexJS.js b/npm-flexjs/dependencies/ApacheFlexJS.js
index d618e87..23e79f6 100644
--- a/npm-flexjs/dependencies/ApacheFlexJS.js
+++ b/npm-flexjs/dependencies/ApacheFlexJS.js
@@ -53,7 +53,7 @@ ApacheFlexJS.extract = function()
 {
     console.log('Extracting Apache FlexJS');
     fs.createReadStream(constants.DOWNLOADS_FOLDER + fileNameFlexJSBinary)
-        .pipe(unzip.Extract({ path: constants.NODE_MODULES_FOLDER + constants.FLEXJS_FOLDER })
+        .pipe(unzip.Extract({ path: constants.FLEXJS_FOLDER })
             .on('finish', function(){
                 console.log('Apache FlexJS extraction complete');
                 ApacheFlexJS.emit('complete');

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e0b76776/npm-flexjs/dependencies/Constants.js
----------------------------------------------------------------------
diff --git a/npm-flexjs/dependencies/Constants.js b/npm-flexjs/dependencies/Constants.js
index 84539ae..98305a3 100644
--- a/npm-flexjs/dependencies/Constants.js
+++ b/npm-flexjs/dependencies/Constants.js
@@ -22,7 +22,7 @@ module.exports =
 {
     APACHE_MIRROR_RESOLVER_URL : 'http://www.apache.org/dyn/mirrors/mirrors.cgi/',
     REQUEST_JSON_PARAM : 'asjson=true',
-    DOWNLOADS_FOLDER : 'downloads/',
-    FLEXJS_FOLDER: 'flexjs',
+    DOWNLOADS_FOLDER : 'node_modules/flexjs/downloads/',
+    FLEXJS_FOLDER: 'node_modules/flexjs/',
     NODE_MODULES_FOLDER: 'node_modules/'
 };
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e0b76776/npm-flexjs/dependencies/DownloadUncompressAndCopy.js
----------------------------------------------------------------------
diff --git a/npm-flexjs/dependencies/DownloadUncompressAndCopy.js b/npm-flexjs/dependencies/DownloadUncompressAndCopy.js
index 1c6d1fe..d15e18f 100644
--- a/npm-flexjs/dependencies/DownloadUncompressAndCopy.js
+++ b/npm-flexjs/dependencies/DownloadUncompressAndCopy.js
@@ -39,7 +39,7 @@ DownloadUncompressAndCopy.downloadFile = function(item)
                 {//Unzip
                     console.log('Uncompressing:  ' + constants.DOWNLOADS_FOLDER + item.remoteFileName);
                     fs.createReadStream(constants.DOWNLOADS_FOLDER + item.remoteFileName)
-                        .pipe(unzip.Extract({ path: item.destinationPath + item.destinationFileName})
+                    /*.pipe(unzip.Extract({ path: item.destinationPath + item.destinationFileName})
                             .on('finish', function(){
                                 console.log('Finished uncompressing: ' + constants.DOWNLOADS_FOLDER + item.remoteFileName + ' to: ' + item.destinationPath + item.destinationFileName);
                                 if(item.pathOfFileToBeCopiedTo != undefined)
@@ -47,19 +47,44 @@ DownloadUncompressAndCopy.downloadFile = function(item)
                                     fs.createReadStream(item.pathOfFileToBeCopiedFrom)
                                         .pipe(fs.createWriteStream(item.pathOfFileToBeCopiedTo)
                                         .on('finish',function(){
-                                        DownloadUncompressAndCopy.emit('downloadComplete');
+                                        DownloadUncompressAndCopy.emit('installComplete');
                                     }));
                                 }
-                            })
-                    );
+                                else
+                                {
+                                    DownloadUncompressAndCopy.emit('installComplete');
+                                }
+                            })*/
+                        .pipe(unzip.Parse())
+                        .on('entry', function (entry) {
+                            var fileName = entry.path;
+                            var type = entry.type; // 'Directory' or 'File'
+                            var size = entry.size;
+                            if (fileName === item.pathOfFileToBeCopiedFrom) {
+                                entry.pipe(fs.createWriteStream(item.pathOfFileToBeCopiedTo));
+                            } else {
+                                entry.autodrain();
+                            }
+                        })
+                        .on('finish', function(){
+                            console.log('Finished uncompressing: ' + constants.DOWNLOADS_FOLDER + item.remoteFileName + ' to: ' + item.destinationPath + item.destinationFileName);
+                            DownloadUncompressAndCopy.emit('installComplete');
+                        })
+
                 }
                 else
                 {//Just copy
-                    fs.createReadStream(constants.DOWNLOADS_FOLDER + item.remoteFileName)
-                        .pipe(fs.createWriteStream(item.destinationPath + item.destinationFileName)
-                        .on('finish',function() {
-                                DownloadUncompressAndCopy.emit('downloadComplete');
-                            }));
+                    if((constants.DOWNLOADS_FOLDER + item.remoteFileName == item.destinationPath + item.destinationFileName))
+                    {
+                        DownloadUncompressAndCopy.emit('installComplete');
+                    }
+                    else {
+                        fs.createReadStream(constants.DOWNLOADS_FOLDER + item.remoteFileName)
+                            .pipe(fs.createWriteStream(item.destinationPath + item.destinationFileName)
+                                .on('finish',function() {
+                                    DownloadUncompressAndCopy.emit('installComplete');
+                                }));
+                    }
                 }
             })
     );

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e0b76776/npm-flexjs/dependencies/FlashPlayerGlobal.js
----------------------------------------------------------------------
diff --git a/npm-flexjs/dependencies/FlashPlayerGlobal.js b/npm-flexjs/dependencies/FlashPlayerGlobal.js
index 1b820e8..ff15bdf 100644
--- a/npm-flexjs/dependencies/FlashPlayerGlobal.js
+++ b/npm-flexjs/dependencies/FlashPlayerGlobal.js
@@ -24,6 +24,7 @@ var events = require('events');
 var prompt = require('prompt');
 
 var constants = require('../dependencies/Constants');
+var duc = require('../dependencies/DownloadUncompressAndCopy');
 
 var FlashPlayerGlobal = module.exports = Object.create(events.EventEmitter.prototype);
 
@@ -63,22 +64,35 @@ FlashPlayerGlobal.promptForFlashPlayerGlobal = function()
         {
             FlashPlayerGlobal.downloadFlashPlayerGlobal();
         }
+        else
+        {
+            console.log('Aborting installation');
+        }
     });
 };
 
 FlashPlayerGlobal.downloadFlashPlayerGlobal = function()
 {
     console.log('Downloading Adobe FlashPlayerGlobal.swc ');
-    request
-        .get(flashPlayerGlobalURL + fileNameFlashPlayerGlobal)
-        .pipe(fs.createWriteStream(constants.DOWNLOADS_FOLDER + fileNameFlashPlayerGlobal)
-            .on('finish', function(){
-                console.log('FlashPlayerGlobal download complete');
-                FlashPlayerGlobal.emit('complete');
-            })
-    );
+
+    var downloadDetails = {
+        url:flashPlayerGlobalURL,
+        remoteFileName:fileNameFlashPlayerGlobal,
+        destinationPath:constants.DOWNLOADS_FOLDER,
+        destinationFileName:fileNameFlashPlayerGlobal,
+        unzip:false
+    };
+
+    duc.on('installComplete', handleInstallComplete);
+    duc.install(downloadDetails);
+
 };
 
+function handleInstallComplete(event)
+{
+    FlashPlayerGlobal.emit('complete');
+}
+
 FlashPlayerGlobal.install = function()
 {
     FlashPlayerGlobal.promptForFlashPlayerGlobal();

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e0b76776/npm-flexjs/dependencies/SWFObject.js
----------------------------------------------------------------------
diff --git a/npm-flexjs/dependencies/SWFObject.js b/npm-flexjs/dependencies/SWFObject.js
index 7af6052..5212c4f 100644
--- a/npm-flexjs/dependencies/SWFObject.js
+++ b/npm-flexjs/dependencies/SWFObject.js
@@ -27,7 +27,8 @@ var constants = require('../dependencies/Constants');
 var SWFObject = module.exports = Object.create(events.EventEmitter.prototype);
 
 //SWFObject
-var swfObjectURL = 'https://github.com/swfobject/swfobject/archive/2.2.zip';
+//var swfObjectURL = 'https://github.com/swfobject/swfobject/archive/2.2.zip';
+var swfObjectURL = 'https://swfobject.googlecode.com/files/';
 var fileNameSwfObject = 'swfobject_2_2.zip';
 
 SWFObject.downloadSwfObject = function()

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e0b76776/npm-flexjs/download_dependencies.js
----------------------------------------------------------------------
diff --git a/npm-flexjs/download_dependencies.js b/npm-flexjs/download_dependencies.js
index 122fe6d..8187566 100644
--- a/npm-flexjs/download_dependencies.js
+++ b/npm-flexjs/download_dependencies.js
@@ -20,6 +20,7 @@
 'use strict';
 
 var fs = require('fs');
+var mkdirp = require('mkdirp');
 var constants = require('./dependencies/Constants');
 var adobeair = require('./dependencies/AdobeAIR');
 var flashplayerglobal = require('./dependencies/FlashPlayerGlobal');
@@ -31,9 +32,10 @@ var installSteps = [
     createDownloadsDirectory,
     installFlashPlayerGlobal,
     installAdobeAIR,
+    installSWFObject,
     installApacheFlexJS,
-    installApacheFalcon,
-    installSWFObject];
+    installApacheFalcon
+    ];
 var currentStep = 0;
 
 function start()
@@ -46,7 +48,7 @@ function createDownloadsDirectory()
     //Create downloads directory if it does not exist already
     try
     {
-        fs.mkdirSync(constants.DOWNLOADS_FOLDER);
+        mkdirp(constants.DOWNLOADS_FOLDER);
     }
     catch(e)
     {
@@ -73,37 +75,37 @@ function handleInstallStepComplete(event)
 
 function installFlashPlayerGlobal()
 {
-    flashplayerglobal.on('complete', handleInstallStepComplete);
+    flashplayerglobal.once('complete', handleInstallStepComplete);
     flashplayerglobal.install();
 }
 
 function installAdobeAIR(event)
 {
-    adobeair.on('complete', handleInstallStepComplete);
+    adobeair.once('complete', handleInstallStepComplete);
     adobeair.install();
 }
 
 function installApacheFlexJS(event)
 {
-    apacheFlexJS.on('complete', handleInstallStepComplete);
+    apacheFlexJS.once('complete', handleInstallStepComplete);
     apacheFlexJS.install();
 }
 
 function installApacheFalcon(event)
 {
-    apacheFalcon.on('complete', handleInstallStepComplete);
+    apacheFalcon.once('complete', handleInstallStepComplete);
     apacheFalcon.install();
 }
 
 function installSWFObject(event)
 {
-    swfObject.on('complete', handleInstallStepComplete);
+    swfObject.once('complete', handleInstallStepComplete);
     swfObject.install();
 }
 
 function allDownloadsComplete()
 {
-    console.log('Completed all downloads');
+    console.log('Finished all downloads');
 }
 
 start();

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e0b76776/npm-flexjs/package.json
----------------------------------------------------------------------
diff --git a/npm-flexjs/package.json b/npm-flexjs/package.json
index b16e4ac..fa3a420 100644
--- a/npm-flexjs/package.json
+++ b/npm-flexjs/package.json
@@ -20,8 +20,10 @@
   "author": "OmPrakash Muppirala <bi...@apache.org>",
   "license": "Apache-2.0",
   "dependencies": {
+    "mkdirp": "^0.5.1",
     "prompt": "^0.2.14",
     "request": "^2.67.0",
-    "unzip": "^0.1.11"
+    "unzip": "^0.1.11",
+    "wrench": "^1.5.8"
   }
 }