Skip to content

Commit

Permalink
Merge pull request #220 from lefessan/z-2023-09-29-remove-ez-config
Browse files Browse the repository at this point in the history
Remove dependency towards unused ez_config
lefessan authored Jun 27, 2024
2 parents 87f34da + 3f610d9 commit 61aee33
Showing 16 changed files with 62 additions and 52 deletions.
24 changes: 12 additions & 12 deletions .drom
Original file line number Diff line number Diff line change
@@ -5,12 +5,12 @@ version:0.9.0

# hash of toml configuration files
# used for generation of all files
27968ad2d0e5e4bf2de6882737668c66:.
cfa41e62814087cf2f340eab496a6542:.
# end context for .

# begin context for .github/workflows/workflow.yml
# file .github/workflows/workflow.yml
17379dd384713dc356e0f1f47b7de18b:.github/workflows/workflow.yml
533318fb1c01b0861406a644a7d9f39c:.github/workflows/workflow.yml
# end context for .github/workflows/workflow.yml

# begin context for .gitignore
@@ -40,12 +40,12 @@ version:0.9.0

# begin context for LICENSE.md
# file LICENSE.md
e31b19b601ab25353ef16d67127735f1:LICENSE.md
8fc45323c2500fb66e52deb392dda4f2:LICENSE.md
# end context for LICENSE.md

# begin context for Makefile
# file Makefile
20473ad87e42d8860a8bdd33a79842ad:Makefile
9018881cf0682f4f7f262417b0d4f9ff:Makefile
# end context for Makefile

# begin context for README.md
@@ -100,22 +100,22 @@ e850a13c004f963e9f5a568eac93c217:dune

# begin context for dune-project
# file dune-project
f8f5311a3752d34fcd492d98660840ad:dune-project
47416b4e7b7e7febc8da32932cae0d54:dune-project
# end context for dune-project

# begin context for opam/drom.opam
# file opam/drom.opam
2de609a6a5c806247b3bdd82f913a109:opam/drom.opam
d3c8882f1742f865c2987dea6c7c83e2:opam/drom.opam
# end context for opam/drom.opam

# begin context for opam/drom_lib.opam
# file opam/drom_lib.opam
38acddee945b9967310158787939ea09:opam/drom_lib.opam
8b323689fcc28f9783fa85ca4a4fac55:opam/drom_lib.opam
# end context for opam/drom_lib.opam

# begin context for opam/drom_toml.opam
# file opam/drom_toml.opam
0414e4eed49fb8e24683f51dfd27d7d3:opam/drom_toml.opam
81116a1889e6414dee5c2e921961aa77:opam/drom_toml.opam
# end context for opam/drom_toml.opam

# begin context for scripts/after.sh
@@ -165,7 +165,7 @@ a44c87f3a364dd95f55427fe40b2c5d1:sphinx/about.rst

# begin context for sphinx/license.rst
# file sphinx/license.rst
7f09d28eb87ab9f2650899f85835e74a:sphinx/license.rst
8f504f01aea592543c0a662b81169d91:sphinx/license.rst
# end context for sphinx/license.rst

# begin context for src/drom/dune
@@ -195,7 +195,7 @@ efad88968955023a354f16469eb1ae15:src/drom/dune

# begin context for src/drom_lib/dune
# file src/drom_lib/dune
e7ddb8c3da7d7b47c8100964303ba50a:src/drom_lib/dune
a97be0d7328e7c15eb149c454844646a:src/drom_lib/dune
# end context for src/drom_lib/dune

# begin context for src/drom_lib/index.mld
@@ -210,7 +210,7 @@ e7ddb8c3da7d7b47c8100964303ba50a:src/drom_lib/dune

# begin context for src/drom_lib/version.mlt
# file src/drom_lib/version.mlt
9749ccfb897b43e7f10913c8ee636af5:src/drom_lib/version.mlt
fc09abbaf032f775d148928fa1398cf9:src/drom_lib/version.mlt
# end context for src/drom_lib/version.mlt

# begin context for src/toml.7.1.0/dune
@@ -235,7 +235,7 @@ d1b05207fce876a1b44a8b268bcaf226:src/toml.7.1.0/index.mld

# begin context for src/toml.7.1.0/version.mlt
# file src/toml.7.1.0/version.mlt
9749ccfb897b43e7f10913c8ee636af5:src/toml.7.1.0/version.mlt
fc09abbaf032f775d148928fa1398cf9:src/toml.7.1.0/version.mlt
# end context for src/toml.7.1.0/version.mlt

# begin context for test/expect-tests/dune
8 changes: 4 additions & 4 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@ jobs:
- macos-latest
- windows-latest
ocaml-compiler:
- 4.10.0
- 4.14.1
skip_test:
- false

