Skip to content

Commit e7e8af3

Browse files
make build in correct order for schema inclusion.
1 parent b6e6e5e commit e7e8af3

File tree

1 file changed

+19
-4
lines changed

1 file changed

+19
-4
lines changed

docs/Makefile

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
BASE_URL ?= "/"
22
VERSION ?= ""
3+
SCHEMA_PATTERN = *.schema.json
4+
SCHEMA_INPUT_DIR = ../schemas
5+
BASE_OUTPUT_DIR = _site
6+
SCHEMA_OUTPUT_DIR = $(BASE_OUTPUT_DIR)/schemas
37
SHELL = /bin/bash
48

59
default: install
@@ -19,15 +23,26 @@ define baseurlparam =
1923
$(if $(BASE_URL),-- --baseurl $(BASE_URL),-- --baseurl "")
2024
endef
2125

22-
build: version build-schemas
26+
build: build-docs build-schemas show-build-output
27+
28+
build-docs: version
2329
npm run build $(baseurlparam)
2430

2531
build-schemas: clean-schemas
26-
mkdir -p _site/schemas
27-
find ../schemas -name "*.schema.json" -exec cp {} _site/schemas/ \;
32+
mkdir -p $(SCHEMA_OUTPUT_DIR)
33+
@echo "Finding schema files..."
34+
@find $(SCHEMA_INPUT_DIR) -name "$(SCHEMA_PATTERN)" -print
35+
@echo "Copying schema files..."
36+
rsync -av --include="*/" --include="$(SCHEMA_PATTERN)" --exclude="*" $(SCHEMA_INPUT_DIR)/ $(SCHEMA_OUTPUT_DIR)/
37+
@echo "Output in $(SCHEMA_OUTPUT_DIR):"
38+
@find $(SCHEMA_OUTPUT_DIR) -type f -name "*" | sort
39+
40+
show-build-output:
41+
@echo "Build output in $(BASE_OUTPUT_DIR):"
42+
@find $(BASE_OUTPUT_DIR) -type f -name "*" | sort
2843

2944
clean-schemas:
30-
rm -rf _site/schemas
45+
rm -rf $(SCHEMA_OUTPUT_DIR)
3146

3247
debug: version
3348
npm run debug

0 commit comments

Comments
 (0)