Skip to content

Commit

Permalink
[nix] add formatHook into elaborator env
Browse files Browse the repository at this point in the history
Signed-off-by: Avimitin <[email protected]>
  • Loading branch information
Avimitin committed Oct 15, 2024
1 parent afbd280 commit ab525ae
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
6 changes: 1 addition & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,7 @@ clean:

.PHONY: reformat
reformat:
mill -i _.reformat

.PHONY: checkformat
checkformat:
mill -i _.checkFormat
nix develop ".#t1.elaborator" -c bash -c 'eval "$$formatHook"'

.PHONY: list-configs
list-configs:
Expand Down
12 changes: 12 additions & 0 deletions nix/t1/mill-modules.nix
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,18 @@ let
CIRCT_INSTALL_PATH = circt-full;
JEXTRACT_INSTALL_PATH = jextract-21;
JAVA_TOOL_OPTIONS = "--enable-preview";
formatHook = ''
targets=( $(mill -i resolve _.reformat) )
localTargets=()
for t in ''${targets[@]}; do
if ! mill -i show "''${t//reformat/sources}" | grep -q dependencies; then
localTargets+=($t)
fi
done
for t in ''${localTargets[@]}; do
mill -i "$t"
done
'';
};

outputs = [ "out" "omreader" "elaborator" "t1package" ];
Expand Down

0 comments on commit ab525ae

Please sign in to comment.