You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by ah...@apache.org on 2019/09/12 22:30:18 UTC

[royale-asjs] branch release/0.9.6 updated: have to update target-player in config.xml files to match playerglobal version

This is an automated email from the ASF dual-hosted git repository.

aharui pushed a commit to branch release/0.9.6
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git


The following commit(s) were added to refs/heads/release/0.9.6 by this push:
     new 2f6d52a  have to update target-player in config.xml files to match playerglobal version
2f6d52a is described below

commit 2f6d52a945f55f4dac623840144ca8bcebc88920
Author: Alex Harui <ah...@apache.org>
AuthorDate: Thu Sep 12 15:30:02 2019 -0700

    have to update target-player in config.xml files to match playerglobal version
---
 npm/js-swf/dependencies/FlashPlayerGlobal.js | 30 ++++++++++++++++++++++++++++
 npm/js-swf/package.json                      |  1 +
 2 files changed, 31 insertions(+)

diff --git a/npm/js-swf/dependencies/FlashPlayerGlobal.js b/npm/js-swf/dependencies/FlashPlayerGlobal.js
index 9bc9561..37954bd 100644
--- a/npm/js-swf/dependencies/FlashPlayerGlobal.js
+++ b/npm/js-swf/dependencies/FlashPlayerGlobal.js
@@ -32,6 +32,7 @@ var FlashPlayerGlobal = module.exports = Object.create(events.EventEmitter.proto
 var flashPlayerGlobalURL = pjson.org_apache_royale.flash_player_global_url;
 var fileNameFlashPlayerGlobal = pjson.org_apache_royale.flash_player_global_file_name;
 var folderFlashPlayerGlobal = pjson.org_apache_royale.flash_player_global_folder;
+var playerversion = pjson.org_apache_royale.player_version;
 var flashPlayerGlobalPromptText = "\
 Apache Royale SWF support uses the Adobe Flash Player's playerglobal.swc to build Adobe Flash applications.\n\
 The playerglobal.swc file is subject to and governed by the\n\
@@ -93,6 +94,35 @@ FlashPlayerGlobal.downloadFlashPlayerGlobal = function()
 
 function handleInstallComplete(event)
 {
+	const replace = require('replace-in-file');
+    const options = {
+      files: [constants.ROYALE_FOLDER + 'royale-asjs/frameworks/royale-config.xml',
+	  constants.ROYALE_FOLDER + 'royale-asjs/frameworks/flex-config.xml',
+	  constants.ROYALE_FOLDER + 'royale-asjs/frameworks/royale-config-template.xml',
+	  constants.ROYALE_FOLDER + 'royale-asjs/frameworks/flex-config-template.xml',
+	  constants.ROYALE_FOLDER + 'royale-asjs/frameworks/air-config.xml',
+	  constants.ROYALE_FOLDER + 'royale-asjs/frameworks/air-config-template.xml',
+	  constants.ROYALE_FOLDER + 'royale-asjs/frameworks/airmobile-config.xml',
+	  constants.ROYALE_FOLDER + 'royale-asjs/frameworks/js-config.xml',
+	  constants.ROYALE_FOLDER + 'royale-asjs/frameworks/js-config-template.xml',
+	  constants.ROYALE_FOLDER + 'royale-asjs/frameworks/jquery-config.xml',
+	  constants.ROYALE_FOLDER + 'royale-asjs/frameworks/jquery-config-template.xml',
+	  constants.ROYALE_FOLDER + 'royale-asjs/frameworks/createjs-config.xml',
+	  constants.ROYALE_FOLDER + 'royale-asjs/frameworks/createjs-config-template.xml',
+	  constants.ROYALE_FOLDER + 'royale-asjs/frameworks/node-config.xml',
+	  constants.ROYALE_FOLDER + 'royale-asjs/frameworks/node-config-template.xml'
+	  ],
+      from: /target-player.*target-player/g,
+      to: "target-player>" + playerversion + "</target-player",
+    };
+	try {
+      const results = replace.sync(options);
+      console.log('update target-player in config.xml files');
+    }
+    catch (error) {
+      console.error('Error occurred:', error);
+    }
+	
     FlashPlayerGlobal.emit('complete');
 }
 
diff --git a/npm/js-swf/package.json b/npm/js-swf/package.json
index 70ca8ee..2093818 100644
--- a/npm/js-swf/package.json
+++ b/npm/js-swf/package.json
@@ -25,6 +25,7 @@
     "mkdirp": "^0.5.1",
     "os": "^0.1.1",
     "prompt": "^0.2.14",
+    "replace-in-file": "4.1.3",
     "request": "^2.67.0",
     "unzipper": "0.10.4"
   },