Repository: cordova-coho Updated Branches: refs/heads/master 7d46eefae -> e9f37cbe9
CB-7930 added functions for automating tools release Project: http://git-wip-us.apache.org/repos/asf/cordova-coho/repo Commit: http://git-wip-us.apache.org/repos/asf/cordova-coho/commit/e9f37cbe Tree: http://git-wip-us.apache.org/repos/asf/cordova-coho/tree/e9f37cbe Diff: http://git-wip-us.apache.org/repos/asf/cordova-coho/diff/e9f37cbe Branch: refs/heads/master Commit: e9f37cbe9b9e9617e62452873c987d67bab9eca5 Parents: 7d46eef Author: Steve Gill <[email protected]> Authored: Wed Nov 12 23:20:24 2014 -0800 Committer: Steve Gill <[email protected]> Committed: Fri Nov 14 11:22:57 2014 -0800 ---------------------------------------------------------------------- src/main.js | 6 +++++- src/versionutil.js | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-coho/blob/e9f37cbe/src/main.js ---------------------------------------------------------------------- diff --git a/src/main.js b/src/main.js index 6b4c037..2be5540 100644 --- a/src/main.js +++ b/src/main.js @@ -130,7 +130,11 @@ module.exports = function() { desc: 'Builds and publishes nightly builds of cordova-cli using the latest commits for each platform.', entryPoint: lazyRequire('./nightly') }, { - name:'npm-publish-tag', + name: 'prepare-tools-release', + desc: 'Prepares tools for release', + entryPoint: lazyRequire('./tools-release', 'prepareToolsRelease') + }, { + name: 'npm-publish-tag', desc: 'Publishes current version of repo to specified tag', entryPoint: lazyRequire('./npm-publish', 'publishTag') } http://git-wip-us.apache.org/repos/asf/cordova-coho/blob/e9f37cbe/src/versionutil.js ---------------------------------------------------------------------- diff --git a/src/versionutil.js b/src/versionutil.js index 810a458..5aed97c 100644 --- a/src/versionutil.js +++ b/src/versionutil.js @@ -16,9 +16,44 @@ KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ +var repoutil = require('./repoutil'); +var flagutil = require('./flagutil'); +var path = require('path'); function removeDev(version) { var newVersion = version.replace('-dev', ''); return newVersion; } exports.removeDev = removeDev; + +//updates platformsConfig.json +//Needs to be passed a object which includes repo.id as key +//and the new version as value +//ex {android:4.0.0} +function *updatePlatformsConfig(newValues) { + + var platformsConfig = path.join(repoutil.getRepoDir('cordova-lib'), + 'src/cordova/platformsConfig.json'); + console.log(platformsConfig); + var platformsJS = require(platformsConfig); + + var repos = flagutil.computeReposFromFlag('active-platform'); + + yield repoutil.forEachRepo(repos, function*(repo) { + if(repo.id === 'windowsphone'){ + platformsJS['wp8'].version = newValues[repo.id]; + } else if(repo.id === 'windows') { + platformsJS[repo.id].version = newValues[repo.id]; + platformsJS['windows8'].version = newValues[repo.id]; + } else if(repo.id === 'blackberry') { + platformsJS['blackberry10'].version = newValues[repo.id]; + } else { + platformsJS[repo.id].version = newValues[repo.id]; + } + }); + + fs.writeFileSync(platformsConfig, JSON.stringify(platformsJS, null, 4), 'utf8', function(err) { + if (err) return console.log (err); + }); +} +exports.updatePlatformsConfig = updatePlatformsConfig; --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
