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 02:01:08 UTC

[royale-asjs] branch release/0.9.6 updated (ab702f6 -> 695594a)

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

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


    from ab702f6  Revert commit: 6b11fcfa2951848a8a272f6832729cb789ac8c05
     new d75e9ad  update script for latest npm versions (npm.registry was removed from npm API)
     new cb472d3  works better on Mac
     new 9ec3e15  use correct folder
     new 695594a  remove beta from version

The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 npm/js-only/package.json                           |  2 +-
 npm/js-swf/dependencies/AdobeAIR.js                | 78 +++++++++++++++++++++-
 .../dependencies/DownloadUncompressAndCopy.js      | 11 ++-
 npm/js-swf/dependencies/FlashPlayerGlobal.js       |  5 +-
 npm/js-swf/package.json                            |  9 ++-
 npm/release-scripts/package.json                   |  3 +-
 npm/release-scripts/publish.js                     | 39 +++++++----
 package.json                                       |  4 +-
 8 files changed, 124 insertions(+), 27 deletions(-)


[royale-asjs] 02/04: works better on Mac

Posted by ah...@apache.org.
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

commit cb472d355cc7f8b1628b434a7135c3152c9e0730
Author: Alex Harui <ah...@apache.org>
AuthorDate: Wed Sep 11 16:17:25 2019 -0700

    works better on Mac
---
 npm/js-only/package.json                           |  2 +-
 npm/js-swf/dependencies/AdobeAIR.js                | 76 +++++++++++++++++++++-
 .../dependencies/DownloadUncompressAndCopy.js      | 11 +++-
 npm/js-swf/dependencies/FlashPlayerGlobal.js       |  5 +-
 npm/js-swf/package.json                            |  9 ++-
 npm/release-scripts/package.json                   |  3 +-
 package.json                                       |  4 +-
 7 files changed, 97 insertions(+), 13 deletions(-)

