mirror of https://github.com/ARMmbed/mbed-os.git
Fix integration with online tools
parent
4e747af031
commit
178e96d65f
|
@ -6,6 +6,7 @@ from contextlib import closing
|
||||||
from zipfile import ZipFile, ZIP_DEFLATED
|
from zipfile import ZipFile, ZIP_DEFLATED
|
||||||
|
|
||||||
from workspace_tools.toolchains import TOOLCHAIN_CLASSES
|
from workspace_tools.toolchains import TOOLCHAIN_CLASSES
|
||||||
|
from workspace_tools.targets import TARGET_MAP
|
||||||
|
|
||||||
class OldLibrariesException(Exception): pass
|
class OldLibrariesException(Exception): pass
|
||||||
|
|
||||||
|
@ -17,7 +18,7 @@ class Exporter():
|
||||||
self.inputDir = inputDir
|
self.inputDir = inputDir
|
||||||
self.target = target
|
self.target = target
|
||||||
self.program_name = program_name
|
self.program_name = program_name
|
||||||
self.toolchain = TOOLCHAIN_CLASSES[self.TOOLCHAIN](target)
|
self.toolchain = TOOLCHAIN_CLASSES[self.TOOLCHAIN](TARGET_MAP[target])
|
||||||
self.build_url_resolver = build_url_resolver
|
self.build_url_resolver = build_url_resolver
|
||||||
|
|
||||||
def __scan_and_copy(self, src_path, trg_path):
|
def __scan_and_copy(self, src_path, trg_path):
|
||||||
|
|
|
@ -32,7 +32,8 @@ IGNORE_DIRECTORIES = set(['CVS'])
|
||||||
|
|
||||||
|
|
||||||
def print_notify(event):
|
def print_notify(event):
|
||||||
if event['type'] == 'info':
|
# Default command line notification
|
||||||
|
if event['type'] in ['info', 'debug']:
|
||||||
print event['message']
|
print event['message']
|
||||||
|
|
||||||
elif event['type'] == 'cc':
|
elif event['type'] == 'cc':
|
||||||
|
@ -387,7 +388,7 @@ class mbedToolchain:
|
||||||
if self.VERBOSE:
|
if self.VERBOSE:
|
||||||
if type(message) is ListType:
|
if type(message) is ListType:
|
||||||
message = ' '.join(message)
|
message = ' '.join(message)
|
||||||
self.info(message)
|
self.notify({'type': 'debug', 'message': message})
|
||||||
|
|
||||||
def cc_info(self, severity, file, line, message):
|
def cc_info(self, severity, file, line, message):
|
||||||
self.notify({'type': 'cc', 'severity': severity, 'file': file, 'line': line, 'message': message})
|
self.notify({'type': 'cc', 'severity': severity, 'file': file, 'line': line, 'message': message})
|
||||||
|
|
|
@ -18,13 +18,18 @@ def cmd(l, check=True, verbose=False, shell=False, cwd=None):
|
||||||
|
|
||||||
def run_cmd(command, wd=None, chroot=None):
|
def run_cmd(command, wd=None, chroot=None):
|
||||||
if chroot:
|
if chroot:
|
||||||
|
# Conventions managed by the web team for the mbed.org build system
|
||||||
|
if not wd:
|
||||||
|
wd = '/src'
|
||||||
|
else:
|
||||||
|
wd = wd.replace(chroot, '')
|
||||||
orig_cmd = ' '.join([c.replace(chroot, '') for c in command])
|
orig_cmd = ' '.join([c.replace(chroot, '') for c in command])
|
||||||
command = []
|
command = []
|
||||||
command.append('/usr/sbin/chroot')
|
command.append('/usr/sbin/chroot')
|
||||||
command.append(chroot)
|
command.append(chroot)
|
||||||
command.append('/bin/run.sh')
|
command.append('/bin/run_v2.sh')
|
||||||
|
command.append('%s'%wd)
|
||||||
command.append('%s'%orig_cmd)
|
command.append('%s'%orig_cmd)
|
||||||
|
|
||||||
logging.debug("Running command %s"%' '.join(command))
|
logging.debug("Running command %s"%' '.join(command))
|
||||||
p = Popen(command, stdout=PIPE, stderr=PIPE, cwd=chroot)
|
p = Popen(command, stdout=PIPE, stderr=PIPE, cwd=chroot)
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue