Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 9F393200BAB for ; Sat, 8 Oct 2016 05:32:24 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 9DC24160AE9; Sat, 8 Oct 2016 03:32:24 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id DD0B9160AE8 for ; Sat, 8 Oct 2016 05:32:23 +0200 (CEST) Received: (qmail 60014 invoked by uid 500); 8 Oct 2016 03:32:22 -0000 Mailing-List: contact dev-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cordova.apache.org Delivered-To: mailing list dev@cordova.apache.org Received: (qmail 60003 invoked by uid 99); 8 Oct 2016 03:32:22 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 08 Oct 2016 03:32:22 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 270D7DFE65; Sat, 8 Oct 2016 03:32:22 +0000 (UTC) From: TimBarham To: dev@cordova.apache.org Reply-To: dev@cordova.apache.org Message-ID: Subject: [GitHub] cordova-lib pull request #498: CB-11985 Check if cached platform/plugin exis... Content-Type: text/plain Date: Sat, 8 Oct 2016 03:32:22 +0000 (UTC) archived-at: Sat, 08 Oct 2016 03:32:24 -0000 GitHub user TimBarham opened a pull request: https://github.com/apache/cordova-lib/pull/498 CB-11985 Check if cached platform/plugin exists before 'npm cache' ### What does this PR do? Before calling `npm cache add` when installing a platform or plugin, look for an existing `package.tgz` file in the cache directory. This avoids unnecessary `npm` call with long timeout if not connected to the internet. Background: First time build failures in Cordova tools in Visual Studio are primarily due to `npm` failures. Therefore we are working to avoid any requirement for `npm` to hit the internet in simple build scenarios. This includes pre-installing cached versions of certain platforms and plugins. But we only get the full benefit if Cordova uses these cached versions if it finds them, without calling npm cache add. A couple of things to note: * This change uses shared code for platforms and plugins, and means plugins will also be cached to the `.cordova` directory rather than the global npm cache directory. Is that a concern? * It is likely this change will be meaningless with the proposed changes to installing platforms and plugins in Cordova 7.x. We'll cross the bridge when we come to it 😄. ### What testing has been done on this change? Local testing. ### Checklist - [x] [Reported an issue](http://cordova.apache.org/contribute/issues.html) in the JIRA database - [x] Commit message follows the format: "CB-3232: (android) Fix bug with resolving file paths", where CB-xxxx is the JIRA ID & "android" is the platform affected. You can merge this pull request into a Git repository by running: $ git pull https://github.com/TimBarham/cordova-lib use-cached-platform Alternatively you can review and apply these changes as the patch at: https://github.com/apache/cordova-lib/pull/498.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #498 ---- commit 667e774d46399cf97a9481c3890fa7a862871d46 Author: TimBarham Date: 2016-10-07T22:58:35Z CB-11985 Check if cached platform/plugin exists before 'npm cache' This avoids unnecessary npm call with long timeout if not connected to the internet. ---- --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastructure@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org For additional commands, e-mail: dev-help@cordova.apache.org