@@ -93,10 +93,10 @@ jobs:
- name: test source is well formatted
run: make fmt
continue-on-error: true
if: matrix.ocaml-compiler == '4.10.0' && matrix.os == 'ubuntu-latest'
if: matrix.ocaml-compiler == '4.14.1' && matrix.os == 'ubuntu-latest'

- name: build-doc
if: github.ref == 'refs/heads/master' && matrix.ocaml-compiler == '4.10.0' && matrix.os == 'ubuntu-latest'
if: github.ref == 'refs/heads/master' && matrix.ocaml-compiler == '4.14.1' && matrix.os == 'ubuntu-latest'
run: |
sudo apt install -yqq python3-sphinx python3-sphinx-rtd-theme
opam install -y dune odoc
@@ -107,7 +107,7 @@ jobs:
- name: deploy-doc
uses: JamesIves/github-pages-deploy-action@3.6.2
if: github.ref == 'refs/heads/master' && matrix.ocaml-compiler == '4.10.0' && matrix.os == 'ubuntu-latest'
if: github.ref == 'refs/heads/master' && matrix.ocaml-compiler == '4.14.1' && matrix.os == 'ubuntu-latest'
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2023 OCamlPro SAS
Copyright (c) 2024 OCamlPro SAS

This software is distributed under the terms of the
GNU Lesser General Public License (LGPL) version 2.1 (included below).
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -25,7 +25,7 @@ build:

