diff --git a/.drom b/.drom index 7932006..d8bcf85 100644 --- a/.drom +++ b/.drom @@ -5,7 +5,7 @@ version:0.9.0 # hash of toml configuration files # used for generation of all files -9aa97f19d5f4d407d8d3ee24f5aab0c5:. +95833d0bdbcee78f882a5a625ed0d0e4:. # end context for . # begin context for .github/workflows/ci.ml @@ -15,12 +15,12 @@ ac2aab1d8f78befbbfca730668f71e8d:.github/workflows/ci.ml # begin context for .github/workflows/workflow.yml # file .github/workflows/workflow.yml -0ccff850a6ed3d421d1a75eee435bc14:.github/workflows/workflow.yml +6b1ee9e0d62afe299c8fe62efa42c21d:.github/workflows/workflow.yml # end context for .github/workflows/workflow.yml # begin context for .gitignore # file .gitignore -4fbab3b9cc53d400585f1f8b93288bfe:.gitignore +b82bcaa637d3f162f45c404af9dd3b4d:.gitignore # end context for .gitignore # begin context for .ocamlformat @@ -38,6 +38,16 @@ c8f70450e7d78c0387644864ffe8cbd5:.ocamlformat-ignore 1281376e351d6c2be9ea4c576a29ebd4:.ocp-indent # end context for .ocp-indent +# begin context for .vscode/settings.json +# file .vscode/settings.json +c3d12805c4eeee16a89bfeee357c8325:.vscode/settings.json +# end context for .vscode/settings.json + +# begin context for .vscode/tasks.json +# file .vscode/tasks.json +7884eee2b10cf89cff5d1e466646b046:.vscode/tasks.json +# end context for .vscode/tasks.json + # begin context for CHANGES.md # file CHANGES.md 7a038eccc259630a7aaa876eceb826ba:CHANGES.md @@ -50,9 +60,14 @@ cdfde087b1ceb33b9c5f9d01ddc08d62:LICENSE.md # begin context for Makefile # file Makefile -af1157fb3599c96e00152d564db64b64:Makefile +05325f8fa82ef34fa0bab395248cc8b3:Makefile # end context for Makefile +# begin context for Makefile.drom +# file Makefile.drom +25061d68284137e2639975011a16b300:Makefile.drom +# end context for Makefile.drom + # begin context for README.md # file README.md b437ded55955d885b421f442f61f59bb:README.md @@ -80,7 +95,7 @@ c37a7235a116dd40fbb23168977dd549:docs/doc/index.html # begin context for docs/index.html # file docs/index.html -2ebaaca3b5699237d9b2b3a92092f2c2:docs/index.html +0677f3ef5de144072f0dda02b8cd7f7e:docs/index.html # end context for docs/index.html # begin context for docs/sphinx/index.html @@ -95,7 +110,7 @@ c8281f46ba9a11d0b61bc8ef67eaa357:docs/style.css # begin context for drom.toml # file drom.toml -61839e8d3bf7209159a62ad2a75f2c66:drom.toml +95d29c77567f1a83f56cd68941308a44:drom.toml # end context for drom.toml # begin context for dune @@ -105,12 +120,14 @@ df544cfaf9078d1bba2f90ed1b5adf5f:dune # begin context for dune-project # file dune-project -6d4cd5636f52fc7edf771a588766bb6c:dune-project +43b99f0e75cf087e6db9f4111d8f91fd:dune-project +416e6e9216aadb14b8d518a6094d828b:dune-project # end context for dune-project # begin context for opam/ez_file.opam # file opam/ez_file.opam -181b3a7dd59114806144fa4c1b4a01b3:opam/ez_file.opam +45cb77a1e984ab8eb84d21ce2b2cf362:opam/ez_file.opam +fce746e3f55c5b5faa25451407842c0a:opam/ez_file.opam # end context for opam/ez_file.opam # begin context for scripts/after.sh @@ -125,9 +142,14 @@ df544cfaf9078d1bba2f90ed1b5adf5f:dune # begin context for scripts/copy-bin.sh # file scripts/copy-bin.sh -bb3a9d286f0dc64021db4194427263ee:scripts/copy-bin.sh +7fe4ada2a2fc5a0ebf9a2f483679a0ae:scripts/copy-bin.sh # end context for scripts/copy-bin.sh +# begin context for scripts/static-build.sh +# file scripts/static-build.sh +cda3f8bad69d9c6e8cbeab1c720d739a:scripts/static-build.sh +# end context for scripts/static-build.sh + # begin context for sphinx/_static/css/fixes.css # file sphinx/_static/css/fixes.css 68b329da9893e34099c7d8ad5cb9c940:sphinx/_static/css/fixes.css @@ -150,7 +172,7 @@ bb3a9d286f0dc64021db4194427263ee:scripts/copy-bin.sh # begin context for sphinx/install.rst # file sphinx/install.rst -51fc8c1636ef901c660808ace2fa032f:sphinx/install.rst +1283ed1cc1357f05e4018c2e41e18103:sphinx/install.rst # end context for sphinx/install.rst # begin context for sphinx/license.rst @@ -160,7 +182,7 @@ bb3a9d286f0dc64021db4194427263ee:scripts/copy-bin.sh # begin context for src/ez_file/dune # file src/ez_file/dune -4ebbfb6c250e6241171b938a4bc7f6c0:src/ez_file/dune +d4c00bd7acad8b3918b729fc6fb153f9:src/ez_file/dune # end context for src/ez_file/dune # begin context for src/ez_file/index.mld @@ -178,37 +200,12 @@ d084e0c0b356453f70a0ab97451d4863:src/ez_file/package.toml e2b4f39fcfb303f845699e550cb89a31:test/expect-tests/dune # end context for test/expect-tests/dune +# begin context for test/expect-tests/dune.drom +# file test/expect-tests/dune.drom +619a1392093d0d7aad989e3d225d719f:test/expect-tests/dune.drom +# end context for test/expect-tests/dune.drom + # begin context for test/expect-tests/test.ml # file test/expect-tests/test.ml 734ed6b2b1cb8e0d6bce316d155bb157:test/expect-tests/test.ml # end context for test/expect-tests/test.ml - -# begin context for test/inline-tests/dune -# file test/inline-tests/dune -f83749a3827aaac58638994a6e6528d1:test/inline-tests/dune -# end context for test/inline-tests/dune - -# begin context for test/inline-tests/test.ml -# file test/inline-tests/test.ml -e001d04969100c711855223ad6c23e6a:test/inline-tests/test.ml -# end context for test/inline-tests/test.ml - -# begin context for test/output-tests/dune -# file test/output-tests/dune -75c72884478404495ffa9485c85ac098:test/output-tests/dune -# end context for test/output-tests/dune - -# begin context for test/output-tests/test1.expected -# file test/output-tests/test1.expected -f0ef7081e1539ac00ef5b761b4fb01b3:test/output-tests/test1.expected -# end context for test/output-tests/test1.expected - -# begin context for test/output-tests/test2.expected -# file test/output-tests/test2.expected -894dddf3304cbcb0fe04f7c2bbd56073:test/output-tests/test2.expected -# end context for test/output-tests/test2.expected - -# begin context for test/output-tests/test2.ml -# file test/output-tests/test2.ml -704ff05ffd8b0e50716542fa55b2db8a:test/output-tests/test2.ml -# end context for test/output-tests/test2.ml diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index bdd89be..1e3187a 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -1,5 +1,6 @@ name: Main Workflow +# use fields.git-main-branch to change from master on: pull_request: branches: @@ -16,62 +17,66 @@ jobs: os: - ubuntu-latest - macos-latest + - windows-latest ocaml-compiler: - - 4.10.0 + - 4.14.2 skip_test: - false include: - os: ubuntu-latest - ocaml-compiler: 4.07.0 + ocaml-compiler: 4.11.0 skip_test: true +# we need permissions to deploy docs + permissions: + contents: write + runs-on: ${{ matrix.os }} + # use fields.github-workflow-env to add something here + steps: - name: Checkout code uses: actions/checkout@v2 - name: Retrieve opam cache - uses: actions/cache@v2 + uses: actions/cache@v4 id: cache-opam with: path: ~/.opam - key: v2-${{ runner.os }}-ez_file-${{ matrix.ocaml-compiler }}-${{ hashFiles('opam/*.opam') }} + key: v4-${{ runner.os }}-ez_file-${{ matrix.ocaml-compiler }}-${{ hashFiles('opam/*.opam') }} # restore-keys: | -# v2-${{ runner.os }}-opam-${{ matrix.ocaml-compiler }}- +# v4-${{ runner.os }}-opam-${{ matrix.ocaml-compiler }}- - name: Use OCaml ${{ matrix.ocaml-compiler }} - uses: avsm/setup-ocaml@v2 + uses: avsm/setup-ocaml@v3 with: ocaml-compiler: ${{ matrix.ocaml-compiler }} opam-pin: false - opam-depext: false - name: Set git user run: | git config --global user.name github-actions git config --global user.email github-actions-bot@users.noreply.github.com - # define opam-repo = "git+https://" to add an extra opam repo + # use fields.opam-repo = "git+https://" to add an 'extra' opam repository - run: opam pin add . -y --no-action - - run: opam depext -y ez_file -# if: steps.cache-opam.outputs.cache-hit != 'true' - - - run: opam install -y opam/*.opam --deps-only --with-test -# if: steps.cache-opam.outputs.cache-hit != 'true' + - run: opam install -y ./opam/*.opam --deps-only --with-test -# - run: opam upgrade --fixup -# if: steps.cache-opam.outputs.cache-hit == 'true' - - - run: dos2unix scripts/*.sh + # Use fields.build-scripts to add more scripts to convert here + - run: dos2unix scripts/*.sh if: matrix.os == 'windows-latest' + # Use fields.github-workflow-before-build to add something here + - run: make build + # Use fields.github-workflow-after-build to add something here + - name: run test suite run: | ./scripts/before.sh test @@ -79,13 +84,15 @@ jobs: ./scripts/after.sh test if: matrix.skip_test != 'true' + # Use fields.github-workflow-after-test to add something here + - 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.2' && 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.2' && matrix.os == 'ubuntu-latest' run: | sudo apt install -yqq python3-sphinx python3-sphinx-rtd-theme opam install -y dune odoc @@ -96,9 +103,12 @@ 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.2' && matrix.os == 'ubuntu-latest' with: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} BRANCH: gh-pages FOLDER: _drom/docs/ CLEAN: true + +# Use fields.github-workflow-trailer to add a trailer here + diff --git a/.gitignore b/.gitignore index 6f62fd4..9bf1137 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,6 @@ *~ _build .merlin -.vscode /_drom /_opam /_build diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..b582063 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,6 @@ +{ + "ocaml.sandbox": { + "kind": "opam" + "switch": "${workspaceFolder}" + } +} diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..6df6495 --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,25 @@ +{ + // See https://go.microsoft.com/fwlink/?LinkId=733558 + // for the documentation about the tasks.json format + "version": "2.0.0", + "tasks": [ + { + "label": "ocaml: dune build", + "type": "shell", + "command": "dune build", + "group": { + "kind": "build", + "isDefault": true + } + }, + { + "label": "ocaml: dune runtest -f", + "type": "shell", + "command": "dune runtest -f", + "group": { + "kind": "test", + "isDefault": true + } + } + ] +} diff --git a/Makefile b/Makefile index ab94d1a..4b05c04 100644 --- a/Makefile +++ b/Makefile @@ -1,88 +1,2 @@ -# Generated by "drom project" -.PHONY: all build build-deps fmt fmt-check install dev-deps test -.PHONY: clean distclean - -DEV_DEPS := merlin ocamlformat odoc ppx_expect ppx_inline_test - - -SPHINX_TARGET:=_drom/docs/sphinx - -ODOC_TARGET:=_drom/docs/doc/. - - -# Use these non-generated files to include more rules here (and -# Makefile.trailer at the end) --include Makefile.header --include Makefile.config - -all: build - -build: - ./scripts/before.sh build - opam exec -- dune build @install - ./scripts/copy-bin.sh ez_file - ./scripts/after.sh build - -build-deps: - if ! [ -e _opam ]; then \ - opam switch create . 4.10.0 ; \ - fi - opam install ./*.opam --deps-only - - -.PHONY: doc-common odoc view sphinx -doc-common: build - mkdir -p _drom/docs - rsync -auv docs/. _drom/docs/. - -sphinx: doc-common - ./scripts/before.sh sphinx ${SPHINX_TARGET} - sphinx-build sphinx ${SPHINX_TARGET} - ./scripts/after.sh sphinx ${SPHINX_TARGET} - -odoc: doc-common - mkdir -p ${ODOC_TARGET} - ./scripts/before.sh odoc ${ODOC_TARGET} - opam exec -- dune build @doc - rsync -auv --delete _build/default/_doc/_html/. ${ODOC_TARGET} - ./scripts/after.sh odoc ${ODOC_TARGET} - -doc: doc-common odoc sphinx - -view: - xdg-open file://$$(pwd)/_drom/docs/index.html - -fmt: - opam exec -- dune build @fmt --auto-promote - -fmt-check: - opam exec -- dune build @fmt - -install: - opam pin -y --no-action -k path . - opam install -y . - -opam: - opam pin -k path . - -uninstall: - opam uninstall . - -dev-deps: - opam install ./*.opam --deps-only --with-doc --with-test - -test: - ./scripts/before.sh test - opam exec -- dune build @runtest - ./scripts/after.sh test - -clean: - rm -rf _build - ./scripts/after.sh clean - -distclean: clean - rm -rf _opam _drom - ./scripts/after.sh distclean - --include Makefile.trailer +include Makefile.drom diff --git a/Makefile.drom b/Makefile.drom new file mode 100644 index 0000000..7214ecf --- /dev/null +++ b/Makefile.drom @@ -0,0 +1,83 @@ +# Maintained by "drom project" +.PHONY: $(DROMNS)build $(DROMNS)build-deps $(DROMNS)fmt $(DROMNS)fmt-check +.PHONY: $(DROMNS)install $(DROMNS)dev-deps $(DROMNS)test +.PHONY: $(DROMNS)clean $(DROMNS)distclean + +DROM_DEV_DEPS := merlin ocamlformat odoc ppx_expect ppx_inline_test $(DEV_DEPS) + + +SPHINX_TARGET:=_drom/docs/sphinx + +ODOC_TARGET:=_drom/docs/doc/. + + +$(DROMNS)build: + ./scripts/before.sh build + opam exec -- dune build @install + ./scripts/copy-bin.sh ez_file + ./scripts/after.sh build + +$(DROMNS)build-deps: + if ! [ -e _opam ]; then \ + opam switch create . 4.14.2 ; \ + fi + opam install ./opam/*.opam --deps-only + + +.PHONY: $(DROMNS)doc-common $(DROMNS)odoc $(DROMNS)view +.PHONY: $(DROMNS)sphinx +$(DROMNS)doc-common: $(DROMNS)build + mkdir -p _drom/docs + rsync -auv docs/. _drom/docs/. + +$(DROMNS)sphinx: $(DROMNS)doc-common + ./scripts/before.sh sphinx ${SPHINX_TARGET} + sphinx-build sphinx ${SPHINX_TARGET} + ./scripts/after.sh sphinx ${SPHINX_TARGET} + +$(DROMNS)odoc: $(DROMNS)doc-common + mkdir -p ${ODOC_TARGET} + ./scripts/before.sh odoc ${ODOC_TARGET} + opam exec -- dune build @doc + rsync -auv --delete _build/default/_doc/_html/. ${ODOC_TARGET} + ./scripts/after.sh odoc ${ODOC_TARGET} + +$(DROMNS)doc: $(DROMNS)doc-common $(DROMNS)odoc $(DROMNS)sphinx + +$(DROMNS)view: + xdg-open file://$$(pwd)/_drom/docs/index.html + +$(DROMNS)fmt: + opam exec -- dune build @fmt --auto-promote + +$(DROMNS)fmt-check: + opam exec -- dune build @fmt + +$(DROMNS)install: + opam pin -y --no-action -k path . + opam install -y . + +$(DROMNS)opam: + opam pin -k path . + +$(DROMNS)uninstall: + opam uninstall . + +$(DROMNS)dev-deps: + opam install ./opam/*.opam --deps-only --with-doc --with-test + +$(DROMNS)test: + ./scripts/before.sh test + opam exec -- dune build @runtest + ./scripts/after.sh test + +$(DROMNS)clean: + rm -rf _build + rm -f *.exe *~ + ./scripts/after.sh clean + +$(DROMNS)distclean: $(DROMNS)clean + rm -rf _opam _drom + ./scripts/after.sh distclean + + diff --git a/docs/index.html b/docs/index.html index eabcd46..a99b2d7 100644 --- a/docs/index.html +++ b/docs/index.html @@ -3,7 +3,7 @@
Authors:
Fabrice Le Fessant <fabrice.le_fessant@ocamlpro.com>