From ac4d673370cef7b709e3ed2eac08eb4443c01e2c Mon Sep 17 00:00:00 2001 From: dreaming-augustin Date: Sun, 22 Dec 2024 13:58:02 +0800 Subject: [PATCH] [#1] Include the version in the released file --- tasks/config/project/release.js | 20 +++++++++++++++++++- tasks/config/tasks.js | 12 ++++++------ 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/tasks/config/project/release.js b/tasks/config/project/release.js index 8981ffd229..46579a69a5 100644 --- a/tasks/config/project/release.js +++ b/tasks/config/project/release.js @@ -7,7 +7,9 @@ const requireDotFile = require('require-dot-file'); let config, npmPackage, - version + version, + revision, + versionInFileName ; /******************************* @@ -31,6 +33,21 @@ version = npmPackage && npmPackage.version !== undefined && npmPackage.name === ? npmPackage.version : config.version; +// looks for revision in config. +revision = config.revision === undefined ? '' : config.revision; + +includeVersionInFileName = config.includeVersionInFileName === undefined ? false : config.includeVersionInFileName; + +versionInFileName = ''; + +if (includeVersionInFileName) { + versionInFileName = '-' + version; + if (revision != '') { + versionInFileName += '-' + revision; + } +} + + /******************************* Export *******************************/ @@ -54,5 +71,6 @@ module.exports = { + ' */\n', version: version, + versionInFileName: versionInFileName, }; diff --git a/tasks/config/tasks.js b/tasks/config/tasks.js index 561b7d197e..886f8d5cd2 100644 --- a/tasks/config/tasks.js +++ b/tasks/config/tasks.js @@ -40,12 +40,12 @@ module.exports = { }, filenames: { - concatenatedCSS: 'semantic.css', - concatenatedJS: 'semantic.js', - concatenatedMinifiedCSS: 'semantic.min.css', - concatenatedMinifiedJS: 'semantic.min.js', - concatenatedRTLCSS: 'semantic.rtl.css', - concatenatedMinifiedRTLCSS: 'semantic.rtl.min.css', + concatenatedCSS: 'semantic' + release.versionInFileName + '.css', + concatenatedJS: 'semantic' + release.versionInFileName + '.js', + concatenatedMinifiedCSS: 'semantic' + release.versionInFileName + '.min.css', + concatenatedMinifiedJS: 'semantic' + release.versionInFileName + '.min.js', + concatenatedRTLCSS: 'semantic.rtl' + release.versionInFileName + '.css', + concatenatedMinifiedRTLCSS: 'semantic.rtl' + release.versionInFileName + '.min.css', }, regExp: {