diff --git a/Makefile b/Makefile index 0bad223..6cce3dd 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,7 @@ .DEFAULT_GOAL := all JSONSCHEMA ?= jsonschema +JQ ?= jq SHELLCHECK ?= shellcheck TAR ?= tar ZIP ?= zip @@ -13,9 +14,6 @@ RMRF ?= rm -rf SCHEMAS = $(shell find schemas/ -type f -name '*.json') TESTS = $(shell find test/ -type f -name '*.json') -# TODO: Add a version property to `jsonschema.json` -VERSION = $(shell tr -d '\n\r' < VERSION) - include generated.mk # TODO: Make `jsonschema fmt` automatically detect test files @@ -46,6 +44,7 @@ test: # TODO: Add a `jsonschema pkg` command instead .PHONY: dist +VERSION = $(shell $(JQ) --raw-output '.["x-version"]' jsonschema.json) dist: $(RMRF) $@ $(MKDIRP) $@ diff --git a/VERSION b/VERSION deleted file mode 100644 index 0ea3a94..0000000 --- a/VERSION +++ /dev/null @@ -1 +0,0 @@ -0.2.0 diff --git a/generated.mk b/generated.mk index 61d8ced..f0310ea 100644 --- a/generated.mk +++ b/generated.mk @@ -1,5 +1,4 @@ PYTHON ?= python3 -JQ ?= jq define MAKE_SCHEMA schemas/$1.json: templates/schemas/$1.jq $2.json diff --git a/jsonschema.json b/jsonschema.json index 3a42024..30dd477 100644 --- a/jsonschema.json +++ b/jsonschema.json @@ -3,5 +3,6 @@ "description": "A growing collection of hand-crafted high-quality schemas by Sourcemeta", "email": "hello@sourcemeta.com", "github": "sourcemeta/std", - "path": "./schemas" + "path": "./schemas", + "x-version": "0.2.0" }