Don't hardcode the transition message to be date based
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
This commit is contained in:
parent
d1d7672e96
commit
492286ba12
|
@ -868,7 +868,7 @@ module Library = struct
|
|||
if_list
|
||||
~then_:(
|
||||
Syntax.since Stanza.syntax (1, 2) >>= fun () ->
|
||||
sum ["transition_until", string >>| fun x -> Yes_with_transition x])
|
||||
sum ["transition", string >>| fun x -> Yes_with_transition x])
|
||||
~else_:(bool >>| fun w -> Simple w)
|
||||
|
||||
let field = field "wrapped" ~default:(Simple true) dparse
|
||||
|
|
|
@ -127,7 +127,7 @@ module Gen (P : Install_rules.Params) = struct
|
|||
~dynlink
|
||||
~(deprecated : Module.t Module.Name.Map.t) =
|
||||
let lib_name = String.capitalize (Lib_name.Local.to_string lib.name) in
|
||||
let transition_until =
|
||||
let transition_message =
|
||||
match lib.wrapped with
|
||||
| Simple _ -> "" (* will never be accessed anyway *)
|
||||
| Yes_with_transition r -> r
|
||||
|
@ -137,9 +137,8 @@ module Gen (P : Install_rules.Params) = struct
|
|||
let name = Module.Name.to_string name in
|
||||
let hidden_name = sprintf "%s__%s" lib_name name in
|
||||
let real_name = sprintf "%s.%s" lib_name name in
|
||||
sprintf "include %s [@@deprecated \"%s is not guaranteed past %s. \
|
||||
Use %s instead.\"]"
|
||||
hidden_name name transition_until real_name
|
||||
sprintf "include %s [@@deprecated \"%s. Use %s instead.\"]"
|
||||
hidden_name transition_message real_name
|
||||
in
|
||||
let source_path = Option.value_exn (Module.file m Impl) in
|
||||
Build.return contents
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
(library
|
||||
(name mylib)
|
||||
(wrapped (transition_until "2020-20-20")))
|
||||
(wrapped (transition "Will be removed past 2020-20-20")))
|
Loading…
Reference in New Issue