cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nikhilkh <...@git.apache.org>
Subject [GitHub] cordova-coho pull request: CB-11279 Support arbitrary repositories...
Date Wed, 18 May 2016 19:22:56 GMT
Github user nikhilkh commented on a diff in the pull request:

    https://github.com/apache/cordova-coho/pull/122#discussion_r63765329
  
    --- Diff: src/nightly.js ---
    @@ -60,36 +62,26 @@ module.exports = function*(argv) {
         }
     
         // Clone and update Repos
    -    yield repoclone.cloneRepos(repos, /*silent=*/true);
    -    yield repoupdate.updateRepos(repos);
    +    yield prepareRepos(argv.r);
     
    -    //remove local changes and sync up with remote master
    -    yield repoutil.forEachRepo(repos, function*() {
    -        yield gitutil.gitClean();
    -        yield gitutil.resetFromOrigin();
    -    });
    +    var reposToBuild = flagutil.computeReposFromFlag(argv.r, { includeModules: true });
    +    // Get updated nightly versions for all repos
    +    /** @type {Object} A map of repo.id and a short SHA for every repo to build */
    +    var VERSIONS = yield retrieveVersions(reposToBuild);
     
    -    // Get SHAS from repos
    -    var SHAJSON = yield retrieveSha(repos);
    +    // Update version in package.json and other respective files for every repo
    +    // and update dependencies to use nightly versions of packages to be released
    +    yield repoutil.forEachRepo(reposToBuild, function*(repo) {
    +        apputil.print('Updating ' + repo.id + ' version to ' + VERSIONS[repo.id]);
    +        yield versionutil.updateRepoVersion(repo, VERSIONS[repo.id], { commitChanges:
false });
     
    -    var currentDate = new Date();
    -    var nightlyVersion = '-nightly.' + currentDate.getFullYear() + '.' +
    -        (currentDate.getMonth() + 1) + '.' + currentDate.getDate();
    -    var cordovaLibVersion;
    -    //update package.json version for cli + lib, update lib reference for cli
    -    yield repoutil.forEachRepo([cordovaLib, cli], function*(repo) {
    -        var dir = process.cwd();
    -        var packageJSON = require(dir+'/package.json');
    -        packageJSON.version = versionutil.removeDev(packageJSON.version) + nightlyVersion
+
    -            '+' + SHAJSON[repo.id];
    -
    -        if(repo.id === 'lib'){
    -            cordovaLibVersion = packageJSON.version;
    -        } else {
    -            packageJSON.dependencies['cordova-lib'] = cordovaLibVersion;
    -        }
    +        var packageJSONPath = path.join(process.cwd(), 'package.json');
    --- End diff --
    
    Looks like updateRepoVersion already updates package.json - you can probably remove the
code here.


---
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


Mime
View raw message