2021-03-26 07:52:01 +01:00
|
|
|
# Copyright (c) 2018-2021 Status Research & Development GmbH
|
|
|
|
# Licensed and distributed under either of
|
|
|
|
# * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT).
|
|
|
|
# * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0).
|
|
|
|
# at your option. This file may not be copied, modified, or distributed except according to those terms.
|
|
|
|
|
2020-04-22 07:53:02 +02:00
|
|
|
{.push raises: [Defect].}
|
|
|
|
|
2020-06-30 14:23:52 +02:00
|
|
|
import strutils
|
|
|
|
|
2020-04-16 00:20:27 +02:00
|
|
|
when not defined(nimscript):
|
|
|
|
import times
|
|
|
|
let copyrights* = "Copyright (c) 2019-" & $(now().utc.year) & " Status Research & Development GmbH"
|
2019-11-11 14:43:12 +00:00
|
|
|
|
2020-04-16 00:20:27 +02:00
|
|
|
const
|
2020-11-25 03:13:35 +02:00
|
|
|
versionMajor* = 1
|
2021-10-04 21:56:35 +03:00
|
|
|
versionMinor* = 5
|
2021-12-03 20:04:38 +02:00
|
|
|
versionBuild* = 5
|
2020-11-20 22:31:03 +02:00
|
|
|
|
2020-11-29 23:36:00 +02:00
|
|
|
versionBlob* = "stateofus" # Single word - ends up in the default graffitti
|
2019-03-06 00:54:08 +02:00
|
|
|
|
2021-03-10 23:05:14 +02:00
|
|
|
gitRevision* = strip(staticExec("git rev-parse --short HEAD"))[0..5]
|
2019-11-08 11:33:16 +01:00
|
|
|
|
2021-07-09 07:41:44 +02:00
|
|
|
nimBanner* = staticExec("nim --version | grep Version")
|
2020-04-16 00:20:27 +02:00
|
|
|
|
2019-11-12 00:05:35 +00:00
|
|
|
versionAsStr* =
|
|
|
|
$versionMajor & "." & $versionMinor & "." & $versionBuild
|
2019-03-06 00:54:08 +02:00
|
|
|
|
2020-11-25 03:13:35 +02:00
|
|
|
fullVersionStr* = "v" & versionAsStr & "-" & gitRevision & "-" & versionBlob
|
2020-06-30 14:23:52 +02:00
|
|
|
|
|
|
|
func shortNimBanner*(): string =
|
|
|
|
const gitPrefix = "git hash: "
|
|
|
|
let tmp = splitLines(nimBanner)
|
|
|
|
if tmp.len == 0:
|
|
|
|
return
|
|
|
|
var gitHash = ""
|
|
|
|
for line in tmp:
|
|
|
|
if line.startsWith(gitPrefix) and line.len > 8 + gitPrefix.len:
|
|
|
|
gitHash = line[gitPrefix.len..<gitPrefix.len + 8]
|
|
|
|
|
|
|
|
if gitHash.len > 0:
|
|
|
|
tmp[0] & " (" & gitHash & ")"
|
|
|
|
else:
|
|
|
|
tmp[0]
|