Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
belenios
belenios
Commits
c779983f
Commit
c779983f
authored
Mar 21, 2017
by
Stephane Glondu
Browse files
Add "debug" variable to Belenios_version, move it to platform
parent
0795a6f8
Changes
5
Hide whitespace changes
Inline
Side-by-side
.dir-locals.el
View file @
c779983f
((
nil
.
((
eval
.
(
setq
compile-command
(
format
"cd %s && make all"
(
locate-dominating-file
buffer-file-name
".dir-locals.el"
)))))))
((
nil
.
((
eval
.
(
setq
compile-command
(
format
"cd %s &&
BELENIOS_DEBUG=1
make all"
(
locate-dominating-file
buffer-file-name
".dir-locals.el"
)))))))
myocamlbuild.ml
View file @
c779983f
open
Ocamlbuild_plugin
let
debug
=
try
Sys
.
getenv
"BELENIOS_DEBUG"
<>
""
with
Not_found
->
false
let
try_exec
cmd
=
Sys
.
command
(
cmd
^
" >/dev/null 2>&1"
)
=
0
...
...
@@ -32,7 +36,9 @@ let platform_rules kind =
rule
mllib
~
deps
:
[
ml
]
~
prods
:
[
mllib
]
(
fun
_
_
->
(* technically, there is no dependency, but we need the directory to
exist for the following *)
Echo
([
platform_dir
/
kind
/
"Platform"
;
"
\n
"
]
,
mllib
)
Echo
([
platform_dir
/
kind
/
"Belenios_version"
;
"
\n
"
;
platform_dir
/
kind
/
"Platform"
;
"
\n
"
]
,
mllib
)
);
dep
[
"file:"
^
ml
]
[
mli
];
copy_rule
mli
(
lib
/
"platform.mli"
)
mli
;
...
...
@@ -47,10 +53,10 @@ let build_rule () =
in
rule
"BUILD"
~
deps
~
prod
builder
let
version_rule
()
=
let
version_rule
s
kind
=
let
file
=
"BUILD"
in
let
deps
=
[
file
;
"src/
lib
/belenios_version.mli"
]
in
let
prod
=
"src/
lib
/belenios_version.ml"
in
let
deps
=
[
file
;
"src/
platform/"
^
kind
^
"
/belenios_version.mli"
]
in
let
prod
=
"src/
platform/"
^
kind
^
"
/belenios_version.ml"
in
let
builder
_
_
=
let
version
,
build
=
let
ic
=
open_in
file
in
...
...
@@ -62,10 +68,15 @@ let version_rule () =
let
lines
=
Printf
.([
sprintf
"let version =
\"
%s
\"
"
version
;
sprintf
"let build =
\"
%s
\"
"
build
;
sprintf
"let debug = %b"
debug
;
])
in
Echo
(
lines
,
prod
)
in
rule
"BUILD -> belenios_version.ml"
~
deps
~
prod
builder
copy_rule
(
kind
/
"belenios_tool.mli"
)
"src/lib/belenios_version.mli"
(
"src/platform/"
^
kind
^
"/belenios_version.mli"
);
rule
(
"BUILD -> "
^
kind
^
"/belenios_version.ml"
)
~
deps
~
prod
builder
let
copy_static
f
=
let
base
=
Filename
.
basename
f
in
...
...
@@ -103,7 +114,8 @@ let () = dispatch & function
);
build_rule
()
;
version_rule
()
;
version_rules
"native"
;
version_rules
"js"
;
platform_rules
"native"
;
platform_rules
"js"
;
...
...
src/lib/belenios_version.mli
View file @
c779983f
val
version
:
string
val
build
:
string
val
debug
:
bool
src/tool/tool_cmdline.ml
View file @
c779983f
...
...
@@ -468,7 +468,9 @@ end
let
cmds
=
Tkeygen
.
cmds
@
Election
.
cmds
@
Credgen
.
cmds
@
Mkelection
.
cmds
@
Verifydiff
.
cmds
let
default_cmd
=
let
version
=
Belenios_version
.(
Printf
.
sprintf
"%s (%s)"
version
build
)
in
let
open
Belenios_version
in
let
version
=
Printf
.
sprintf
"%s (%s)"
version
build
in
let
version
=
if
debug
then
version
^
" [debug]"
else
version
in
let
doc
=
"election management tool"
in
let
man
=
common_man
in
Term
.(
ret
(
pure
(
`Help
(
`Pager
,
None
))))
,
...
...
src/web/server.mllib
View file @
c779983f
src/platform/native/Belenios_version
src/platform/native/Platform
Serializable_builtin_t
Serializable_builtin_j
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment