Skip to content

Commit

Permalink
Fix issues with recent keymap.json changes (qmk#14089)
Browse files Browse the repository at this point in the history
* Fix issues with recent keymap.json changes

* Allow empty author string
  • Loading branch information
zvecr authored Aug 20, 2021
1 parent 0741aae commit b229b0f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
18 changes: 9 additions & 9 deletions build_keyboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -148,24 +148,24 @@ endif

# Have we found a keymap.json?
ifneq ("$(wildcard $(KEYMAP_JSON))", "")
KEYMAP_C := $(KEYMAP_OUTPUT)/keymap.c
KEYMAP_H := $(KEYMAP_OUTPUT)/config.h
KEYMAP_C := $(KEYMAP_OUTPUT)/src/keymap.c
KEYMAP_H := $(KEYMAP_OUTPUT)/src/config.h

# Load the keymap-level rules.mk if exists
-include $(KEYMAP_PATH)/rules.mk

# Load any rules.mk content from keymap.json
INFO_RULES_MK = $(shell (QMK_BIN) generate-rules-mk --quiet --escape --keyboard $(KEYBOARD) --keymap $(KEYMAP) --output $(KEYMAP_OUTPUT)/rules.mk)
INFO_RULES_MK = $(shell $(QMK_BIN) generate-rules-mk --quiet --escape --keyboard $(KEYBOARD) --keymap $(KEYMAP) --output $(KEYMAP_OUTPUT)/src/rules.mk)
include $(INFO_RULES_MK)

# Add rules to enerate the keymap files - indentation here is important
$(KEYMAP_OUTPUT)/keymap.c: $(KEYMAP_JSON)
(QMK_BIN) json2c --quiet --output $(KEYMAP_C) $(KEYMAP_JSON)
# Add rules to generate the keymap files - indentation here is important
$(KEYMAP_OUTPUT)/src/keymap.c: $(KEYMAP_JSON)
$(QMK_BIN) json2c --quiet --output $(KEYMAP_C) $(KEYMAP_JSON)

$(KEYMAP_OUTPUT)/config.h: $(KEYMAP_JSON)
(QMK_BIN) generate-config-h --quiet --keyboard $(KEYBOARD) --keymap $(KEYMAP) --output $(KEYMAP_OUTPUT)/config.h
$(KEYMAP_OUTPUT)/src/config.h: $(KEYMAP_JSON)
$(QMK_BIN) generate-config-h --quiet --keyboard $(KEYBOARD) --keymap $(KEYMAP) --output $(KEYMAP_H)

generated-files: $(KEYMAP_OUTPUT)/config.h $(KEYMAP_OUTPUT)/keymap.c
generated-files: $(KEYMAP_OUTPUT)/src/config.h $(KEYMAP_OUTPUT)/src/keymap.c

endif

Expand Down
2 changes: 1 addition & 1 deletion data/schemas/keymap.jsonschema
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"title": "Keymap Information",
"type": "object",
"properties": {
"author": {"$ref": "qmk.definitions.v1#/text_identifier"},
"author": {"type": "string"},
"keyboard": {"$ref": "qmk.definitions.v1#/text_identifier"},
"keymap": {"$ref": "qmk.definitions.v1#/text_identifier"},
"layout": {"$ref": "qmk.definitions.v1#/layout_macro"},
Expand Down

0 comments on commit b229b0f

Please sign in to comment.