From 2370de647ca9681598b368c93c79c80a622f77b3 Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Thu, 3 Mar 2022 11:42:01 -0800 Subject: [PATCH 1/3] Add a new 'update' makefile target to make it easier to keep our arduino cores up to date when developing Kaleidoscope --- Makefile | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Makefile b/Makefile index 0daf2b81..816d61b6 100644 --- a/Makefile +++ b/Makefile @@ -44,6 +44,20 @@ $(ARDUINO_DIRECTORIES_USER)/hardware/keyboardio/avr/boards.txt: -rm -d $(ARDUINO_DIRECTORIES_USER)/hardware/keyboardio/gd32/libraries/Kaleidoscope ln -s $(KALEIDOSCOPE_DIR) $(ARDUINO_DIRECTORIES_USER)/hardware/keyboardio/gd32/libraries/Kaleidoscope +update: + # Clear out our hacked up symlinked Kaleidoscope + -rm -rf $(ARDUINO_DIRECTORIES_USER)/hardware/keyboardio/avr/libraries/Kaleidoscope + cd $(ARDUINO_DIRECTORIES_USER)/hardware/keyboardio; git pull; \ + git submodule update --init --recursive + -rm -rf $(ARDUINO_DIRECTORIES_USER)/hardware/keyboardio/avr/libraries/Kaleidoscope + ln -s $(KALEIDOSCOPE_DIR) $(ARDUINO_DIRECTORIES_USER)/hardware/keyboardio/avr/libraries/Kaleidoscope + # Clear out our hacked up Kaleidoscope + -rm -rf $(ARDUINO_DIRECTORIES_USER)/hardware/keyboardio/gd32/libraries/Kaleidoscope + cd $(ARDUINO_DIRECTORIES_USER)/hardware/keyboardio/gd32; git pull; \ + git submodule update --init --recursive + -rm -rf $(ARDUINO_DIRECTORIES_USER)/hardware/keyboardio/gd32/libraries/Kaleidoscope + ln -s $(KALEIDOSCOPE_DIR) $(ARDUINO_DIRECTORIES_USER)/hardware/keyboardio/gd32/libraries/Kaleidoscope + simulator-tests: $(MAKE) -C tests all From 7844aeed5e0e252d4e7eee1a3b33a2c88940ba7b Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Thu, 3 Mar 2022 20:25:20 -0800 Subject: [PATCH 2/3] Because of how we call arduino-cli, we no longer need to play games with not checking out the copy of Kaleidoscope inside our arduino cores --- Makefile | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/Makefile b/Makefile index 816d61b6..82ec0b93 100644 --- a/Makefile +++ b/Makefile @@ -28,35 +28,18 @@ $(ARDUINO_DIRECTORIES_USER)/hardware/keyboardio/virtual/boards.txt: $(ARDUINO_DIRECTORIES_USER)/hardware/keyboardio/avr/boards.txt: git clone -c core.symlinks=true \ - --recurse-submodules=":(exclude)avr/libraries/Kaleidoscope" \ - --recurse-submodules=":(exclude)gd32/libraries/Kaleidoscope" \ - --recurse-submodules=avr/libraries/ \ - --recurse-submodules=gd32/ \ - --recurse-submodules=gd32/libraries/ \ + --recurse-submodules \ git://github.com/keyboardio/Kaleidoscope-Bundle-Keyboardio \ $(ARDUINO_DIRECTORIES_USER)/hardware/keyboardio - -rm -d $(ARDUINO_DIRECTORIES_USER)/hardware/keyboardio/avr/libraries/Kaleidoscope - ln -s $(KALEIDOSCOPE_DIR) $(ARDUINO_DIRECTORIES_USER)/hardware/keyboardio/avr/libraries/Kaleidoscope git clone -c core.symlinks=true \ - --recurse-submodules=":(exclude)libraries/Kaleidoscope" \ - --recurse-submodules=libraries/ \ + --recurse-submodules \ git://github.com/keyboardio/ArduinoCore-GD32-Keyboardio $(ARDUINO_DIRECTORIES_USER)/hardware/keyboardio/gd32 - -rm -d $(ARDUINO_DIRECTORIES_USER)/hardware/keyboardio/gd32/libraries/Kaleidoscope - ln -s $(KALEIDOSCOPE_DIR) $(ARDUINO_DIRECTORIES_USER)/hardware/keyboardio/gd32/libraries/Kaleidoscope update: - # Clear out our hacked up symlinked Kaleidoscope - -rm -rf $(ARDUINO_DIRECTORIES_USER)/hardware/keyboardio/avr/libraries/Kaleidoscope cd $(ARDUINO_DIRECTORIES_USER)/hardware/keyboardio; git pull; \ git submodule update --init --recursive - -rm -rf $(ARDUINO_DIRECTORIES_USER)/hardware/keyboardio/avr/libraries/Kaleidoscope - ln -s $(KALEIDOSCOPE_DIR) $(ARDUINO_DIRECTORIES_USER)/hardware/keyboardio/avr/libraries/Kaleidoscope - # Clear out our hacked up Kaleidoscope - -rm -rf $(ARDUINO_DIRECTORIES_USER)/hardware/keyboardio/gd32/libraries/Kaleidoscope cd $(ARDUINO_DIRECTORIES_USER)/hardware/keyboardio/gd32; git pull; \ git submodule update --init --recursive - -rm -rf $(ARDUINO_DIRECTORIES_USER)/hardware/keyboardio/gd32/libraries/Kaleidoscope - ln -s $(KALEIDOSCOPE_DIR) $(ARDUINO_DIRECTORIES_USER)/hardware/keyboardio/gd32/libraries/Kaleidoscope simulator-tests: $(MAKE) -C tests all From 9357dcec8e0b60a8f0a61a1c0223249133a85932 Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Thu, 3 Mar 2022 20:25:51 -0800 Subject: [PATCH 3/3] Switch from installing the prepackaged kaleidoscope arduino cores just to get their dependencies to installing dummy cores that get the dependencies, but not the code. --- etc/makefiles/arduino-cli.mk | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/etc/makefiles/arduino-cli.mk b/etc/makefiles/arduino-cli.mk index 337dfa37..b6541a04 100644 --- a/etc/makefiles/arduino-cli.mk +++ b/etc/makefiles/arduino-cli.mk @@ -35,7 +35,8 @@ ARDUINO_CONTENT ?= $(KALEIDOSCOPE_DIR)/.arduino export ARDUINO_DIRECTORIES_DATA ?= $(ARDUINO_CONTENT)/data export ARDUINO_DIRECTORIES_DOWNLOADS ?= $(ARDUINO_CONTENT)/downloads export ARDUINO_CLI_CONFIG ?= $(ARDUINO_DIRECTORIES_DATA)/arduino-cli.yaml -export ARDUINO_BOARD_MANAGER_ADDITIONAL_URLS ?= https://raw.githubusercontent.com/keyboardio/boardsmanager/master/package_keyboardio_index.json +export ARDUINO_BOARD_MANAGER_ADDITIONAL_URLS ?= https://raw.githubusercontent.com/keyboardio/boardsmanager/master/devel/package_kaleidoscope_devel_index.json + # If it looks like Kaleidoscope is inside a "traditional" Arduino hardware directory # in the user's homedir, let's use that. @@ -163,9 +164,15 @@ arduino-update-cores: install-arduino-core-kaleidoscope: arduino-update-cores - $(QUIET) $(ARDUINO_CLI) core install "keyboardio:avr" - $(QUIET) $(ARDUINO_CLI) core install "keyboardio:gd32" + $(QUIET) $(ARDUINO_CLI) core install "keyboardio:avr-tools-only" + $(QUIET) $(ARDUINO_CLI) core install "keyboardio:gd32-tools-only" install-arduino-core-avr: arduino-update-cores $(QUIET) $(ARDUINO_CLI) core install "arduino:avr" + +install-arduino-core-deps: + $(QUIET) $(ARDUINO_CLI) core install "keyboardio:avr-tools-only" + $(QUIET) $(ARDUINO_CLI) core install "keyboardio:gd32-tools-only" + +