Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support V-USB as a submodule #62

Merged
merged 3 commits into from
May 30, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion qmk_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']

Expand All @@ -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'],
Expand Down Expand Up @@ -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.
"""
Expand Down
5 changes: 4 additions & 1 deletion qmk_compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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/')
Expand Down Expand Up @@ -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')
Expand Down