[infer][genrule] Added command-line option --check-version

Reviewed By: jeremydubreil

Differential Revision: D6813434

fbshipit-source-id: abd77b5
master
Tony Hu 7 years ago committed by Facebook Github Bot
parent 432ba7f447
commit c1fd661648

@ -99,6 +99,14 @@ let () =
L.exit 0 L.exit 0
| Error e -> | Error e ->
print_endline e ; L.exit 3 ) ; print_endline e ; L.exit 3 ) ;
( match Config.check_version with
| Some check_version ->
if not (String.equal check_version Version.versionString) then
L.(die UserError)
"Provided version '%s' does not match actual version '%s'" check_version
Version.versionString
| None ->
() ) ;
if Config.print_builtins then Builtin.print_and_exit () ; if Config.print_builtins then Builtin.print_and_exit () ;
setup () ; setup () ;
log_environment_info () ; log_environment_info () ;

@ -872,6 +872,11 @@ and changed_files_index =
"Specify the file containing the list of source files from which reactive analysis should start. Source files should be specified relative to project root or be absolute" "Specify the file containing the list of source files from which reactive analysis should start. Source files should be specified relative to project root or be absolute"
and check_version =
CLOpt.mk_string_opt ~long:"check-version" ~meta:"version"
"Verify that the Infer version is equal to the provided argument"
and clang_biniou_file = and clang_biniou_file =
CLOpt.mk_path_opt ~long:"clang-biniou-file" CLOpt.mk_path_opt ~long:"clang-biniou-file"
~in_help:InferCommand.([(Capture, manual_clang)]) ~in_help:InferCommand.([(Capture, manual_clang)])
@ -2286,6 +2291,8 @@ and changed_files_index = !changed_files_index
and check_nullable = !check_nullable and check_nullable = !check_nullable
and check_version = !check_version
and clang_biniou_file = !clang_biniou_file and clang_biniou_file = !clang_biniou_file
and clang_ignore_regex = !clang_ignore_regex and clang_ignore_regex = !clang_ignore_regex

@ -284,6 +284,8 @@ val changed_files_index : string option
val check_nullable : bool val check_nullable : bool
val check_version : string option
val clang_biniou_file : string option val clang_biniou_file : string option
val clang_frontend_action_string : string val clang_frontend_action_string : string

Loading…
Cancel
Save