From a9cdf690100cbc1037930f2487d3878c91c533f7 Mon Sep 17 00:00:00 2001 From: Josh Berdine Date: Wed, 17 Oct 2018 02:24:02 -0700 Subject: [PATCH] [sledge] Use dune ocamlformat integration for `make fmt` Summary: Dune now includes support for ocamlformat, so use it to format in parallel. Reviewed By: mbouaziz Differential Revision: D10389485 fbshipit-source-id: cb1dfbe38 --- sledge/Makefile | 8 ++++---- sledge/dune | 1 + sledge/dune-project | 1 + sledge/sledge.opam | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) create mode 100644 sledge/dune diff --git a/sledge/Makefile b/sledge/Makefile index 687dbd162..cf0cb0f9b 100644 --- a/sledge/Makefile +++ b/sledge/Makefile @@ -3,12 +3,11 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -OCAMLFORMAT?=ocamlformat - .PHONY: default default: dev -DUNES=$(patsubst %.in,%,$(shell find src -name dune.in)) +DUNEINS=$(shell find src -name dune.in) +DUNES=$(patsubst %.in,%,$(DUNEINS)) .PHONY: dunes dunes: $(DUNES) @@ -59,7 +58,8 @@ clean: .PHONY: fmt fmt: - $(OCAMLFORMAT) -i $(shell find src -name '*.ml' -or -name '*.mli') src/version.ml.in + dune build @_build/dev/src/fmt --auto-promote + ocamlformat -i src/version.ml.in $(DUNEINS) clang-format -i model/llair_intrinsics.h model/cxxabi.cpp # print any variable for Makefile debugging diff --git a/sledge/dune b/sledge/dune new file mode 100644 index 000000000..da639ce8d --- /dev/null +++ b/sledge/dune @@ -0,0 +1 @@ +(ignored_subdirs (llvm test)) diff --git a/sledge/dune-project b/sledge/dune-project index de4fc2092..1c220e4d0 100644 --- a/sledge/dune-project +++ b/sledge/dune-project @@ -1 +1,2 @@ (lang dune 1.0) +(using fmt 1.0) diff --git a/sledge/sledge.opam b/sledge/sledge.opam index 069d452c7..5648dd1b5 100644 --- a/sledge/sledge.opam +++ b/sledge/sledge.opam @@ -12,7 +12,7 @@ depends: [ "core_kernel" {>= "v0.11.0"} "ctypes" "ctypes-foreign" - "dune" {build} + "dune" {build >= "1.4.0"} "llvm" {build & = "7.0.0"} "ppx_compare" {>= "v0.11.0"} "ppx_hash" {>= "v0.11.0"}