Refactor version info generation
This commit is contained in:
parent
5bb99c2a8c
commit
2aaa367c10
|
@ -5,6 +5,6 @@ __dummy.html
|
|||
*.obj
|
||||
__test__*__
|
||||
out/
|
||||
source/ircd/packageVersion.d
|
||||
source/ircd/versionInfo.d
|
||||
motd
|
||||
config.sdl
|
||||
|
|
2
dub.sdl
2
dub.sdl
|
@ -7,7 +7,7 @@ targetType "executable"
|
|||
dependency "vibe-core" version="~>1.8.1"
|
||||
dependency "vibe-d:stream" version="~>0.9.0-alpha.1"
|
||||
dependency "sdlang-d" version="~>0.10.5"
|
||||
preGenerateCommands "./generate-package-version.fish"
|
||||
preBuildCommands "./generate-version-info.fish"
|
||||
versions "VibeDefaultMain"
|
||||
targetPath "out"
|
||||
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
#!/usr/bin/fish
|
||||
|
||||
set packageVersion (git describe)
|
||||
|
||||
echo "module ircd.packageVersion; enum packageVersion = \"$packageVersion\";" > source/ircd/packageVersion.d
|
|
@ -0,0 +1,6 @@
|
|||
#!/usr/bin/fish
|
||||
|
||||
set gitVersion (git describe)
|
||||
set buildDate (date --iso-8601=seconds)
|
||||
|
||||
echo -e "/* This file is generated on build! */\n\nmodule ircd.versionInfo;\n\nenum gitVersion = \"$gitVersion\";\nenum buildDate = \"$buildDate\";" > source/ircd/versionInfo.d
|
|
@ -12,7 +12,7 @@ import std.string;
|
|||
import vibe.core.core;
|
||||
import vibe.core.net;
|
||||
|
||||
import ircd.packageVersion;
|
||||
import ircd.versionInfo;
|
||||
|
||||
import ircd.message;
|
||||
import ircd.connection;
|
||||
|
@ -24,7 +24,7 @@ class Server
|
|||
{
|
||||
Connection[] connections;
|
||||
|
||||
enum versionString = "salty-ircd-" ~ packageVersion;
|
||||
enum versionString = "salty-ircd-" ~ gitVersion;
|
||||
|
||||
string name;
|
||||
enum string info = "A salty-ircd server"; //TODO: Make server info configurable
|
||||
|
|
Loading…
Reference in New Issue