Use git --describe tags as version string
This commit is contained in:
parent
b03adf1dff
commit
d96b48f765
2
makefile
2
makefile
|
@ -36,7 +36,7 @@ ldc: ldcbuild
|
||||||
gdc: gdcbuild
|
gdc: gdcbuild
|
||||||
|
|
||||||
githash:
|
githash:
|
||||||
git log -1 --format="%H" > githash.txt
|
git describe --tags > githash.txt
|
||||||
|
|
||||||
debug:
|
debug:
|
||||||
${DC} -w -g -J. -ofdsc ${VERSIONS} ${DEBUG_VERSIONS} ${INCLUDE_PATHS} ${SRC}
|
${DC} -w -g -J. -ofdsc ${VERSIONS} ${DEBUG_VERSIONS} ${INCLUDE_PATHS} ${SRC}
|
||||||
|
|
|
@ -8,19 +8,20 @@ module dscanner.dscanner_version;
|
||||||
/**
|
/**
|
||||||
* Human-readable version number
|
* Human-readable version number
|
||||||
*/
|
*/
|
||||||
enum DSCANNER_VERSION = "v0.4.0";
|
enum DEFAUULT_DSCANNER_VERSION = "v0.5.0";
|
||||||
|
|
||||||
version (built_with_dub)
|
version (built_with_dub)
|
||||||
{
|
{
|
||||||
enum GIT_HASH = import("dubhash.txt");
|
enum DSCANNER_VERSION = import("dubhash.txt");
|
||||||
}
|
}
|
||||||
else version (Windows)
|
else version (Windows)
|
||||||
{
|
{
|
||||||
|
enum DSCANNER_VERSION = DEFAUULT_DSCANNER_VERSION;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Current build's Git commit hash
|
* Current build's Git commit hash
|
||||||
*/
|
*/
|
||||||
enum GIT_HASH = import("githash.txt");
|
enum DSCANNER_VERSION = import("githash.txt");
|
||||||
}
|
}
|
||||||
|
|
|
@ -139,12 +139,7 @@ else
|
||||||
|
|
||||||
if (printVersion)
|
if (printVersion)
|
||||||
{
|
{
|
||||||
version (Windows)
|
write(DSCANNER_VERSION);
|
||||||
writeln(DSCANNER_VERSION);
|
|
||||||
else version (built_with_dub)
|
|
||||||
writeln(DSCANNER_VERSION);
|
|
||||||
else
|
|
||||||
write(DSCANNER_VERSION, " ", GIT_HASH);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue