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/01/04 10:04:10 UTC

git commit: [flex-utilities] [refs/heads/feature-npm-install] - Fix config files as needed. Remove unnecessary echos from scripts.

Repository: flex-utilities
Updated Branches:
  refs/heads/feature-npm-install dcd627bb2 -> eae737d11


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/eae737d1
Tree: http://git-wip-us.apache.org/repos/asf/flex-utilities/tree/eae737d1
Diff: http://git-wip-us.apache.org/repos/asf/flex-utilities/diff/eae737d1

Branch: refs/heads/feature-npm-install
Commit: eae737d11fb1c28f1996a241c65093e502aedcad
Parents: dcd627b
Author: OmPrakash Muppirala <bi...@gmail.com>
Authored: Mon Jan 4 01:03:46 2016 -0800
Committer: OmPrakash Muppirala <bi...@gmail.com>
Committed: Mon Jan 4 01:03:46 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/eae737d1/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/eae737d1/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/eae737d1/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/eae737d1/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