Fix output of non-semantic version string

This commit is contained in:
Tobi Schäfer 2024-01-07 00:10:19 +01:00
parent 7bf5dafec5
commit 6a8f1f2813
4 changed files with 10 additions and 10 deletions

View file

@ -25,7 +25,7 @@ allprojects {
project.ext.distVersion = { ->
def json = new groovy.json.JsonSlurper()
def packageData = json.parse(file("${rootProject.projectDir}/package.json"))
return packageData.version.substring(0, packageData.version.size() - 2)
return packageData.version;
}
project.ext.antvilleBuildDir = "${rootProject.buildDir}/tmp/antville"

View file

@ -115,7 +115,7 @@
<dd></dd>
<dd><% gettext '{0} log entries' <% param.entries %> %></dd>
<dt><% gettext Version %></dt>
<dd><% version %></dd>
<dd>φ (<% version %>)</dd>
<dt><% gettext Build %></dt>
<dd>
<% link <% version hash prefix='https://github.com/antville/antville/commit/' %> <% version hash %> %> (<% version date %>)

View file

@ -24,19 +24,19 @@ Root.VERSION = (function(versionString, buildDate) {
// A valid version string is e.g. '1.2.3alpha.c0ffee'.
// Repositories could add something like '-compatible' to it,
// FIXME: This should be refactored for modular extension.
var re = /^(\d+)\.(\d+)(?:\.(\d+))?(.+)?\.([a-f0-9]+)(?:-(.*))?$/;
var re = /^(\d+)\.(\d+)(?:\.(\d+))?\.([a-f0-9]+)(?:-(.*))?$/;
var parts = re.exec(versionString);
if (parts) {
var result = {
date: new Date(buildDate).toLocaleDateString(),
hash: parts[4],
major: parts[1],
parts: parts,
toString: function() {return parts[0]},
major: parseInt(parts[1]),
hash: parts[5],
date: new Date(buildDate).toLocaleDateString()
toString: function() { return parts[1] }
};
result.minor = result.major + parseInt(parts[2] || 0) / 10;
result.minor = result.major + '.' + (parts[2] || 0);
result.bugfix = result.minor + '.' + (parts[3] || 0);
result.development = parts[4] || '';
result.development = parts[5] || '';
result['default'] = result[parts[3] ? 'bugfix' : 'minor'] + result.development +
(parts[6] ? '-' + parts[6] : String.EMPTY);
return result;

View file

@ -1,6 +1,6 @@
{
"name": "antville",
"version": "1.618.0",
"version": "1.618",
"description": "Antville is an open source project aimed at the development of a high performance, feature rich weblog hosting software. It can easily host up to several thousands of sites (the number of weblogs is rather limited by the installation owners choice and server power than by software limitations).",
"main": "main.js",
"directories": {