docs: function downloadPlatform(projectRoot, platform, version, opts) {
      var target = version ? (platform + '@' + version) : platform;
      return Q().then(function() {
          if (opts.fetch) {
              //append cordova to platform
              if(platform in platforms) {
                  target = 'judpack-'+target;
              }
  
              //gitURLs don't supply a platform, it equals null
              if(!platform) {
                  target = version;
              }
  
              events.emit('log', 'Using cordova-fetch for '+ target);
              return fetch(target, projectRoot, opts);
          }
  
          if (cordova_util.isUrl(version)) {
              events.emit('log', 'git cloning: ' + version);
              var parts = version.split('#');
              var git_url = parts[0];
              var branchToCheckout = parts[1];
              return lazy_load.git_clone(git_url, branchToCheckout).fail(function(err) {
                  // If it looks like a url, but cannot be cloned, try handling it differently.
                  // it's because it's a tarball of the form:
                  //     - wp8@https://git-wip-us.apache.org/repos/asf?p=cordova-wp8.git;a=snapshot;h=3.7.0;sf=tgz
                  //     - https://api.github.com/repos/msopenTech/cordova-browser/tarball/my-branch
                  events.emit('verbose', err.message);
                  events.emit('verbose', 'Cloning failed. Let\'s try handling it as a tarball');
                  return lazy_load.based_on_config(projectRoot, target, opts);
              });
          }
          return lazy_load.based_on_config(projectRoot, target, opts);
      }).fail(function (error) {
          var message = 'Failed to fetch platform ' + target +
              '\nProbably this is either a connection problem, or platform spec is incorrect.' +
              '\nCheck your connection and platform name/version/URL.' +
              '\n' + error;
          return Q.reject(new CordovaError(message));
      }).then(function(libDir) {
          return getPlatformDetailsFromDir(libDir, platform);
      });
  }