diff --git a/qmk_commands.py b/qmk_commands.py index b628cd3..23691f5 100644 --- a/qmk_commands.py +++ b/qmk_commands.py @@ -12,7 +12,7 @@ ## Environment setup if 'GIT_BRANCH' in os.environ: - for key in 'CHIBIOS_GIT_BRANCH', 'CHIBIOS_CONTRIB_GIT_BRANCH', 'LUFA_GIT_BRANCH', 'QMK_GIT_BRANCH': + for key in 'CHIBIOS_GIT_BRANCH', 'CHIBIOS_CONTRIB_GIT_BRANCH', 'LUFA_GIT_BRANCH', 'VUSB_GIT_BRANCH', 'QMK_GIT_BRANCH': if key not in os.environ: os.environ[key] = os.environ['GIT_BRANCH'] @@ -30,6 +30,8 @@ CHIBIOS_CONTRIB_GIT_URL = os.environ.get('CHIBIOS_CONTRIB_GIT_URL', 'https://github.com/qmk/ChibiOS-Contrib') LUFA_GIT_BRANCH = os.environ.get('LUFA_GIT_BRANCH', 'master') LUFA_GIT_URL = os.environ.get('LUFA_GIT_URL', 'https://github.com/qmk/lufa') +VUSB_GIT_BRANCH = os.environ.get('VUSB_GIT_BRANCH', 'master') +VUSB_GIT_URL = os.environ.get('VUSB_GIT_URL', 'https://github.com/qmk/v-usb') ZIP_EXCLUDES = { 'qmk_firmware': ['qmk_firmware/.build/*', 'qmk_firmware/.git/*', 'qmk_firmware/lib/chibios/.git', 'qmk_firmware/lib/chibios-contrib/.git'], @@ -146,6 +148,12 @@ def checkout_lufa(): checkout_submodule('lufa', LUFA_GIT_URL, LUFA_GIT_BRANCH) +def checkout_vusb(): + """Do whatever is needed to get the latest version of V-USB. + """ + checkout_submodule('vusb', VUSB_GIT_URL, VUSB_GIT_BRANCH) + + def git_clone(git_url=QMK_GIT_URL, git_branch=QMK_GIT_BRANCH): """Clone a git repo. """ diff --git a/qmk_compiler.py b/qmk_compiler.py index ef82a93..5623a48 100644 --- a/qmk_compiler.py +++ b/qmk_compiler.py @@ -11,7 +11,7 @@ import qmk_redis import qmk_storage -from qmk_commands import checkout_qmk, find_firmware_file, store_source, checkout_chibios, checkout_lufa, write_version_txt +from qmk_commands import checkout_qmk, find_firmware_file, store_source, checkout_chibios, checkout_lufa, checkout_vusb, write_version_txt from qmk_redis import redis API_URL = environ.get('API_URL', 'https://api.qmk.fm/') @@ -140,6 +140,9 @@ def compile_firmware(keyboard, keymap, layout, layers, source_ip=None): if kb_data.get('protocol') == 'ChibiOS': checkout_chibios() + if kb_data.get('protocol') == 'V-USB': + checkout_vusb() + # Write the keymap file with open(path.join('qmk_firmware', keymap_json_file), 'w') as fd: fd.write(keymap_json + '\n')