Better version number support.
This commit is contained in:
parent
feb097b30f
commit
e498d461df
|
@ -28,3 +28,6 @@ dscanner-report.json
|
||||||
|
|
||||||
#debug build
|
#debug build
|
||||||
dsc
|
dsc
|
||||||
|
|
||||||
|
# Git hash
|
||||||
|
githash.txt
|
||||||
|
|
15
makefile
15
makefile
|
@ -16,21 +16,24 @@ all: dmdbuild
|
||||||
ldc: ldcbuild
|
ldc: ldcbuild
|
||||||
gdc: gdcbuild
|
gdc: gdcbuild
|
||||||
|
|
||||||
|
githash:
|
||||||
|
git log -1 --format="%H" > githash.txt
|
||||||
|
|
||||||
debug:
|
debug:
|
||||||
${DMD} -w -g -ofdsc ${VERSIONS} ${DEBUG_VERSIONS} ${INCLUDE_PATHS} ${SRC}
|
${DMD} -w -g -ofdsc ${VERSIONS} ${DEBUG_VERSIONS} ${INCLUDE_PATHS} ${SRC}
|
||||||
|
|
||||||
dmdbuild:
|
dmdbuild: githash
|
||||||
mkdir -p bin
|
mkdir -p bin
|
||||||
${DMD} -w -O -release -inline -ofbin/dscanner ${VERSIONS} ${INCLUDE_PATHS} ${SRC}
|
${DMD} -w -O -release -inline -ofbin/dscanner ${VERSIONS} ${INCLUDE_PATHS} ${SRC} -J.
|
||||||
rm -f bin/dscanner.o
|
rm -f bin/dscanner.o
|
||||||
|
|
||||||
gdcbuild:
|
gdcbuild: githash
|
||||||
mkdir -p bin
|
mkdir -p bin
|
||||||
${GDC} -O3 -frelease -obin/dscanner ${VERSIONS} ${INCLUDE_PATHS} ${SRC}
|
${GDC} -O3 -frelease -obin/dscanner ${VERSIONS} ${INCLUDE_PATHS} ${SRC} -J.
|
||||||
|
|
||||||
ldcbuild:
|
ldcbuild: githash
|
||||||
mkdir -p bin
|
mkdir -p bin
|
||||||
${LDC} -O5 -release -oq -of=bin/dscanner ${VERSIONS} ${INCLUDE_PATHS} ${SRC}
|
${LDC} -O5 -release -oq -of=bin/dscanner ${VERSIONS} ${INCLUDE_PATHS} ${SRC} -J.
|
||||||
|
|
||||||
test:
|
test:
|
||||||
@./test.sh
|
@./test.sh
|
||||||
|
|
|
@ -0,0 +1,20 @@
|
||||||
|
// Copyright Brian Schott (Hackerpilot) 2015.
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||||
|
// http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
|
||||||
|
module dscanner_version;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Human-readable version number
|
||||||
|
*/
|
||||||
|
enum DSCANNER_VERSION = "v0.2.0-dev";
|
||||||
|
|
||||||
|
version (Windows) {}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Current build's Git commit hash
|
||||||
|
*/
|
||||||
|
enum GIT_HASH = import("githash.txt");
|
||||||
|
}
|
|
@ -26,6 +26,7 @@ import outliner;
|
||||||
import symbol_finder;
|
import symbol_finder;
|
||||||
import analysis.run;
|
import analysis.run;
|
||||||
import analysis.config;
|
import analysis.config;
|
||||||
|
import dscanner_version;
|
||||||
|
|
||||||
import inifiled;
|
import inifiled;
|
||||||
|
|
||||||
|
@ -101,7 +102,10 @@ int run(string[] args)
|
||||||
|
|
||||||
if (printVersion)
|
if (printVersion)
|
||||||
{
|
{
|
||||||
writeln("v0.1.0");
|
version (Windows)
|
||||||
|
writeln(DSCANNER_VERSION);
|
||||||
|
else
|
||||||
|
write(DSCANNER_VERSION, " ", GIT_HASH);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue