You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by jo...@apache.org on 2016/09/22 22:50:28 UTC

[1/2] git commit: [flex-utilities] [refs/heads/develop] - npm-flexjs: if a dependency of falcon fails to download, the installation aborts

Repository: flex-utilities
Updated Branches:
  refs/heads/develop 4efec79b0 -> 3f60486cc


npm-flexjs: if a dependency of falcon fails to download, the installation aborts


Project: http://git-wip-us.apache.org/repos/asf/flex-utilities/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-utilities/commit/08389f3a
Tree: http://git-wip-us.apache.org/repos/asf/flex-utilities/tree/08389f3a
Diff: http://git-wip-us.apache.org/repos/asf/flex-utilities/diff/08389f3a

Branch: refs/heads/develop
Commit: 08389f3ab08a27cfeaa0d26a45c6e18c3b68dc35
Parents: 4efec79
Author: Josh Tynjala <jo...@apache.org>
Authored: Thu Sep 22 15:39:04 2016 -0700
Committer: Josh Tynjala <jo...@apache.org>
Committed: Thu Sep 22 15:39:04 2016 -0700

----------------------------------------------------------------------
 npm-flexjs/dependencies/ApacheFalcon.js         |  6 ++
 .../dependencies/DownloadUncompressAndCopy.js   | 92 +++++++++++---------
 .../dependencies/download_dependencies.js       |  1 +
 3 files changed, 58 insertions(+), 41 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/08389f3a/npm-flexjs/dependencies/ApacheFalcon.js
----------------------------------------------------------------------
diff --git a/npm-flexjs/dependencies/ApacheFalcon.js b/npm-flexjs/dependencies/ApacheFalcon.js
index 4074fc6..dff2fba 100644
--- a/npm-flexjs/dependencies/ApacheFalcon.js
+++ b/npm-flexjs/dependencies/ApacheFalcon.js
@@ -289,11 +289,17 @@ ApacheFalcon.downloadNextDependency = function()
     }
     else
     {
+        duc.once("installFail", handleDependencyInstallFail);
         duc.once("installComplete", handleDependencyInstallComplete);
         duc.install(falconDependencies[currentStep]);
     }
 };
 
+function handleDependencyInstallFail(event)
+{
+    ApacheFalcon.emit('abort');
+}
+
 function handleDependencyInstallComplete(event)
 {
     ApacheFalcon.downloadNextDependency();

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/08389f3a/npm-flexjs/dependencies/DownloadUncompressAndCopy.js
----------------------------------------------------------------------
diff --git a/npm-flexjs/dependencies/DownloadUncompressAndCopy.js b/npm-flexjs/dependencies/DownloadUncompressAndCopy.js
index 2546359..2236991 100644
--- a/npm-flexjs/dependencies/DownloadUncompressAndCopy.js
+++ b/npm-flexjs/dependencies/DownloadUncompressAndCopy.js
@@ -31,49 +31,59 @@ DownloadUncompressAndCopy.downloadFile = function(item)
     console.log('Downloading: ' + item.url + item.remoteFileName);
     request
         .get(item.url + item.remoteFileName)
-        .pipe(fs.createWriteStream(constants.DOWNLOADS_FOLDER + item.remoteFileName)
-            .on('close', function(){
-                console.log('Finished downloading: ' + item.url + item.remoteFileName);
-                if(item.unzip)
-                {//Unzip
-                    console.log('Uncompressing:  ' + constants.DOWNLOADS_FOLDER + item.remoteFileName);
-                    fs.createReadStream(constants.DOWNLOADS_FOLDER + item.remoteFileName)
-                        .pipe(unzip.Parse())
-                        .on('entry', function (entry) {
-                            var fileName = entry.path;
-                            var type = entry.type; // 'Directory' or 'File'
-                            var size = entry.size;
-                            if (fileName === item.pathOfFileToBeCopiedFrom) {
-                                entry.pipe(fs.createWriteStream(item.pathOfFileToBeCopiedTo));
-                            } else {
-                                entry.autodrain();
-                            }
-                        })
-                        .on('finish', function(){
-                            console.log('Finished uncompressing: ' + constants.DOWNLOADS_FOLDER + item.remoteFileName + ' to: ' + item.destinationPath + item.destinationFileName);
-                            DownloadUncompressAndCopy.emit('installComplete');
-                        })
+        .on('response', function(response){
+            if(response.statusCode != 200)
+            {
+                console.log('Download failed with status code: ' + response.statusCode);
+                DownloadUncompressAndCopy.emit('installFail');
+            }
+            else
+            {
+                response.pipe(fs.createWriteStream(constants.DOWNLOADS_FOLDER + item.remoteFileName)
+                    .on('close', function(){
+                        console.log('Finished downloading: ' + item.url + item.remoteFileName);
+                        if(item.unzip)
+                        {//Unzip
+                            console.log('Uncompressing:  ' + constants.DOWNLOADS_FOLDER + item.remoteFileName);
+                            fs.createReadStream(constants.DOWNLOADS_FOLDER + item.remoteFileName)
+                                .pipe(unzip.Parse())
+                                .on('entry', function (entry) {
+                                    var fileName = entry.path;
+                                    var type = entry.type; // 'Directory' or 'File'
+                                    var size = entry.size;
+                                    if (fileName === item.pathOfFileToBeCopiedFrom) {
+                                        entry.pipe(fs.createWriteStream(item.pathOfFileToBeCopiedTo));
+                                    } else {
+                                        entry.autodrain();
+                                    }
+                                })
+                                .on('finish', function(){
+                                    console.log('Finished uncompressing: ' + constants.DOWNLOADS_FOLDER + item.remoteFileName + ' to: ' + item.destinationPath + item.destinationFileName);
+                                    DownloadUncompressAndCopy.emit('installComplete');
+                                })
 
-                }
-                else
-                {//Just copy
-                    if((constants.DOWNLOADS_FOLDER + item.remoteFileName === item.destinationPath + item.destinationFileName))
-                    {
-                        DownloadUncompressAndCopy.emit('installComplete');
-                    }
-                    else
-                    {
-                        fs.createReadStream(constants.DOWNLOADS_FOLDER + item.remoteFileName)
-                            .pipe(fs.createWriteStream(item.destinationPath + item.destinationFileName))
-                            .on('close', function(){
-                                console.log("Copied " + constants.DOWNLOADS_FOLDER + item.remoteFileName + " to " +
-                                    item.destinationPath + item.destinationFileName);
+                        }
+                        else
+                        {//Just copy
+                            if((constants.DOWNLOADS_FOLDER + item.remoteFileName === item.destinationPath + item.destinationFileName))
+                            {
                                 DownloadUncompressAndCopy.emit('installComplete');
-                            });
-                    }
-                }
-            })
-    );
+                            }
+                            else
+                            {
+                                fs.createReadStream(constants.DOWNLOADS_FOLDER + item.remoteFileName)
+                                    .pipe(fs.createWriteStream(item.destinationPath + item.destinationFileName))
+                                    .on('close', function(){
+                                        console.log("Copied " + constants.DOWNLOADS_FOLDER + item.remoteFileName + " to " +
+                                            item.destinationPath + item.destinationFileName);
+                                        DownloadUncompressAndCopy.emit('installComplete');
+                                    });
+                            }
+                        }
+                    })
+            );
+            }
+        })
 };
 
 DownloadUncompressAndCopy.install = function(item)

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/08389f3a/npm-flexjs/dependencies/download_dependencies.js
----------------------------------------------------------------------
diff --git a/npm-flexjs/dependencies/download_dependencies.js b/npm-flexjs/dependencies/download_dependencies.js
index ede182d..8d00cf1 100644
--- a/npm-flexjs/dependencies/download_dependencies.js
+++ b/npm-flexjs/dependencies/download_dependencies.js
@@ -162,6 +162,7 @@ function installApacheFlexJS(event)
 function installApacheFalcon(event)
 {
     apacheFalcon.once('complete', handleInstallStepComplete);
+    apacheFalcon.once('abort', handleAbort);
     apacheFalcon.install();
 }
 


Re: [2/2] git commit: [flex-utilities] [refs/heads/develop] - npm-flexjs: fixed broken URLs for guava and jburg JARs

Posted by OmPrakash Muppirala <bi...@gmail.com>.
I pushed out an update to npm with these fixes.

Thanks,
Om

On Thu, Sep 22, 2016 at 4:42 PM, OmPrakash Muppirala <bi...@gmail.com>
wrote:

