Added a function dune_library_to_signature which takes the path of a dune built library and extracts the signatures of all the different module files in that library, to build a "merged" signature of the entire library
Modified the api_diff.ml to now either take two .cmi files (this uses the only the diffing implementation) OR two library paths (this uses the dune_library_to_signature and then the diffing implementation) as reference and current versions and then diff them
Added a cram test which creates two versions (the second one with some modifications to test their diff) of a simple OCaml library with one main math.ml and another utils.ml file and uses api-diff command to create their text diff
Note:
The implementation of dune_library_to_signature requires that the project/library whose path is provided has been properly built and a _build folder is present for it in the path provided.
This PR makes the following changes:
dune_library_to_signature
which takes the path of a dune built library and extracts the signatures of all the different module files in that library, to build a "merged" signature of the entire libraryapi_diff.ml
to now either take two.cmi
files (this uses the only the diffing implementation) OR two library paths (this uses thedune_library_to_signature
and then the diffing implementation) as reference and current versions and then diff themmath.ml
and anotherutils.ml
file and usesapi-diff
command to create their text diffNote: The implementation of
dune_library_to_signature
requires that the project/library whose path is provided has been properly built and a_build
folder is present for it in the path provided.