Skip to content

Commit

Permalink
Preserve comments when rewriting opam files
Browse files Browse the repository at this point in the history
Signed-off-by: Jon Ludlam <jon@recoil.org>
  • Loading branch information
jonludlam committed Apr 15, 2019
1 parent 9d22b3c commit 56d5d3b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion dune.opam
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ depends: [
"base-threads"
]
build: [
# opam 2 sets OPAM_SWITCH_PREFIX, so we don't need a hardcoded path
["ocaml" "configure.ml" "--libdir" lib] {opam-version < "2"}
["ocaml" "bootstrap.ml"]
["./boot.exe" "--release" "--subst"] {pinned}
Expand All @@ -20,6 +21,7 @@ conflicts: [
"jbuilder" {!= "transition"}
"odoc" {< "1.3.0"}
]

synopsis: "Fast, portable and opinionated build system"
description: """
dune is a build system that was designed to simplify the release of
Expand All @@ -38,4 +40,4 @@ It also supports multi-context builds, such as building against
several opam roots/switches simultaneously. This helps maintaining
packages across several versions of OCaml and gives cross-compilation
for free.
"""
"""
2 changes: 1 addition & 1 deletion src/opam_create.ml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ let add_rules sctx ~dir ~project =
let package_name = Local_package.name pkg in
let corrected =
Opam_file.Mutator.apply (correct project package_name) opamfile in
OpamPrinter.opamfile corrected) >>>
OpamPrinter.Preserved.items contents opamfile.file_contents corrected.file_contents) >>>
Build.write_file_dyn expected_path
in
let diff_rule =
Expand Down

0 comments on commit 56d5d3b

Please sign in to comment.