> Good catch!
>
> Thanks,
> Om
>
> On Thu, Sep 22, 2016 at 4:07 PM, Josh Tynjala <jo...@gmail.com>
> wrote:
>
>> I discovered that the current version of FlexJS 0.7 on NPM cannot build
>> SWFs because a couple of dependencies failed to download (guava and
>> jburg).
>> The URLs were returning 404 status, but the install script didn't detect
>> the issue. Transpiling to JS works correctly with the NPM version.
>>
>> FlexJS 0.7 from the Flex SDK Installer does not have this issue.
>>
>> - Josh
>>
>> On Thu, Sep 22, 2016 at 3:50 PM, <jo...@apache.org> wrote:
>>
>> > npm-flexjs: fixed broken URLs for guava and jburg JARs
>> >
>> >
>> > Project: http://git-wip-us.apache.org/repos/asf/flex-utilities/repo
>> > Commit: http://git-wip-us.apache.org/repos/asf/flex-utilities/
>> > commit/3f60486c
>> > Tree: http://git-wip-us.apache.org/repos/asf/flex-utilities/tree/3
>> f60486c
>> > Diff: http://git-wip-us.apache.org/repos/asf/flex-utilities/diff/3
>> f60486c
>> >
>> > Branch: refs/heads/develop
>> > Commit: 3f60486ccf39311d1e6adee5266c44ffb6527d80
>> > Parents: 08389f3
>> > Author: Josh Tynjala <jo...@apache.org>
>> > Authored: Thu Sep 22 15:50:16 2016 -0700
>> > Committer: Josh Tynjala <jo...@apache.org>
>> > Committed: Thu Sep 22 15:50:16 2016 -0700
>> >
>> > ----------------------------------------------------------------------
>> >  npm-flexjs/dependencies/ApacheFalcon.js | 4 ++--
>> >  1 file changed, 2 insertions(+), 2 deletions(-)
>> > ----------------------------------------------------------------------
>> >
>> >
>> > http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/
>> > 3f60486c/npm-flexjs/dependencies/ApacheFalcon.js
>> > ----------------------------------------------------------------------
>> > diff --git a/npm-flexjs/dependencies/ApacheFalcon.js
>> > b/npm-flexjs/dependencies/ApacheFalcon.js
>> > index dff2fba..6a80291 100644
>> > --- a/npm-flexjs/dependencies/ApacheFalcon.js
>> > +++ b/npm-flexjs/dependencies/ApacheFalcon.js
>> > @@ -78,14 +78,14 @@ var falconDependencies = [
>> >          unzip:true
>> >      },
>> >      {
>> > -        url:'http://search.maven.org/remotecontent?filepath=/com/
>> > google/guava/guava/17.0/',
>> > +        url:'http://search.maven.org/remotecontent?filepath=com/
>> > google/guava/guava/17.0/',
>> >          remoteFileName:'guava-17.0.jar',
>> >          destinationPath:constants.FLEXJS_FOLDER +
>> > falconLibExternalFolder,
>> >          destinationFileName:'guava.jar',
>> >          unzip:false
>> >      },
>> >      {
>> > -        url:'http://search.maven.org/remotecontent?filepath=/net/
>> > sourceforge/jburg/jburg/1.10.2',
>> > +        url:'http://search.maven.org/remotecontent?filepath=net/
>> > sourceforge/jburg/jburg/1.10.2/',
>> >          remoteFileName:'jburg-1.10.2.jar',
>> >          destinationPath:constants.FLEXJS_FOLDER +
>> > falconLibExternalFolder,
>> >          destinationFileName:'jburg.jar',
>> >
>> >
>>
>
>

Re: [2/2] git commit: [flex-utilities] [refs/heads/develop] - npm-flexjs: fixed broken URLs for guava and jburg JARs

Posted by OmPrakash Muppirala <bi...@gmail.com>.
Good catch!

Thanks,
Om

On Thu, Sep 22, 2016 at 4:07 PM, Josh Tynjala <jo...@gmail.com> wrote:

> I discovered that the current version of FlexJS 0.7 on NPM cannot build
> SWFs because a couple of dependencies failed to download (guava and jburg).
> The URLs were returning 404 status, but the install script didn't detect
> the issue. Transpiling to JS works correctly with the NPM version.
>
> FlexJS 0.7 from the Flex SDK Installer does not have this issue.
>
> - Josh
>
> On Thu, Sep 22, 2016 at 3:50 PM, <jo...@apache.org> wrote:
>
> > npm-flexjs: fixed broken URLs for guava and jburg JARs
> >
> >
> > Project: http://git-wip-us.apache.org/repos/asf/flex-utilities/repo
> > Commit: http://git-wip-us.apache.org/repos/asf/flex-utilities/
> > commit/3f60486c
> > Tree: http://git-wip-us.apache.org/repos/asf/flex-utilities/tree/
> 3f60486c
> > Diff: http://git-wip-us.apache.org/repos/asf/flex-utilities/diff/
> 3f60486c
> >
> > Branch: refs/heads/develop
> > Commit: 3f60486ccf39311d1e6adee5266c44ffb6527d80
> > Parents: 08389f3
> > Author: Josh Tynjala <jo...@apache.org>
> > Authored: Thu Sep 22 15:50:16 2016 -0700
> > Committer: Josh Tynjala <jo...@apache.org>
> > Committed: Thu Sep 22 15:50:16 2016 -0700
> >
> > ----------------------------------------------------------------------
> >  npm-flexjs/dependencies/ApacheFalcon.js | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > ----------------------------------------------------------------------
> >
> >
> > http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/
> > 3f60486c/npm-flexjs/dependencies/ApacheFalcon.js
> > ----------------------------------------------------------------------
> > diff --git a/npm-flexjs/dependencies/ApacheFalcon.js
> > b/npm-flexjs/dependencies/ApacheFalcon.js
> > index dff2fba..6a80291 100644
> > --- a/npm-flexjs/dependencies/ApacheFalcon.js
> > +++ b/npm-flexjs/dependencies/ApacheFalcon.js
> > @@ -78,14 +78,14 @@ var falconDependencies = [
> >          unzip:true
> >      },
> >      {
> > -        url:'http://search.maven.org/remotecontent?filepath=/com/
> > google/guava/guava/17.0/',
> > +        url:'http://search.maven.org/remotecontent?filepath=com/
> > google/guava/guava/17.0/',
> >          remoteFileName:'guava-17.0.jar',
> >          destinationPath:constants.FLEXJS_FOLDER +
> > falconLibExternalFolder,
> >          destinationFileName:'guava.jar',
> >          unzip:false
> >      },
> >      {
> > -        url:'http://search.maven.org/remotecontent?filepath=/net/
> > sourceforge/jburg/jburg/1.10.2',
> > +        url:'http://search.maven.org/remotecontent?filepath=net/
> > sourceforge/jburg/jburg/1.10.2/',
> >          remoteFileName:'jburg-1.10.2.jar',
> >          destinationPath:constants.FLEXJS_FOLDER +
> > falconLibExternalFolder,
> >          destinationFileName:'jburg.jar',
> >
> >
>

Re: [2/2] git commit: [flex-utilities] [refs/heads/develop] - npm-flexjs: fixed broken URLs for guava and jburg JARs

Posted by Josh Tynjala <jo...@gmail.com>.
I discovered that the current version of FlexJS 0.7 on NPM cannot build
SWFs because a couple of dependencies failed to download (guava and jburg).
The URLs were returning 404 status, but the install script didn't detect
the issue. Transpiling to JS works correctly with the NPM version.

FlexJS 0.7 from the Flex SDK Installer does not have this issue.

- Josh

On Thu, Sep 22, 2016 at 3:50 PM, <jo...@apache.org> wrote:

> npm-flexjs: fixed broken URLs for guava and jburg JARs
>
>
> Project: http://git-wip-us.apache.org/repos/asf/flex-utilities/repo
> Commit: http://git-wip-us.apache.org/repos/asf/flex-utilities/
> commit/3f60486c
> Tree: http://git-wip-us.apache.org/repos/asf/flex-utilities/tree/3f60486c
> Diff: http://git-wip-us.apache.org/repos/asf/flex-utilities/diff/3f60486c
>
> Branch: refs/heads/develop
> Commit: 3f60486ccf39311d1e6adee5266c44ffb6527d80
> Parents: 08389f3
> Author: Josh Tynjala <jo...@apache.org>
> Authored: Thu Sep 22 15:50:16 2016 -0700
> Committer: Josh Tynjala <jo...@apache.org>
> Committed: Thu Sep 22 15:50:16 2016 -0700
>
> ----------------------------------------------------------------------
>  npm-flexjs/dependencies/ApacheFalcon.js | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> ----------------------------------------------------------------------
>
>
> http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/
> 3f60486c/npm-flexjs/dependencies/ApacheFalcon.js
> ----------------------------------------------------------------------
> diff --git a/npm-flexjs/dependencies/ApacheFalcon.js
> b/npm-flexjs/dependencies/ApacheFalcon.js
> index dff2fba..6a80291 100644
> --- a/npm-flexjs/dependencies/ApacheFalcon.js
> +++ b/npm-flexjs/dependencies/ApacheFalcon.js
> @@ -78,14 +78,14 @@ var falconDependencies = [
>          unzip:true
>      },
>      {
> -        url:'http://search.maven.org/remotecontent?filepath=/com/
> google/guava/guava/17.0/',
> +        url:'http://search.maven.org/remotecontent?filepath=com/
> google/guava/guava/17.0/',
>          remoteFileName:'guava-17.0.jar',
>          destinationPath:constants.FLEXJS_FOLDER +
> falconLibExternalFolder,
>          destinationFileName:'guava.jar',
>          unzip:false
>      },
>      {
> -        url:'http://search.maven.org/remotecontent?filepath=/net/
> sourceforge/jburg/jburg/1.10.2',
> +        url:'http://search.maven.org/remotecontent?filepath=net/
> sourceforge/jburg/jburg/1.10.2/',
>          remoteFileName:'jburg-1.10.2.jar',
>          destinationPath:constants.FLEXJS_FOLDER +
> falconLibExternalFolder,
>          destinationFileName:'jburg.jar',
>
>

[2/2] git commit: [flex-utilities] [refs/heads/develop] - npm-flexjs: fixed broken URLs for guava and jburg JARs

Posted by jo...@apache.org.
npm-flexjs: fixed broken URLs for guava and jburg JARs


Project: http://git-wip-us.apache.org/repos/asf/flex-utilities/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-utilities/commit/3f60486c
Tree: http://git-wip-us.apache.org/repos/asf/flex-utilities/tree/3f60486c
Diff: http://git-wip-us.apache.org/repos/asf/flex-utilities/diff/3f60486c

Branch: refs/heads/develop
Commit: 3f60486ccf39311d1e6adee5266c44ffb6527d80
Parents: 08389f3
Author: Josh Tynjala <jo...@apache.org>
Authored: Thu Sep 22 15:50:16 2016 -0700
Committer: Josh Tynjala <jo...@apache.org>
Committed: Thu Sep 22 15:50:16 2016 -0700

----------------------------------------------------------------------
 npm-flexjs/dependencies/ApacheFalcon.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/3f60486c/npm-flexjs/dependencies/ApacheFalcon.js
----------------------------------------------------------------------
diff --git a/npm-flexjs/dependencies/ApacheFalcon.js b/npm-flexjs/dependencies/ApacheFalcon.js
index dff2fba..6a80291 100644
--- a/npm-flexjs/dependencies/ApacheFalcon.js
+++ b/npm-flexjs/dependencies/ApacheFalcon.js
@@ -78,14 +78,14 @@ var falconDependencies = [
         unzip:true
     },
     {
-        url:'http://search.maven.org/remotecontent?filepath=/com/google/guava/guava/17.0/',
+        url:'http://search.maven.org/remotecontent?filepath=com/google/guava/guava/17.0/',
         remoteFileName:'guava-17.0.jar',
         destinationPath:constants.FLEXJS_FOLDER + falconLibExternalFolder,
         destinationFileName:'guava.jar',
         unzip:false
     },
     {
-        url:'http://search.maven.org/remotecontent?filepath=/net/sourceforge/jburg/jburg/1.10.2',
+        url:'http://search.maven.org/remotecontent?filepath=net/sourceforge/jburg/jburg/1.10.2/',
         remoteFileName:'jburg-1.10.2.jar',
         destinationPath:constants.FLEXJS_FOLDER + falconLibExternalFolder,
         destinationFileName:'jburg.jar',