Add support for project naming based on current directory Cleanup print output

screamer 2016-04-06 03:21:24 +01:00 committed by Marcus Shawcroft
parent 228d83193c
commit ab0fc59e52
2 changed files with 5 additions and 5 deletions

View File

@ -23,6 +23,7 @@ import colorama
from types import ListType from types import ListType
from shutil import rmtree from shutil import rmtree
from os.path import join, exists, basename from os.path import join, exists, basename
from os import getcwd
from time import time from time import time
from tools.utils import mkdir, run_cmd, run_cmd_ext, NotSupportedException from tools.utils import mkdir, run_cmd, run_cmd_ext, NotSupportedException
@ -91,15 +92,15 @@ def build_project(src_path, build_path, target, toolchain_name,
# We need to remove all paths which are repeated to avoid # We need to remove all paths which are repeated to avoid
# multiple compilations and linking with the same objects # multiple compilations and linking with the same objects
src_paths = [src_paths[0]] + list(set(src_paths[1:])) src_paths = [src_paths[0]] + list(set(src_paths[1:]))
PROJECT_BASENAME = basename(src_paths[0]) project_name = basename(src_paths[0] if src_paths[0] != "." and src_paths[0] != "./" else getcwd())
if name is None: if name is None:
# We will use default project name based on project folder name # We will use default project name based on project folder name
name = PROJECT_BASENAME name = project_name
toolchain.info("Building project %s (%s, %s)" % (PROJECT_BASENAME.upper(), target.name, toolchain_name)) toolchain.info("Building project %s (%s, %s)" % (project_name, target.name, toolchain_name))
else: else:
# User used custom global project name to have the same name for the # User used custom global project name to have the same name for the
toolchain.info("Building project %s to %s (%s, %s)" % (PROJECT_BASENAME.upper(), name, target.name, toolchain_name)) toolchain.info("Building project %s to %s (%s, %s)" % (project_name, name, target.name, toolchain_name))
if report != None: if report != None:

View File

@ -496,7 +496,6 @@ class mbedToolchain:
for source in files_to_compile: for source in files_to_compile:
_, name, _ = split_path(source) _, name, _ = split_path(source)
object = self.relative_object_path(build_path, base_path, source) object = self.relative_object_path(build_path, base_path, source)
print object
# Queue mode (multiprocessing) # Queue mode (multiprocessing)
commands = self.compile_command(source, object, inc_paths) commands = self.compile_command(source, object, inc_paths)