-
Notifications
You must be signed in to change notification settings - Fork 412
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for x-maintenance-intent in dune-project (#11274)
* Add support for opam x-maintenance-intent in dune-project Signed-off-by: ArthurW <[email protected]> Signed-off-by: Marek Kubica <[email protected]> * Add tests for maintenance_intent Signed-off-by: ArthurW <[email protected]> Signed-off-by: Marek Kubica <[email protected]> * Document maintenance_intent Signed-off-by: ArthurW <[email protected]> Signed-off-by: Marek Kubica <[email protected]> * Default maintenance_intent to (latest) Signed-off-by: ArthurW <[email protected]> Signed-off-by: Marek Kubica <[email protected]> * No x-maintenance-intent in opam files for dune<3.18 Signed-off-by: ArthurW <[email protected]> Signed-off-by: Marek Kubica <[email protected]> --------- Signed-off-by: ArthurW <[email protected]> Signed-off-by: Marek Kubica <[email protected]>
- Loading branch information
Showing
14 changed files
with
125 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
- Support for opam `(maintenance_intent ...)` in dune-project (#11274, @art-w) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -81,13 +81,15 @@ For example, if your opam file looks like: | |
"conduit-async" { >= "1.0.3" } | ||
"async" { >= "v0.10.0" } | ||
] | ||
x-maintenance-intent: [ "(latest)" ] | ||
You can express this as:: | ||
|
||
(source (github mirage/ocaml-cohttp)) | ||
(license ISC) | ||
(authors "Anil Madhavapeddy" "Rudi Grinberg") | ||
(maintainers "[email protected]") | ||
(maintenance_intent "(latest)") | ||
|
||
(package | ||
(name cohttp-async) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -63,6 +63,19 @@ defined in the project: | |
"Jane Doe <[email protected]>" | ||
"John Doe <[email protected]>") | ||
.. _maintenance_intent: | ||
.. describe:: (maintenance_intent <strings>) | ||
|
||
.. versionadded:: 3.18 | ||
|
||
Specify the `opam maintenance intent <https://github.com/ocaml/opam-repository/blob/master/governance/policies/archiving.md#specification-of-the-x--fields-used-in-the-archiving-process>`__. | ||
|
||
Example: | ||
|
||
.. code:: dune | ||
(maintenance_intent "(latest)") | ||
.. describe:: (source ...) | ||
|
||
.. versionadded:: 1.7 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,21 +20,27 @@ module Dune_config = struct | |
type t = | ||
{ authors : string list option | ||
; maintainers : string list option | ||
; maintenance_intent : string list option | ||
; license : string list option | ||
} | ||
|
||
let decode = | ||
fields | ||
(let+ authors = field_o "authors" (repeat string) | ||
and+ maintainers = field_o "maintainers" (repeat string) | ||
and+ maintenance_intent = field_o "maintenance_intent" (repeat string) | ||
and+ license = field_o "license" (repeat string) in | ||
{ authors; maintainers; license }) | ||
{ authors; maintainers; maintenance_intent; license }) | ||
;; | ||
|
||
let to_dyn t = | ||
let f = Dyn.(option (list string)) in | ||
Dyn.record | ||
[ "authors", f t.authors; "maintainers", f t.maintainers; "license", f t.license ] | ||
[ "authors", f t.authors | ||
; "maintainers", f t.maintainers | ||
; "maintenance_intent", f t.maintenance_intent | ||
; "license", f t.license | ||
] | ||
;; | ||
end | ||
|
||
|
@@ -359,6 +365,7 @@ module Dune_config = struct | |
; project_defaults = | ||
{ authors = Some [ "Author Name <[email protected]>" ] | ||
; maintainers = Some [ "Maintainer Name <[email protected]>" ] | ||
; maintenance_intent = None | ||
; license = Some [ "LICENSE" ] | ||
} | ||
; experimental = [] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.