Завершить разделение SDK и внешних проектов
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import argparse
|
||||
import json
|
||||
import os
|
||||
from pathlib import Path
|
||||
@@ -85,9 +86,15 @@ def wait_event(process, buffer, event, timeout):
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description=__doc__)
|
||||
parser.add_argument('--build', default=None)
|
||||
parser.add_argument('--app-hdd', default=None)
|
||||
parser.add_argument('--launch-path', default=None)
|
||||
options, _ = parser.parse_known_args()
|
||||
if not PYTHON.is_file():
|
||||
raise RuntimeError('Нет local pyenv shim: '+str(PYTHON))
|
||||
build = ROOT/'tests/hello/.sprinter-cc-hello'
|
||||
build = Path(options.build).resolve() if options.build else \
|
||||
ROOT/'tests/hello/.sprinter-cc-hello'
|
||||
command = [str(PYTHON), str(ROOT/'toolchain/sdbg_dap.py')]
|
||||
process = subprocess.Popen(command, cwd=ROOT, stdin=subprocess.PIPE,
|
||||
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||
@@ -95,8 +102,13 @@ def main():
|
||||
try:
|
||||
send(process, 1, 'initialize')
|
||||
_, buffer, _ = wait_response(process, buffer, 'initialize', 10)
|
||||
send(process, 2, 'launch', {'build': str(build), 'debugger': 'sdbg',
|
||||
'dssTimeout': 30})
|
||||
debugger = 'osx' if '--osx' in sys.argv else 'sdbg'
|
||||
launch = {'build': str(build), 'debugger': debugger, 'dssTimeout': 30}
|
||||
if options.app_hdd:
|
||||
launch['appHdd'] = str(Path(options.app_hdd).resolve())
|
||||
if options.launch_path:
|
||||
launch['launchPath'] = options.launch_path
|
||||
send(process, 2, 'launch', launch)
|
||||
launched, buffer, events = wait_response(process, buffer, 'launch', 80)
|
||||
if not any(item.get('event') == 'initialized' for item in events):
|
||||
initialized, buffer = receive(process, buffer, 5)
|
||||
|
||||
Reference in New Issue
Block a user