npm-flexjs: added configuration keys to allow nightly builds to be installed with npm
Project: http://git-wip-us.apache.org/repos/asf/flex-utilities/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-utilities/commit/233d8e9d Tree: http://git-wip-us.apache.org/repos/asf/flex-utilities/tree/233d8e9d Diff: http://git-wip-us.apache.org/repos/asf/flex-utilities/diff/233d8e9d Branch: refs/heads/develop Commit: 233d8e9d5d0a9f945fda31849690821e7d7f703b Parents: 511bdcb Author: Josh Tynjala <[email protected]> Authored: Tue May 30 10:19:17 2017 -0700 Committer: Josh Tynjala <[email protected]> Committed: Tue May 30 10:31:05 2017 -0700 ---------------------------------------------------------------------- npm-flexjs/dependencies/ApacheFalcon.js | 35 +++++++++++++++++++-------- npm-flexjs/dependencies/ApacheFlexJS.js | 36 ++++++++++++++++++++-------- 2 files changed, 51 insertions(+), 20 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/233d8e9d/npm-flexjs/dependencies/ApacheFalcon.js ---------------------------------------------------------------------- diff --git a/npm-flexjs/dependencies/ApacheFalcon.js b/npm-flexjs/dependencies/ApacheFalcon.js index c336416..64dd583 100644 --- a/npm-flexjs/dependencies/ApacheFalcon.js +++ b/npm-flexjs/dependencies/ApacheFalcon.js @@ -425,14 +425,29 @@ ApacheFalcon.falconInstallComplete = function() ApacheFalcon.install = function() { - request(constants.APACHE_MIRROR_RESOLVER_URL + pathToFalconBinary + fileNameFalconBinary + '?' + constants.REQUEST_JSON_PARAM, ApacheFalcon.handleFalconMirrorsResponse); - console.log('Downloading Apache Flex Falcon Compiler'); - /*request - .get("http://apacheflexbuild.cloudapp.net:8080/job/flex-falcon/lastSuccessfulBuild/artifact/out/apache-flex-falconjx-0.7.0-bin.zip") - .pipe(fs.createWriteStream(constants.DOWNLOADS_FOLDER + fileNameFalconBinary) - .on('finish', function(){ - console.log('Apache Flex Falcon Compiler download complete'); - ApacheFalcon.extract(); - }) - );*/ + var isNightly = process.env.npm_package_config_nightly === "true"; + if(isNightly) + { + var downloadURL = process.env.npm_package_config_falcon_nightly_url; + } + else + { + downloadURL = constants.APACHE_MIRROR_RESOLVER_URL + pathToFalconBinary + fileNameFalconBinary + '?' + constants.REQUEST_JSON_PARAM; + } + console.log('Downloading Apache Flex "Falcon" Compiler from ' + downloadURL); + if(isNightly) + { + request + .get(downloadURL) + .pipe(fs.createWriteStream(constants.DOWNLOADS_FOLDER + fileNameFalconBinary) + .on('finish', function(){ + console.log('Apache Flex Falcon Compiler download complete'); + ApacheFalcon.extract(); + }) + ); + } + else + { + request(downloadURL, ApacheFalcon.handleFalconMirrorsResponse); + } }; \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/233d8e9d/npm-flexjs/dependencies/ApacheFlexJS.js ---------------------------------------------------------------------- diff --git a/npm-flexjs/dependencies/ApacheFlexJS.js b/npm-flexjs/dependencies/ApacheFlexJS.js index 2dc3c43..688fc4e 100644 --- a/npm-flexjs/dependencies/ApacheFlexJS.js +++ b/npm-flexjs/dependencies/ApacheFlexJS.js @@ -64,14 +64,30 @@ ApacheFlexJS.extract = function() ApacheFlexJS.install = function() { - request(constants.APACHE_MIRROR_RESOLVER_URL + pathToFlexJSBinary + fileNameFlexJSBinary + '?' + constants.REQUEST_JSON_PARAM, ApacheFlexJS.handleFlexJSMirrorsResponse); - console.log('Downloading Apache FlexJS'); - /*request - .get("http://apacheflexbuild.cloudapp.net:8080/job/flex-asjs/lastSuccessfulBuild/artifact/out/apache-flex-flexjs-0.7.0-bin.zip") - .pipe(fs.createWriteStream(constants.DOWNLOADS_FOLDER + fileNameFlexJSBinary) - .on('close', function(){ - console.log('Apache FlexJS download complete'); - ApacheFlexJS.extract(); - }) - );*/ + //uncomment to test a nightly build + var isNightly = process.env.npm_package_config_nightly === "true"; + if(isNightly) + { + var downloadURL = process.env.npm_package_config_flexjs_nightly_url; + } + else + { + downloadURL = constants.APACHE_MIRROR_RESOLVER_URL + pathToFlexJSBinary + fileNameFlexJSBinary + '?' + constants.REQUEST_JSON_PARAM; + } + console.log('Downloading Apache FlexJS from ' + downloadURL); + if(isNightly) + { + request + .get(downloadURL) + .pipe(fs.createWriteStream(constants.DOWNLOADS_FOLDER + fileNameFlexJSBinary) + .on('close', function(){ + console.log('Apache FlexJS download complete'); + ApacheFlexJS.extract(); + }) + ); + } + else + { + request(downloadURL, ApacheFlexJS.handleFlexJSMirrorsResponse); + } }; \ No newline at end of file