diff --git a/npm/js-only/package.json b/npm/js-only/package.json
index 75cf1a6..e0189aa 100644
--- a/npm/js-only/package.json
+++ b/npm/js-only/package.json
@@ -1,6 +1,6 @@
 {
   "name": "@apache-royale/royale-js",
-  "version": "0.9.6-beta0",
+  "version": "0.9.6-beta1",
   "description": "Apache Royale (formerly FlexJS)",
   "keywords": [
     "royale",
diff --git a/npm/js-swf/dependencies/AdobeAIR.js b/npm/js-swf/dependencies/AdobeAIR.js
index 7ed3598..fa221ee 100644
--- a/npm/js-swf/dependencies/AdobeAIR.js
+++ b/npm/js-swf/dependencies/AdobeAIR.js
@@ -25,13 +25,24 @@ var prompt = require('prompt');
 var unzip = require('unzipper');
 var pjson = require('../package');
 
+var isMac = false;
+var os = require('os');
+if (os.type() === 'Darwin') 
+   isMac = true;
+
 var constants = require('../dependencies/Constants');
 
+var inExpand = false;
+
 var AdobeAIR = module.exports = Object.create(events.EventEmitter.prototype);
 
 //Adobe AIR
 var AdobeAIRURL = pjson.org_apache_royale.adobe_air_url;
 var fileNameAdobeAIR = pjson.org_apache_royale.adobe_air_file_name;
+if (isMac) {
+	AdobeAIRURL = pjson.org_apache_royale.adobe_air_url_mac;
+    fileNameAdobeAIR = pjson.org_apache_royale.adobe_air_file_name_mac;
+}
 
 var adobeAirPromptText = "\
 Apache Royale SWF support uses the Adobe AIR SDK to build Adobe AIR applications.\n\
@@ -74,19 +85,24 @@ function downloadAdobeAIR()
     console.log('Downloading Adobe AIR from ' + downloadURL);
     request
         .get(downloadURL)
-        .pipe(fs.createWriteStream(constants.DOWNLOADS_FOLDER + fileNameAdobeAIR)
+        .pipe(fs.createWriteStream(constants.DOWNLOADS_FOLDER + fileNameAdobeAIR, {emitClose:true})
             .on('close', function(){
                 console.log('Adobe AIR download complete');
-                extract();
+				if (!isMac)
+	                extract();
+				else
+					expand();
             })
     );
 }
 
 function extract()
 {
+	var pathResolver = require('path');
+	var absPath = pathResolver.resolve(constants.ROYALE_FOLDER);
     console.log('Extracting Adobe AIR');
     fs.createReadStream(constants.DOWNLOADS_FOLDER + fileNameAdobeAIR)
-        .pipe(unzip.Extract({ path: constants.ROYALE_FOLDER })
+        .pipe(unzip.Extract({ path: absPath })
             .on('close', function(){
                 console.log('Adobe AIR extraction complete');
                 AdobeAIR.emit('complete');
@@ -94,6 +110,60 @@ function extract()
     );
 }
 
+ function expand()
+ {
+	if (inExpand) return;
+	inExpand = true;
+    console.log('Extracting Adobe AIR (DMG)');
+	var dmg = require('dmg');
+    var fse = require('fs-extra');
+ 
+    // path must be absolute and the extension must be .dmg
+    var myDmg = constants.DOWNLOADS_FOLDER + fileNameAdobeAIR; 
+ 
+    // to open & mount the dmg
+    dmg.mount(myDmg, function(err, path) {
+	  if (!err) {
+		var folders = fse.readdirSync(path);
+		for (var i = 0; i < folders.length; i++) {
+			var folderName = folders[i];
+			var destFolder = constants.ROYALE_FOLDER + "royale-asjs/" + folderName;
+			var srcFolder = path + "/" + folderName;
+			console.log(destFolder);
+			if (!fse.existsSync(destFolder)) {
+				console.log("copying " + srcFolder + " -> " + destFolder);
+			    fse.copySync(srcFolder, destFolder);
+			}
+			else {
+				copyfolder(fse, srcFolder, destFolder);
+			}
+			
+		}
+        dmg.unmount(path, function(err) {});
+	  }});
+	  
+   function copyfolder(fse, sourcePath, destPath) {
+		console.log("copyfolder: " + sourcePath + " -> " + destPath);
+	    var stat = fse.statSync(destPath);
+		if (stat.isDirectory()) {
+  	      var folders = fse.readdirSync(sourcePath);
+		  for (var i = 0; i < folders.length; i++) {
+			var folderName = folders[i];
+			var destFolder = destPath + "/" + folderName;
+			var srcFolder = sourcePath + "/" + folderName;
+			console.log(destFolder);
+			if (!fse.existsSync(destFolder)) {
+				console.log("copying " + srcFolder + " -> " + destFolder);
+			    fse.copySync(srcFolder, destFolder);
+			}
+			else {
+				copyfolder(fse, srcFolder, destFolder);
+			}			
+		  }
+		}
+      }
+   }
+
 AdobeAIR.install = function()
 {
     if(process.env.ACCEPT_ALL_ROYALE_LICENSES === 'true')
diff --git a/npm/js-swf/dependencies/DownloadUncompressAndCopy.js b/npm/js-swf/dependencies/DownloadUncompressAndCopy.js
index 6b5e5a7..5a49fe0 100644
--- a/npm/js-swf/dependencies/DownloadUncompressAndCopy.js
+++ b/npm/js-swf/dependencies/DownloadUncompressAndCopy.js
@@ -28,6 +28,8 @@ var DownloadUncompressAndCopy = module.exports = Object.create(events.EventEmitt
 
 DownloadUncompressAndCopy.downloadFile = function(item)
 {
+	var inClose = false;
+	
     console.log('Downloading: ' + item.url + item.remoteFileName);
     request
         .get(item.url + item.remoteFileName)
@@ -39,8 +41,10 @@ DownloadUncompressAndCopy.downloadFile = function(item)
             }
             else
             {
-                response.pipe(fs.createWriteStream(constants.DOWNLOADS_FOLDER + item.remoteFileName)
+                response.pipe(fs.createWriteStream(constants.DOWNLOADS_FOLDER + item.remoteFileName, {emitClose:true})
                     .on('close', function(){
+						if (inClose) return;
+						inClose = true;
                         console.log('Finished downloading: ' + item.url + item.remoteFileName);
                         if(item.unzip)
                         {//Unzip
@@ -71,7 +75,10 @@ DownloadUncompressAndCopy.downloadFile = function(item)
                             }
                             else
                             {
-                                fs.createReadStream(constants.DOWNLOADS_FOLDER + item.remoteFileName)
+								if (!fs.existsSync(item.destinationPath)) {
+									fs.ensureDirSync(item.destinationPath);
+								}
+                                fs.createReadStream(constants.DOWNLOADS_FOLDER + item.remoteFileName, {emitClose:true})
                                     .pipe(fs.createWriteStream(item.destinationPath + item.destinationFileName))
                                     .on('close', function(){
                                         console.log("Copied " + constants.DOWNLOADS_FOLDER + item.remoteFileName + " to " +
diff --git a/npm/js-swf/dependencies/FlashPlayerGlobal.js b/npm/js-swf/dependencies/FlashPlayerGlobal.js
index bfb6edd..9bc9561 100644
--- a/npm/js-swf/dependencies/FlashPlayerGlobal.js
+++ b/npm/js-swf/dependencies/FlashPlayerGlobal.js
@@ -31,6 +31,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 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\
@@ -80,8 +81,8 @@ FlashPlayerGlobal.downloadFlashPlayerGlobal = function()
     var downloadDetails = {
         url:flashPlayerGlobalURL,
         remoteFileName:fileNameFlashPlayerGlobal,
-        destinationPath:constants.DOWNLOADS_FOLDER,
-        destinationFileName:fileNameFlashPlayerGlobal,
+        destinationPath:constants.ROYALE_FOLDER + folderFlashPlayerGlobal,
+        destinationFileName:"playerglobal.swc",
         unzip:false
     };
 
diff --git a/npm/js-swf/package.json b/npm/js-swf/package.json
index dcc4e90..82260fc 100644
--- a/npm/js-swf/package.json
+++ b/npm/js-swf/package.json
@@ -1,6 +1,6 @@
 {
   "name": "@apache-royale/royale-js-swf",
-  "version": "0.9.6-beta0",
+  "version": "0.9.6-beta8",
   "description": "Apache Royale (formerly FlexJS)",
   "keywords": [
     "royale",
@@ -18,16 +18,18 @@
   "author": "Apache Royale <de...@royale.apache.org>",
   "license": "Apache-2.0",
   "dependencies": {
+    "dmg": "0.1.0",
     "eol": "^0.2.0",
     "fs-extra": "^0.26.3",
     "merge-dirs": "^0.2.1",
     "mkdirp": "^0.5.1",
+    "os": "^0.1.1",
     "prompt": "^0.2.14",
     "request": "^2.67.0",
     "unzipper": "0.10.4"
   },
   "scripts": {
-    "postinstall": "node dependencies/download_dependencies.js"
+    "postinstall": "node royale-asjs/npm/js-swf/dependencies/download_dependencies.js"
   },
   "bin": {
     "asjsc": "./royale-asjs/js/bin/asjscnpm",
@@ -40,8 +42,11 @@
   "org_apache_royale": {
     "flash_player_global_url": "http://fpdownload.macromedia.com/get/flashplayer/installers/archive/playerglobal/",
     "flash_player_global_file_name": "playerglobal25_0.swc",
+    "flash_player_global_folder": "royale-asjs/frameworks/libs/player/25.0/",
     "adobe_air_url": "http://airdownload.adobe.com/air/win/download/25.0/",
     "adobe_air_file_name": "AdobeAIRSDK.zip",
+    "adobe_air_url_mac": "http://airdownload.adobe.com/air/mac/download/25.0/",
+    "adobe_air_file_name_mac": "AdobeAIRSDK.dmg",
     "player_version": "25.0",
     "swf_version": "36",
     "swf_object_url": "http://github.com/swfobject/swfobject/archive/",
diff --git a/npm/release-scripts/package.json b/npm/release-scripts/package.json
index b51cf7a..50d3cea 100644
--- a/npm/release-scripts/package.json
+++ b/npm/release-scripts/package.json
@@ -10,6 +10,7 @@
     "child_process": "1.0.2",
     "fs": "0.0.1-security",
     "npm": "5.6.0",
-    "yargs": "11.0.0"
+    "npm-registry-client": "^8.6.0",
+    "yargs": "^11.0.0"
   }
 }
diff --git a/package.json b/package.json
index d2665f1..566f97e 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
   "name": "apache-royale-swf",
-  "version": "0.9.6-beta0",
+  "version": "0.9.6-beta1",
   "description": "Apache Royale (formerly FlexJS) with SWF support",
   "keywords": [
     "royale",
@@ -38,7 +38,7 @@
     "externc": "./royale-asjs/js/bin/externcnpm"
   },
   "org_apache_royale": {
-    "flash_player_global_url": "http://download.macromedia.com/get/flashplayer/updaters/25/",
+    "flash_player_global_url": "http://fpdownload.macromedia.com/get/flashplayer/installers/archive/playerglobal/",
     "flash_player_global_file_name": "playerglobal25_0.swc",
     "adobe_air_url": "http://airdownload.adobe.com/air/win/download/25.0/",
     "adobe_air_file_name": "AdobeAIRSDK.zip",


[royale-asjs] 04/04: remove beta from version

Posted by ah...@apache.org.
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

commit 695594a91753d0455a22dcef2c81129aabcc2c1c
Author: Alex Harui <ah...@apache.org>
AuthorDate: Wed Sep 11 19:00:52 2019 -0700

    remove beta from version
---
 npm/js-only/package.json | 2 +-
 npm/js-swf/package.json  | 2 +-
 package.json             | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/npm/js-only/package.json b/npm/js-only/package.json
index e0189aa..779d247 100644
--- a/npm/js-only/package.json
+++ b/npm/js-only/package.json
@@ -1,6 +1,6 @@
 {
   "name": "@apache-royale/royale-js",
-  "version": "0.9.6-beta1",
+  "version": "0.9.6",
   "description": "Apache Royale (formerly FlexJS)",
   "keywords": [
     "royale",
diff --git a/npm/js-swf/package.json b/npm/js-swf/package.json
index 82260fc..70ca8ee 100644
--- a/npm/js-swf/package.json
+++ b/npm/js-swf/package.json
@@ -1,6 +1,6 @@
 {
   "name": "@apache-royale/royale-js-swf",
-  "version": "0.9.6-beta8",
+  "version": "0.9.6",
   "description": "Apache Royale (formerly FlexJS)",
   "keywords": [
     "royale",
diff --git a/package.json b/package.json
index 566f97e..8689317 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
   "name": "apache-royale-swf",
-  "version": "0.9.6-beta1",
+  "version": "0.9.6",
   "description": "Apache Royale (formerly FlexJS) with SWF support",
   "keywords": [
     "royale",


[royale-asjs] 03/04: use correct folder

Posted by ah...@apache.org.
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

commit 9ec3e15c9eb3bb66ce0dbd854091fd3a04547fd7
Author: Alex Harui <ah...@apache.org>
AuthorDate: Wed Sep 11 18:59:49 2019 -0700

    use correct folder
---
 npm/js-swf/dependencies/AdobeAIR.js | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/npm/js-swf/dependencies/AdobeAIR.js b/npm/js-swf/dependencies/AdobeAIR.js
index fa221ee..6754d5b 100644
--- a/npm/js-swf/dependencies/AdobeAIR.js
+++ b/npm/js-swf/dependencies/AdobeAIR.js
@@ -99,7 +99,9 @@ function downloadAdobeAIR()
 function extract()
 {
 	var pathResolver = require('path');
-	var absPath = pathResolver.resolve(constants.ROYALE_FOLDER);
+	// ROYALE_FOLDER is the base of the tar.gz package which has the 3 repos as children
+	// and not the royale-asjs repo
+	var absPath = pathResolver.resolve(constants.ROYALE_FOLDER + "royale-asjs/");
     console.log('Extracting Adobe AIR');
     fs.createReadStream(constants.DOWNLOADS_FOLDER + fileNameAdobeAIR)
         .pipe(unzip.Extract({ path: absPath })


[royale-asjs] 01/04: update script for latest npm versions (npm.registry was removed from npm API)

Posted by ah...@apache.org.
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

commit d75e9ad54e6a2f454c6397110d1926f0b818fb3b
Author: Alex Harui <ah...@apache.org>
AuthorDate: Tue Sep 10 19:28:19 2019 -0700

    update script for latest npm versions (npm.registry was removed from npm API)
---
 npm/release-scripts/publish.js | 39 +++++++++++++++++++++++++--------------
 1 file changed, 25 insertions(+), 14 deletions(-)

diff --git a/npm/release-scripts/publish.js b/npm/release-scripts/publish.js
index c67ac88..25fd08f 100644
--- a/npm/release-scripts/publish.js
+++ b/npm/release-scripts/publish.js
@@ -44,6 +44,13 @@ if (!type) {
 }
 
 try {
+	var RegClient = require('npm-registry-client');
+	var client = new RegClient();
+	client.adduser(npmURL, addUserParams, function(error) {
+		    if (error)
+			    throw new Error(error);
+	});
+	/*
     npm.load(null,function(loadError) {
         if (loadError) {
             throw new Error(loadError);
@@ -54,29 +61,33 @@ try {
                 throw new Error(addUserError);
             }
         });
+	*/
+    var metadata;
+    if(type == 'js-only') {
+        metadata = require('../js-only/package.json') ;
+    }
+    else if(type == 'js-swf') {
+        metadata = require('../js-swf/package.json') ;
+    }
+    var body = fs.createReadStream(pathToTarball);
+    var publishParams = {metadata: metadata, access: 'public', body: body, auth: auth};
 
-        var metadata;
-        if(type == 'js-only') {
-            metadata = require('../js-only/package.json') ;
-        }
-        else if(type == 'js-swf') {
-            metadata = require('../js-swf/package.json') ;
-        }
-        var body = fs.createReadStream(pathToTarball);
-        var publishParams = {metadata: metadata, access: 'public', body: body, auth: auth};
-
-        console.log('Publishing to NPM: ' + metadata.name + ' version: ' + metadata.version + '...');
+    console.log('Publishing to NPM: ' + metadata.name + ' version: ' + metadata.version + '...');
 
-        npm.registry.publish(npmURL, publishParams, function(publishError) {
+    client.publish(npmURL, publishParams, function(publishError) {
             if (publishError) {
                 throw new Error(publishError);
             }
             console.log('Successfully published: ' + metadata.name + ' version: ' + metadata.version);
         });
 
-    });
+/*    });
+	*/
 
 }
 catch (error) {
-    console.log('Failed to publish to npm ' +  metadata.name + ' version: ' + metadata.version + '\n error: ' + error);
+	if (metadata)
+	    console.log('Failed to publish to npm ' +  metadata.name + ' version: ' + metadata.version + '\n error: ' + error);
+	else
+		console.log('Failed to adduser ' + '\n error: ' + error);
 }