build-deps:
if ! [ -e _opam ]; then \
opam switch create . 4.10.0 ; \
opam switch create . 4.14.1 ; \
fi
opam install ./*.opam --deps-only

4 changes: 2 additions & 2 deletions drom.toml
Original file line number Diff line number Diff line change
@@ -8,14 +8,14 @@ share-version = "0.9.0"
authors = ["Fabrice Le Fessant <fabrice.le_fessant@ocamlpro.com>", "Léo Andrès <leo.andres@ocamlpro.com>"]
ci-systems = ["ubuntu-latest", "macos-latest", "windows-latest"]
copyright = "OCamlPro SAS"
edition = "4.10.0"
edition = "4.14.1"
github-organization = "ocamlpro"
license = "LGPL2"
min-edition = "4.07.0"
name = "drom"
skeleton = "program"
synopsis = "The drom tool is a wrapper over opam/dune in an attempt to provide a cargo-like user experience"
version = "0.9.2~dev4"
version = "0.9.2"

# keys that you could also define:
# odoc-target = "...odoc-target..."
3 changes: 1 addition & 2 deletions dune-project
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@
(name drom)
(allow_approximate_merlin)
(generate_opam_files false)
(version 0.9.2~dev3)
(version 0.9.2)
(formatting (enabled_for ocaml reason))
(using menhir 2.0)

@@ -33,7 +33,6 @@
(ez_subst ( >= 0.1 ))
(ez_opam_file (and (>= 0.1.0) (< 1.0.0)))
(ez_file (and (>= 0.3.0) (< 1.0.0)))
(ez_config (and (>= 0.1.0) (< 1.0.0)))
(ez_cmdliner (and (>= 0.2.0) (< 1.0.0)))
(drom_toml (= version))
(directories ( >= 0.2 ))
2 changes: 1 addition & 1 deletion opam/drom.opam
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
# Do not modify, or add to the `skip` field of `drom.toml`.
opam-version: "2.0"
name: "drom"
version: "0.9.2~dev3"
version: "0.9.2"
license: "LGPL-2.1-only WITH OCaml-LGPL-linking-exception"
synopsis:
"The drom tool is a wrapper over opam/dune in an attempt to provide a cargo-like user experience"
3 changes: 1 addition & 2 deletions opam/drom_lib.opam
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
# Do not modify, or add to the `skip` field of `drom.toml`.
opam-version: "2.0"
name: "drom_lib"
version: "0.9.2~dev3"
version: "0.9.2"
license: "LGPL-2.1-only WITH OCaml-LGPL-linking-exception"
synopsis:
"The drom tool is a wrapper over opam/dune in an attempt to provide a cargo-like user experience"
@@ -51,7 +51,6 @@ depends: [
"ez_subst" {>= "0.1"}
"ez_opam_file" {>= "0.1.0" & < "1.0.0"}
"ez_file" {>= "0.3.0" & < "1.0.0"}
"ez_config" {>= "0.1.0" & < "1.0.0"}
"ez_cmdliner" {>= "0.2.0" & < "1.0.0"}
"drom_toml" {= version}
"directories" {>= "0.2"}
2 changes: 1 addition & 1 deletion opam/drom_toml.opam
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
# Do not modify, or add to the `skip` field of `drom.toml`.
opam-version: "2.0"
name: "drom_toml"
version: "0.9.2~dev3"
version: "0.9.2"
license: "LGPL-2.1-only WITH OCaml-LGPL-linking-exception"
synopsis:
"The drom tool is a wrapper over opam/dune in an attempt to provide a cargo-like user experience"
2 changes: 1 addition & 1 deletion sphinx/conf.py
Original file line number Diff line number Diff line change
@@ -220,4 +220,4 @@

# entry point for setup
def setup(app):
app.add_css_file('css/fixes.css')
app.add_stylesheet('css/fixes.css')
2 changes: 1 addition & 1 deletion sphinx/license.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Copyright and License
=====================

Copyright (c) 2023 OCamlPro SAS
Copyright (c) 2024 OCamlPro SAS

This software is distributed under the terms of the
GNU Lesser General Public License (LGPL) version 2.1 (included below).
2 changes: 1 addition & 1 deletion src/drom_lib/dune
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@
(name drom_lib)
(public_name drom_lib)
(wrapped true)
(libraries omd ez_subst ez_opam_file ez_file ez_config ez_cmdliner drom_toml directories bigarray)
(libraries omd ez_subst ez_opam_file ez_file ez_cmdliner drom_toml directories bigarray)


)
52 changes: 32 additions & 20 deletions src/drom_lib/hashes.ml
Original file line number Diff line number Diff line change
@@ -67,7 +67,7 @@ type t =
let load () =
let version = ref None in
let hashes =
if Sys.file_exists ".drom" then (
if Sys.file_exists ".drom" then
let map = ref StringMap.empty in
(* Printf.eprintf "Loading .drom\n%!"; *)
Array.iteri
@@ -104,7 +104,7 @@ let load () =
exit 2 )
(EzFile.read_lines ".drom");
!map
) else
else
StringMap.empty
in
{ hashes;
@@ -150,11 +150,11 @@ let save ?(git = true) t =
if t.modified then begin
StringMap.iter
(fun file (record, content, perm) ->
let dirname = Filename.dirname file in
if not (Sys.file_exists dirname) then EzFile.make_dir ~p:true dirname;
EzFile.write_file file content;
Unix.chmod file perm;
if record then update t file [digest_content ~file ~perm ~content ()] )
let dirname = Filename.dirname file in
if not (Sys.file_exists dirname) then EzFile.make_dir ~p:true dirname;
EzFile.write_file file content;
Unix.chmod file perm;
if record then update t file [digest_content ~file ~perm ~content ()] )
t.files;

let b = Buffer.create 1000 in
@@ -167,19 +167,31 @@ let save ?(git = true) t =
Printf.bprintf b "# end version\n%!";
StringMap.iter
(fun filename hashes ->
if Sys.file_exists filename then begin
if filename = "." then begin
Printf.bprintf b "\n# hash of toml configuration files\n";
Printf.bprintf b "# used for generation of all files\n"
end else begin
Printf.bprintf b "\n# begin context for %s\n" filename;
Printf.bprintf b "# file %s\n" filename
end;
List.iter (fun hash ->
Printf.bprintf b "%s:%s\n" (HASH.to_hex hash) filename
) (List.rev hashes);
Printf.bprintf b "# end context for %s\n" filename
end )
if Sys.file_exists filename then begin
let hashes =
if filename = "." then begin
Printf.bprintf b "\n# hash of toml configuration files\n";
Printf.bprintf b "# used for generation of all files\n";
hashes
end else begin
Printf.bprintf b "\n# begin context for %s\n" filename;
Printf.bprintf b "# file %s\n" filename;
let found = ref None in
let current_hash = digest_file filename in
List.iter (fun hash ->
if hash = current_hash then
found := Some current_hash;
) hashes;
match !found with
| Some hash -> [ hash ]
| None -> hashes
end
in
List.iter (fun hash ->
Printf.bprintf b "%s:%s\n" (HASH.to_hex hash) filename
) (List.rev hashes);
Printf.bprintf b "# end context for %s\n" filename
end )
t.hashes;
EzFile.write_file ".drom" (Buffer.contents b);

2 changes: 1 addition & 1 deletion src/drom_lib/package.toml
Original file line number Diff line number Diff line change
@@ -49,7 +49,7 @@ pack-modules = true
directories = ">=0.2"
drom_toml = "version"
ez_cmdliner = "0.2.0"
ez_config = "0.1.0"
#ez_config = "0.1.0"
ez_file = "0.3.0"
ez_opam_file = "0.1.0"
ez_subst = ">=0.1"
2 changes: 1 addition & 1 deletion src/drom_lib/version.mlt
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ let query cmd =

let commit_hash = query "git show -s --pretty=format:%H"
let commit_date = query "git show -s --pretty=format:%ci"
let version = "0.9.2~dev3"
let version = "0.9.2"

let string_option = function
| None -> "None"
2 changes: 1 addition & 1 deletion src/toml.7.1.0/version.mlt
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ let query cmd =

let commit_hash = query "git show -s --pretty=format:%H"
let commit_date = query "git show -s --pretty=format:%ci"
let version = "0.9.2~dev3"
let version = "0.9.2"

let string_option = function
| None -> "None"

0 comments on commit 61aee33

Please sign in to comment.