Fix generation of the ppx key for jbuild directories (#860)

Signed-off-by: Jeremie Dimino <jdimino@janestreet.com>
This commit is contained in:
Jérémie Dimino 2018-06-06 16:17:40 +01:00 committed by GitHub
parent ec6ca4be67
commit 0fafebe9be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 2 deletions

View File

@ -324,8 +324,13 @@ let gen_rules sctx components =
let ppx_driver_exe sctx libs ~dir_kind =
let names =
List.rev_map libs ~f:Lib.name
|> List.sort ~compare:String.compare
let names = List.rev_map libs ~f:Lib.name in
match (dir_kind : File_tree.Dune_file.Kind.t) with
| Dune -> List.sort names ~compare:String.compare
| Jbuild ->
match names with
| last :: others -> List.sort others ~compare:String.compare @ [last]
| [] -> []
in
let scope_for_key =
List.fold_left libs ~init:None ~f:(fun acc lib ->