-
Notifications
You must be signed in to change notification settings - Fork 1
/
project.Makefile
27 lines (20 loc) · 1.46 KB
/
project.Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
## Add your own custom Makefile targets here
SCHEMA_EXAMPLEDIR = src/data/examples
VALID_EXAMPLEDIR = $(SCHEMA_EXAMPLEDIR)/valid
INVALID_EXAMPLEDIR = $(SCHEMA_EXAMPLEDIR)/invalid
SCHEMA_CLASSES = $(shell $(RUN) yq -cr '.classes | keys | join(" ")' $(SOURCE_SCHEMA_PATH))
IMPORTS = standards-schema standards-organization-schema
all: update-imports site
update-imports: $(IMPORTS)
standards-schema:
curl -s https://raw.githubusercontent.com/bridge2ai/standards-schemas/main/src/standards_schemas/schema/standards_schema.yaml \
-o $(SOURCE_SCHEMA_DIR)standards_schema.yaml -z $(SOURCE_SCHEMA_DIR)standards_schema_yaml
standards-organization-schema:
curl -s https://raw.githubusercontent.com/bridge2ai/standards-schemas/main/src/standards_schemas/schema/standards_organization_schema.yaml \
-o $(SOURCE_SCHEMA_DIR)standards_organization_schema.yaml -z $(SOURCE_SCHEMA_DIR)standards_organization_schema.yaml
# Generate minimal example files for all classes
# For each file in the list, populate it with an id field
gen-minimal-examples:
printf "# Example data file\n---\nid: \"data_sheets_schema:123\"\n" | tee -a $(patsubst %, $(VALID_EXAMPLEDIR)/%-minimal.yaml, $(SCHEMA_CLASSES))
printf "# Example data file - needs more contents\n---\nid: \"data_sheets_schema:123\"\n" | tee -a $(patsubst %, $(VALID_EXAMPLEDIR)/%-valid.yaml, $(SCHEMA_CLASSES))
printf "# Example invalid data file\n---\nid: 123\n" | tee -a $(patsubst %, $(INVALID_EXAMPLEDIR)/%-invalid.yaml, $(SCHEMA_CLASSES))