diff options
author | Zach White <skullydazed@gmail.com> | 2020-12-18 12:17:53 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-18 12:17:53 -0800 |
commit | 03cbee8637cb2de632db718db62db31c3d08ae4d (patch) | |
tree | 907ac196b226d842eb72d87cbec928ba5c4bed0e | |
parent | a9f7d4dccc9cd0351658e64d5fbc809c93ac9b46 (diff) |
Add the ability to exclude keyboards from travis builds (#11178)
* add the ability to exclude keyboards from travis builds
* add filtering to make all:
* only skip keyboards during make all:
* working implementation
* forego a CI_KEYBOARDS variable
* optimize the startup by only listing keyboards once
* add sort -u to all list_keyboard invocations
* move the if else if tree back to 1 level
-rw-r--r-- | Makefile | 36 | ||||
-rw-r--r-- | keyboards/clueboard/17/.noci | 0 | ||||
-rw-r--r-- | keyboards/clueboard/2x1800/2018/.noci | 0 | ||||
-rw-r--r-- | keyboards/clueboard/60/.noci | 0 | ||||
-rw-r--r-- | keyboards/clueboard/66/rev1/.noci | 0 | ||||
-rw-r--r-- | keyboards/clueboard/66/rev2/.noci | 0 | ||||
-rw-r--r-- | keyboards/clueboard/66_hotswap/prototype/.noci | 0 | ||||
-rw-r--r-- | keyboards/clueboard/card/.noci | 0 | ||||
-rwxr-xr-x | util/list_keyboards.sh | 10 |
9 files changed, 14 insertions, 32 deletions
@@ -99,40 +99,13 @@ $(eval $(call NEXT_PATH_ELEMENT)) # endif # endif -define GET_KEYBOARDS -ifndef ALT_GET_KEYBOARDS - All_RULES_MK := $$(patsubst $(ROOT_DIR)/keyboards/%/rules.mk,%,$$(wildcard $(ROOT_DIR)/keyboards/*/rules.mk)) - All_RULES_MK += $$(patsubst $(ROOT_DIR)/keyboards/%/rules.mk,%,$$(wildcard $(ROOT_DIR)/keyboards/*/*/rules.mk)) - All_RULES_MK += $$(patsubst $(ROOT_DIR)/keyboards/%/rules.mk,%,$$(wildcard $(ROOT_DIR)/keyboards/*/*/*/rules.mk)) - All_RULES_MK += $$(patsubst $(ROOT_DIR)/keyboards/%/rules.mk,%,$$(wildcard $(ROOT_DIR)/keyboards/*/*/*/*/rules.mk)) - - KEYMAPS_MK := $$(patsubst $(ROOT_DIR)/keyboards/%/rules.mk,%,$$(wildcard $(ROOT_DIR)/keyboards/*/keymaps/*/rules.mk)) - KEYMAPS_MK += $$(patsubst $(ROOT_DIR)/keyboards/%/rules.mk,%,$$(wildcard $(ROOT_DIR)/keyboards/*/*/keymaps/*/rules.mk)) - KEYMAPS_MK += $$(patsubst $(ROOT_DIR)/keyboards/%/rules.mk,%,$$(wildcard $(ROOT_DIR)/keyboards/*/*/*/keymaps/*/rules.mk)) - KEYMAPS_MK += $$(patsubst $(ROOT_DIR)/keyboards/%/rules.mk,%,$$(wildcard $(ROOT_DIR)/keyboards/*/*/*/*/keymaps/*/rules.mk)) - - KEYBOARDS := $$(sort $$(filter-out $$(KEYMAPS_MK), $$(All_RULES_MK))) -else - KEYBOARDS := $(shell find keyboards/ -type f -iname "rules.mk" | grep -v keymaps | sed 's!keyboards/\(.*\)/rules.mk!\1!' | sort | uniq) -endif -endef - -$(eval $(call GET_KEYBOARDS)) - -# Only consider folders with makefiles, to prevent errors in case there are extra folders -#KEYBOARDS += $(patsubst $(ROOD_DIR)/keyboards/%/rules.mk,%,$(wildcard $(ROOT_DIR)/keyboards/*/*/rules.mk)) - .PHONY: list-keyboards list-keyboards: - echo $(KEYBOARDS) - -define PRINT_KEYBOARD - $(info $(PRINTING_KEYBOARD)) -endef + util/list_keyboards.sh | sort -u | tr '\n' ' ' .PHONY: generate-keyboards-file generate-keyboards-file: - $(foreach PRINTING_KEYBOARD,$(KEYBOARDS),$(eval $(call PRINT_KEYBOARD))) + util/list_keyboards.sh | sort -u .PHONY: clean clean: @@ -159,7 +132,6 @@ endif # $(info Keyboard: $(KEYBOARD)) # $(info Keymap: $(KEYMAP)) # $(info Subproject: $(SUBPROJECT)) -# $(info Keyboards: $(KEYBOARDS)) # Set the default goal depending on where we are running make from @@ -294,7 +266,7 @@ define PARSE_RULE $$(eval $$(call PARSE_TEST)) # If the rule starts with the name of a known keyboard, then continue # the parsing from PARSE_KEYBOARD - else ifeq ($$(call TRY_TO_MATCH_RULE_FROM_LIST,$$(KEYBOARDS)),true) + else ifeq ($$(call TRY_TO_MATCH_RULE_FROM_LIST,$$(shell util/list_keyboards.sh | sort -u)),true) KEYBOARD_RULE=$$(MATCHED_ITEM) $$(eval $$(call PARSE_KEYBOARD,$$(MATCHED_ITEM))) # Otherwise use the KEYBOARD variable, which is determined either by @@ -411,7 +383,7 @@ endef # if we are going to compile all keyboards, match the rest of the rule # for each of them define PARSE_ALL_KEYBOARDS - $$(eval $$(call PARSE_ALL_IN_LIST,PARSE_KEYBOARD,$(KEYBOARDS))) + $$(eval $$(call PARSE_ALL_IN_LIST,PARSE_KEYBOARD,$(shell util/list_keyboards.sh noci | sort -u))) endef # $1 Subproject diff --git a/keyboards/clueboard/17/.noci b/keyboards/clueboard/17/.noci new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/keyboards/clueboard/17/.noci diff --git a/keyboards/clueboard/2x1800/2018/.noci b/keyboards/clueboard/2x1800/2018/.noci new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/keyboards/clueboard/2x1800/2018/.noci diff --git a/keyboards/clueboard/60/.noci b/keyboards/clueboard/60/.noci new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/keyboards/clueboard/60/.noci diff --git a/keyboards/clueboard/66/rev1/.noci b/keyboards/clueboard/66/rev1/.noci new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/keyboards/clueboard/66/rev1/.noci diff --git a/keyboards/clueboard/66/rev2/.noci b/keyboards/clueboard/66/rev2/.noci new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/keyboards/clueboard/66/rev2/.noci diff --git a/keyboards/clueboard/66_hotswap/prototype/.noci b/keyboards/clueboard/66_hotswap/prototype/.noci new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/keyboards/clueboard/66_hotswap/prototype/.noci diff --git a/keyboards/clueboard/card/.noci b/keyboards/clueboard/card/.noci new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/keyboards/clueboard/card/.noci diff --git a/util/list_keyboards.sh b/util/list_keyboards.sh new file mode 100755 index 0000000000..672d4a7843 --- /dev/null +++ b/util/list_keyboards.sh @@ -0,0 +1,10 @@ +#!/bin/sh +# Temporary shell script to find keyboards +# +# This allows us to exclude keyboards by including a .noci file. + +find keyboards -type f -name rules.mk | grep -v keymaps | while read keyboard; do + keyboard=$(echo $keyboard | sed 's!keyboards/\(.*\)/rules.mk!\1!') + + [ "$1" = "noci" -a -e "keyboards/${keyboard}/.noci" ] || echo "$keyboard" +done |