From 50a6f5e1b1a635fa16c69dc4aeac79da5c77709c Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Mon, 19 Nov 2018 22:14:53 -0800 Subject: [PATCH 1/2] Reorganize our examples directory to try to make it easier to work with Signed-off-by: Jesse Vincent --- examples/{ => Devices}/Atreus/.kaleidoscope-builder.conf | 0 examples/{ => Devices}/Atreus/Atreus.ino | 0 examples/{ => Devices}/Atreus/Makefile | 0 examples/{ => Devices}/ErgoDox/.kaleidoscope-builder.conf | 0 examples/{ => Devices}/ErgoDox/ErgoDox.ino | 0 examples/{ => Devices/Keyboardio}/Kaleidoscope/Kaleidoscope.ino | 0 examples/{ => Devices}/Planck/.kaleidoscope-builder.conf | 0 examples/{ => Devices}/Planck/Makefile | 0 examples/{ => Devices}/Planck/Planck.ino | 0 examples/{ => Features}/AppSwitcher/AppSwitcher.ino | 0 examples/{ => Features}/AppSwitcher/Macros.cpp | 0 examples/{ => Features}/AppSwitcher/Macros.h | 0 examples/{ => Features}/CycleTimeReport/CycleTimeReport.ino | 0 .../EEPROM}/EEPROM-Keymap-Programmer/EEPROM-Keymap-Programmer.ino | 0 examples/{ => Features/EEPROM}/EEPROM-Keymap/EEPROM-Keymap.ino | 0 .../{ => Features/EEPROM}/EEPROM-Settings/EEPROM-Settings.ino | 0 examples/{ => Features}/FocusSerial/FocusSerial.ino | 0 examples/{ => Features}/HostOS/HostOS.ino | 0 .../{ => Features}/HostPowerManagement/HostPowerManagement.ino | 0 examples/{ => Features}/Steno/Steno.ino | 0 examples/{ => Features}/TypingBreaks/TypingBreaks.ino | 0 examples/{ => Keystrokes}/Cycle/Cycle.ino | 0 examples/{ => Keystrokes}/Escape-OneShot/Escape-OneShot.ino | 0 examples/{ => Keystrokes}/Leader/Leader.ino | 0 examples/{ => Keystrokes}/MagicCombo/MagicCombo.ino | 0 examples/{ => Keystrokes}/OneShot/OneShot.ino | 0 examples/{ => Keystrokes}/Qukeys/Qukeys.ino | 0 examples/{ => Keystrokes}/Redial/Redial.ino | 0 examples/{ => Keystrokes}/ShapeShifter/ShapeShifter.ino | 0 examples/{ => Keystrokes}/SpaceCadet/SpaceCadet.ino | 0 examples/{ => Keystrokes}/Syster/Syster.ino | 0 examples/{ => Keystrokes}/TapDance/TapDance.ino | 0 examples/{ => Keystrokes}/TopsyTurvy/TopsyTurvy.ino | 0 examples/{ => Keystrokes}/Unicode/Unicode.ino | 0 examples/{ => LEDs}/Colormap/Colormap.ino | 0 examples/{ => LEDs}/FingerPainter/FingerPainter.ino | 0 examples/{ => LEDs}/GhostInTheFirmware/GhostInTheFirmware.ino | 0 examples/{ => LEDs}/Heatmap/Heatmap.ino | 0 examples/{ => LEDs}/IdleLEDs/IdleLEDs.ino | 0 examples/{ => LEDs}/LED-ActiveModColor/LED-ActiveModColor.ino | 0 examples/{ => LEDs}/LED-AlphaSquare/LED-AlphaSquare.ino | 0 examples/{ => LEDs}/LED-Palette-Theme/LED-Palette-Theme.ino | 0 examples/{ => LEDs}/LED-Stalker/LED-Stalker.ino | 0 .../{ => LEDs}/LEDEffect-BootGreeting/LEDEffect-BootGreeting.ino | 0 examples/{ => LEDs}/LEDEffects/LEDEffects.ino | 0 45 files changed, 0 insertions(+), 0 deletions(-) rename examples/{ => Devices}/Atreus/.kaleidoscope-builder.conf (100%) rename examples/{ => Devices}/Atreus/Atreus.ino (100%) rename examples/{ => Devices}/Atreus/Makefile (100%) rename examples/{ => Devices}/ErgoDox/.kaleidoscope-builder.conf (100%) rename examples/{ => Devices}/ErgoDox/ErgoDox.ino (100%) rename examples/{ => Devices/Keyboardio}/Kaleidoscope/Kaleidoscope.ino (100%) rename examples/{ => Devices}/Planck/.kaleidoscope-builder.conf (100%) rename examples/{ => Devices}/Planck/Makefile (100%) rename examples/{ => Devices}/Planck/Planck.ino (100%) rename examples/{ => Features}/AppSwitcher/AppSwitcher.ino (100%) rename examples/{ => Features}/AppSwitcher/Macros.cpp (100%) rename examples/{ => Features}/AppSwitcher/Macros.h (100%) rename examples/{ => Features}/CycleTimeReport/CycleTimeReport.ino (100%) rename examples/{ => Features/EEPROM}/EEPROM-Keymap-Programmer/EEPROM-Keymap-Programmer.ino (100%) rename examples/{ => Features/EEPROM}/EEPROM-Keymap/EEPROM-Keymap.ino (100%) rename examples/{ => Features/EEPROM}/EEPROM-Settings/EEPROM-Settings.ino (100%) rename examples/{ => Features}/FocusSerial/FocusSerial.ino (100%) rename examples/{ => Features}/HostOS/HostOS.ino (100%) rename examples/{ => Features}/HostPowerManagement/HostPowerManagement.ino (100%) rename examples/{ => Features}/Steno/Steno.ino (100%) rename examples/{ => Features}/TypingBreaks/TypingBreaks.ino (100%) rename examples/{ => Keystrokes}/Cycle/Cycle.ino (100%) rename examples/{ => Keystrokes}/Escape-OneShot/Escape-OneShot.ino (100%) rename examples/{ => Keystrokes}/Leader/Leader.ino (100%) rename examples/{ => Keystrokes}/MagicCombo/MagicCombo.ino (100%) rename examples/{ => Keystrokes}/OneShot/OneShot.ino (100%) rename examples/{ => Keystrokes}/Qukeys/Qukeys.ino (100%) rename examples/{ => Keystrokes}/Redial/Redial.ino (100%) rename examples/{ => Keystrokes}/ShapeShifter/ShapeShifter.ino (100%) rename examples/{ => Keystrokes}/SpaceCadet/SpaceCadet.ino (100%) rename examples/{ => Keystrokes}/Syster/Syster.ino (100%) rename examples/{ => Keystrokes}/TapDance/TapDance.ino (100%) rename examples/{ => Keystrokes}/TopsyTurvy/TopsyTurvy.ino (100%) rename examples/{ => Keystrokes}/Unicode/Unicode.ino (100%) rename examples/{ => LEDs}/Colormap/Colormap.ino (100%) rename examples/{ => LEDs}/FingerPainter/FingerPainter.ino (100%) rename examples/{ => LEDs}/GhostInTheFirmware/GhostInTheFirmware.ino (100%) rename examples/{ => LEDs}/Heatmap/Heatmap.ino (100%) rename examples/{ => LEDs}/IdleLEDs/IdleLEDs.ino (100%) rename examples/{ => LEDs}/LED-ActiveModColor/LED-ActiveModColor.ino (100%) rename examples/{ => LEDs}/LED-AlphaSquare/LED-AlphaSquare.ino (100%) rename examples/{ => LEDs}/LED-Palette-Theme/LED-Palette-Theme.ino (100%) rename examples/{ => LEDs}/LED-Stalker/LED-Stalker.ino (100%) rename examples/{ => LEDs}/LEDEffect-BootGreeting/LEDEffect-BootGreeting.ino (100%) rename examples/{ => LEDs}/LEDEffects/LEDEffects.ino (100%) diff --git a/examples/Atreus/.kaleidoscope-builder.conf b/examples/Devices/Atreus/.kaleidoscope-builder.conf similarity index 100% rename from examples/Atreus/.kaleidoscope-builder.conf rename to examples/Devices/Atreus/.kaleidoscope-builder.conf diff --git a/examples/Atreus/Atreus.ino b/examples/Devices/Atreus/Atreus.ino similarity index 100% rename from examples/Atreus/Atreus.ino rename to examples/Devices/Atreus/Atreus.ino diff --git a/examples/Atreus/Makefile b/examples/Devices/Atreus/Makefile similarity index 100% rename from examples/Atreus/Makefile rename to examples/Devices/Atreus/Makefile diff --git a/examples/ErgoDox/.kaleidoscope-builder.conf b/examples/Devices/ErgoDox/.kaleidoscope-builder.conf similarity index 100% rename from examples/ErgoDox/.kaleidoscope-builder.conf rename to examples/Devices/ErgoDox/.kaleidoscope-builder.conf diff --git a/examples/ErgoDox/ErgoDox.ino b/examples/Devices/ErgoDox/ErgoDox.ino similarity index 100% rename from examples/ErgoDox/ErgoDox.ino rename to examples/Devices/ErgoDox/ErgoDox.ino diff --git a/examples/Kaleidoscope/Kaleidoscope.ino b/examples/Devices/Keyboardio/Kaleidoscope/Kaleidoscope.ino similarity index 100% rename from examples/Kaleidoscope/Kaleidoscope.ino rename to examples/Devices/Keyboardio/Kaleidoscope/Kaleidoscope.ino diff --git a/examples/Planck/.kaleidoscope-builder.conf b/examples/Devices/Planck/.kaleidoscope-builder.conf similarity index 100% rename from examples/Planck/.kaleidoscope-builder.conf rename to examples/Devices/Planck/.kaleidoscope-builder.conf diff --git a/examples/Planck/Makefile b/examples/Devices/Planck/Makefile similarity index 100% rename from examples/Planck/Makefile rename to examples/Devices/Planck/Makefile diff --git a/examples/Planck/Planck.ino b/examples/Devices/Planck/Planck.ino similarity index 100% rename from examples/Planck/Planck.ino rename to examples/Devices/Planck/Planck.ino diff --git a/examples/AppSwitcher/AppSwitcher.ino b/examples/Features/AppSwitcher/AppSwitcher.ino similarity index 100% rename from examples/AppSwitcher/AppSwitcher.ino rename to examples/Features/AppSwitcher/AppSwitcher.ino diff --git a/examples/AppSwitcher/Macros.cpp b/examples/Features/AppSwitcher/Macros.cpp similarity index 100% rename from examples/AppSwitcher/Macros.cpp rename to examples/Features/AppSwitcher/Macros.cpp diff --git a/examples/AppSwitcher/Macros.h b/examples/Features/AppSwitcher/Macros.h similarity index 100% rename from examples/AppSwitcher/Macros.h rename to examples/Features/AppSwitcher/Macros.h diff --git a/examples/CycleTimeReport/CycleTimeReport.ino b/examples/Features/CycleTimeReport/CycleTimeReport.ino similarity index 100% rename from examples/CycleTimeReport/CycleTimeReport.ino rename to examples/Features/CycleTimeReport/CycleTimeReport.ino diff --git a/examples/EEPROM-Keymap-Programmer/EEPROM-Keymap-Programmer.ino b/examples/Features/EEPROM/EEPROM-Keymap-Programmer/EEPROM-Keymap-Programmer.ino similarity index 100% rename from examples/EEPROM-Keymap-Programmer/EEPROM-Keymap-Programmer.ino rename to examples/Features/EEPROM/EEPROM-Keymap-Programmer/EEPROM-Keymap-Programmer.ino diff --git a/examples/EEPROM-Keymap/EEPROM-Keymap.ino b/examples/Features/EEPROM/EEPROM-Keymap/EEPROM-Keymap.ino similarity index 100% rename from examples/EEPROM-Keymap/EEPROM-Keymap.ino rename to examples/Features/EEPROM/EEPROM-Keymap/EEPROM-Keymap.ino diff --git a/examples/EEPROM-Settings/EEPROM-Settings.ino b/examples/Features/EEPROM/EEPROM-Settings/EEPROM-Settings.ino similarity index 100% rename from examples/EEPROM-Settings/EEPROM-Settings.ino rename to examples/Features/EEPROM/EEPROM-Settings/EEPROM-Settings.ino diff --git a/examples/FocusSerial/FocusSerial.ino b/examples/Features/FocusSerial/FocusSerial.ino similarity index 100% rename from examples/FocusSerial/FocusSerial.ino rename to examples/Features/FocusSerial/FocusSerial.ino diff --git a/examples/HostOS/HostOS.ino b/examples/Features/HostOS/HostOS.ino similarity index 100% rename from examples/HostOS/HostOS.ino rename to examples/Features/HostOS/HostOS.ino diff --git a/examples/HostPowerManagement/HostPowerManagement.ino b/examples/Features/HostPowerManagement/HostPowerManagement.ino similarity index 100% rename from examples/HostPowerManagement/HostPowerManagement.ino rename to examples/Features/HostPowerManagement/HostPowerManagement.ino diff --git a/examples/Steno/Steno.ino b/examples/Features/Steno/Steno.ino similarity index 100% rename from examples/Steno/Steno.ino rename to examples/Features/Steno/Steno.ino diff --git a/examples/TypingBreaks/TypingBreaks.ino b/examples/Features/TypingBreaks/TypingBreaks.ino similarity index 100% rename from examples/TypingBreaks/TypingBreaks.ino rename to examples/Features/TypingBreaks/TypingBreaks.ino diff --git a/examples/Cycle/Cycle.ino b/examples/Keystrokes/Cycle/Cycle.ino similarity index 100% rename from examples/Cycle/Cycle.ino rename to examples/Keystrokes/Cycle/Cycle.ino diff --git a/examples/Escape-OneShot/Escape-OneShot.ino b/examples/Keystrokes/Escape-OneShot/Escape-OneShot.ino similarity index 100% rename from examples/Escape-OneShot/Escape-OneShot.ino rename to examples/Keystrokes/Escape-OneShot/Escape-OneShot.ino diff --git a/examples/Leader/Leader.ino b/examples/Keystrokes/Leader/Leader.ino similarity index 100% rename from examples/Leader/Leader.ino rename to examples/Keystrokes/Leader/Leader.ino diff --git a/examples/MagicCombo/MagicCombo.ino b/examples/Keystrokes/MagicCombo/MagicCombo.ino similarity index 100% rename from examples/MagicCombo/MagicCombo.ino rename to examples/Keystrokes/MagicCombo/MagicCombo.ino diff --git a/examples/OneShot/OneShot.ino b/examples/Keystrokes/OneShot/OneShot.ino similarity index 100% rename from examples/OneShot/OneShot.ino rename to examples/Keystrokes/OneShot/OneShot.ino diff --git a/examples/Qukeys/Qukeys.ino b/examples/Keystrokes/Qukeys/Qukeys.ino similarity index 100% rename from examples/Qukeys/Qukeys.ino rename to examples/Keystrokes/Qukeys/Qukeys.ino diff --git a/examples/Redial/Redial.ino b/examples/Keystrokes/Redial/Redial.ino similarity index 100% rename from examples/Redial/Redial.ino rename to examples/Keystrokes/Redial/Redial.ino diff --git a/examples/ShapeShifter/ShapeShifter.ino b/examples/Keystrokes/ShapeShifter/ShapeShifter.ino similarity index 100% rename from examples/ShapeShifter/ShapeShifter.ino rename to examples/Keystrokes/ShapeShifter/ShapeShifter.ino diff --git a/examples/SpaceCadet/SpaceCadet.ino b/examples/Keystrokes/SpaceCadet/SpaceCadet.ino similarity index 100% rename from examples/SpaceCadet/SpaceCadet.ino rename to examples/Keystrokes/SpaceCadet/SpaceCadet.ino diff --git a/examples/Syster/Syster.ino b/examples/Keystrokes/Syster/Syster.ino similarity index 100% rename from examples/Syster/Syster.ino rename to examples/Keystrokes/Syster/Syster.ino diff --git a/examples/TapDance/TapDance.ino b/examples/Keystrokes/TapDance/TapDance.ino similarity index 100% rename from examples/TapDance/TapDance.ino rename to examples/Keystrokes/TapDance/TapDance.ino diff --git a/examples/TopsyTurvy/TopsyTurvy.ino b/examples/Keystrokes/TopsyTurvy/TopsyTurvy.ino similarity index 100% rename from examples/TopsyTurvy/TopsyTurvy.ino rename to examples/Keystrokes/TopsyTurvy/TopsyTurvy.ino diff --git a/examples/Unicode/Unicode.ino b/examples/Keystrokes/Unicode/Unicode.ino similarity index 100% rename from examples/Unicode/Unicode.ino rename to examples/Keystrokes/Unicode/Unicode.ino diff --git a/examples/Colormap/Colormap.ino b/examples/LEDs/Colormap/Colormap.ino similarity index 100% rename from examples/Colormap/Colormap.ino rename to examples/LEDs/Colormap/Colormap.ino diff --git a/examples/FingerPainter/FingerPainter.ino b/examples/LEDs/FingerPainter/FingerPainter.ino similarity index 100% rename from examples/FingerPainter/FingerPainter.ino rename to examples/LEDs/FingerPainter/FingerPainter.ino diff --git a/examples/GhostInTheFirmware/GhostInTheFirmware.ino b/examples/LEDs/GhostInTheFirmware/GhostInTheFirmware.ino similarity index 100% rename from examples/GhostInTheFirmware/GhostInTheFirmware.ino rename to examples/LEDs/GhostInTheFirmware/GhostInTheFirmware.ino diff --git a/examples/Heatmap/Heatmap.ino b/examples/LEDs/Heatmap/Heatmap.ino similarity index 100% rename from examples/Heatmap/Heatmap.ino rename to examples/LEDs/Heatmap/Heatmap.ino diff --git a/examples/IdleLEDs/IdleLEDs.ino b/examples/LEDs/IdleLEDs/IdleLEDs.ino similarity index 100% rename from examples/IdleLEDs/IdleLEDs.ino rename to examples/LEDs/IdleLEDs/IdleLEDs.ino diff --git a/examples/LED-ActiveModColor/LED-ActiveModColor.ino b/examples/LEDs/LED-ActiveModColor/LED-ActiveModColor.ino similarity index 100% rename from examples/LED-ActiveModColor/LED-ActiveModColor.ino rename to examples/LEDs/LED-ActiveModColor/LED-ActiveModColor.ino diff --git a/examples/LED-AlphaSquare/LED-AlphaSquare.ino b/examples/LEDs/LED-AlphaSquare/LED-AlphaSquare.ino similarity index 100% rename from examples/LED-AlphaSquare/LED-AlphaSquare.ino rename to examples/LEDs/LED-AlphaSquare/LED-AlphaSquare.ino diff --git a/examples/LED-Palette-Theme/LED-Palette-Theme.ino b/examples/LEDs/LED-Palette-Theme/LED-Palette-Theme.ino similarity index 100% rename from examples/LED-Palette-Theme/LED-Palette-Theme.ino rename to examples/LEDs/LED-Palette-Theme/LED-Palette-Theme.ino diff --git a/examples/LED-Stalker/LED-Stalker.ino b/examples/LEDs/LED-Stalker/LED-Stalker.ino similarity index 100% rename from examples/LED-Stalker/LED-Stalker.ino rename to examples/LEDs/LED-Stalker/LED-Stalker.ino diff --git a/examples/LEDEffect-BootGreeting/LEDEffect-BootGreeting.ino b/examples/LEDs/LEDEffect-BootGreeting/LEDEffect-BootGreeting.ino similarity index 100% rename from examples/LEDEffect-BootGreeting/LEDEffect-BootGreeting.ino rename to examples/LEDs/LEDEffect-BootGreeting/LEDEffect-BootGreeting.ino diff --git a/examples/LEDEffects/LEDEffects.ino b/examples/LEDs/LEDEffects/LEDEffects.ino similarity index 100% rename from examples/LEDEffects/LEDEffects.ino rename to examples/LEDs/LEDEffects/LEDEffects.ino From f27a2127ac16192fa7ee7c4d6038542433c474a1 Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Tue, 20 Nov 2018 07:51:24 +0100 Subject: [PATCH 2/2] kaleidoscope-builder: Support examples in subdirs For better organisation, we're putting examples in subdirectories of `examples/`. The builder should support that. Signed-off-by: Gergely Nagy --- bin/kaleidoscope-builder | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/bin/kaleidoscope-builder b/bin/kaleidoscope-builder index da1680f8..52c83ff1 100755 --- a/bin/kaleidoscope-builder +++ b/bin/kaleidoscope-builder @@ -249,12 +249,19 @@ compile () { _find_all () { for plugin in ./*.ino \ - examples/* \ + $([ -d examples ] && find examples -name '*.ino') \ src/*.ino; do if [ -d "$(dirname "${plugin}")" ] || [ -f "${plugin}" ]; then p="$(basename "${plugin}" .ino)" if [ "${p}" != '*' ]; then - echo "${p}" + case "${plugin}" in + examples/*/${p}/${p}.ino) + echo "${plugin}" | sed -e "s,examples/,," | sed -e "s,/${p}\\.ino,," + ;; + *) + echo "${p}" + ;; + esac fi fi done | sort @@ -497,6 +504,12 @@ done LIBRARY="${SKETCH}" +case "${SKETCH}" in + */*) + SKETCH="$(basename "${SKETCH}")" + ;; +esac + export SKETCH export LIBRARY