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:26 UTC

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

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();