cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fil...@apache.org
Subject cordova-coho git commit: CB-12539: better release note linting for plugins releaser. also add version labels to repoutil platform repo group.
Date Mon, 06 Mar 2017 19:26:12 GMT
Repository: cordova-coho
Updated Branches:
  refs/heads/plugins-releaser 6c982b3f5 -> 4132a24e4


CB-12539: better release note linting for plugins releaser. also add version labels to repoutil
platform repo group.


Project: http://git-wip-us.apache.org/repos/asf/cordova-coho/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-coho/commit/4132a24e
Tree: http://git-wip-us.apache.org/repos/asf/cordova-coho/tree/4132a24e
Diff: http://git-wip-us.apache.org/repos/asf/cordova-coho/diff/4132a24e

Branch: refs/heads/plugins-releaser
Commit: 4132a24e408dbc316d47cd1f6dacdd841dacd31b
Parents: 6c982b3
Author: filmaj <maj.fil@gmail.com>
Authored: Mon Mar 6 11:26:03 2017 -0800
Committer: filmaj <maj.fil@gmail.com>
Committed: Mon Mar 6 11:26:03 2017 -0800

----------------------------------------------------------------------
 src/plugin-release.js       |  8 ++++----
 src/repoutil.js             |  2 ++
 src/update-release-notes.js | 34 ++++++++++++++++++++++++++++++++++
 3 files changed, 40 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-coho/blob/4132a24e/src/plugin-release.js
----------------------------------------------------------------------
diff --git a/src/plugin-release.js b/src/plugin-release.js
index 9cad988..4d31331 100644
--- a/src/plugin-release.js
+++ b/src/plugin-release.js
@@ -25,7 +25,7 @@ var optimist = require('optimist');
 var shelljs = require('shelljs');
 var apputil = require('./apputil');
 var audit_license = require('./audit-license-headers');
-var tweak_release_notes = require('./update-release-notes');
+var update_release_notes = require('./update-release-notes');
 var create_archive = require('./create-verify-archive');
 var executil = require('./executil');
 var flagutil = require('./flagutil');
@@ -279,7 +279,7 @@ function *interactive_plugins_release() {
                 type: 'input',
                 name: 'cwd',
                 default: apputil.getBaseDir(),
-                message: function(answers) { 
+                message: function(answers) {
                     if (answers.use_existing_plugins) {
                         return 'We need to update the plugin and apache SVN repositories.
Enter the directory containing all of your Apache Cordova source code repositories (absolute
or relative paths work here)';
                     } else {
@@ -416,7 +416,7 @@ function *interactive_plugins_release() {
                 yield plugs.map(function*(plugin) {
                     var data = plugin_data[plugin];
                     var changes = data.changes;
-                    var final_notes = yield tweak_release_notes.createNotes(plugin, data.current_release,
changes);
+                    var final_notes = yield update_release_notes.createNotes(plugin, data.current_release,
changes);
                     release_note_prompts.push({
                         type: 'editor',
                         name: plugin,
@@ -464,7 +464,7 @@ function *interactive_plugins_release() {
                         var new_rn = rn.replace(new RegExp('### ' + previous_assumed_version,
'g'), '### ' + plugin_data[plugin_name].current_release);
                         release_notes[plugin_name] = new_rn;
                     }
-                    fs.writeFileSync(tweak_release_notes.FILE, release_notes[plugin_name],
{encoding: 'utf8'});
+                    fs.writeFileSync(update_release_notes.FILE, release_notes[plugin_name],
{encoding: 'utf8'});
                     /* - commit changes to versions and release notes together with description
'$JIRA Updated version and release notes for release $v'
                      * - tag each plugin repo with $v*/
                     if (yield gitutil.pendingChangesExist()) {

http://git-wip-us.apache.org/repos/asf/cordova-coho/blob/4132a24e/src/repoutil.js
----------------------------------------------------------------------
diff --git a/src/repoutil.js b/src/repoutil.js
index 83e72a2..85c4938 100644
--- a/src/repoutil.js
+++ b/src/repoutil.js
@@ -25,12 +25,14 @@ var apputil = require('./apputil');
 var platformRepos = [
     {
         title: 'Android',
+        versions: ['4.4', '5.0', '5.1', '6.0', '7.0', '7.1'],
         id: 'android',
         repoName: 'cordova-android',
         jiraComponentName: 'Android',
         cordovaJsPaths: ['bin/templates/project/assets/www/cordova.js']
     }, {
         title: 'iOS',
+        versions: ['9.0', '9.1', '9.2', '9.3', '10.0', '10.1', '10.2', '10.3'],
         id: 'ios',
         repoName: 'cordova-ios',
         jiraComponentName: 'iOS',

http://git-wip-us.apache.org/repos/asf/cordova-coho/blob/4132a24e/src/update-release-notes.js
----------------------------------------------------------------------
diff --git a/src/update-release-notes.js b/src/update-release-notes.js
index 9e613ea..2a96f5d 100644
--- a/src/update-release-notes.js
+++ b/src/update-release-notes.js
@@ -103,6 +103,14 @@ module.exports = function*() {
     });
 };
 
+function backtick(text, token) {
+    return text.replace(new RegExp(" " + token, "gi"), " `" + token + "`");
+}
+
+function bold(text, token) {
+    return text.replace(new RegExp(" " + token, "gi"), " **" + token + "**");
+}
+
 function *createNotes(repo, newVersion, changes, overrideDate) {
     // pump changes through JIRA linkifier first through a stream pipe
 	var transformer = linkify.stream("CB");
@@ -118,6 +126,32 @@ function *createNotes(repo, newVersion, changes, overrideDate) {
 	}
 	read.pipe(transformer).pipe(write);
     yield co_stream.wait(write); // wait for the writable stream to finish/end
+    // some more release note linting: enclose in backticks certain tokens
+    data = backtick(data, 'plugin.xml');
+    flagutil.computeReposFromFlag('platforms').map(function(r) { return r.repoName; }).forEach(function(platform_name)
{
+        data = backtick(data, platform_name);
+    });
+    var special_plugin_names = ['InAppBrowser'];
+    special_plugin_names.forEach(function(name) {
+        data = backtick(data, name);
+    });
+    // bold platform labels (with optional version numbers, too)
+    var version_labels = [];
+    repoutil.repoGroups.platforms.filter(function(p) {
+        // first only pull out the platform repos that we have explicitly labeled with nice
version strings
+        return p.versions && p.versions.length;
+    }).forEach(function(p) {
+        // next, generate the labels for later tokenization
+        p.versions.forEach(function(v) {
+            version_labels.push(p.title + ' ' + v);
+        });
+    });
+    version_labels.forEach(function(label) {
+        data = bold(data, label);
+    });
+    repoutil.repoGroups.platforms.map(function(r) { return r.title; }).forEach(function(platform)
{
+        data = bold(data, platform);
+    });
     // then interpolate linkified changes into existing release notes and compose the final
release notes string
     var relNotesData = fs.readFileSync(path.join(process.cwd(), repo, relNotesFile), {encoding:
'utf8'});
     var headerPos = relNotesData.indexOf('### ');


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


Mime
View raw message