diff --git a/.github/workflows/action_tools.yml b/.github/workflows/action_tools.yml index 098f7ea482..64f8299c26 100644 --- a/.github/workflows/action_tools.yml +++ b/.github/workflows/action_tools.yml @@ -61,12 +61,6 @@ jobs: - name: Project generate Tools if: ${{ success() }} run: | - echo "Test to generate mdk project" - scons --target=mdk -s -C $TEST_BSP_ROOT - scons --target=mdk4 -s -C $TEST_BSP_ROOT - scons --target=mdk5 -s -C $TEST_BSP_ROOT - echo "Test to generate iar project" - scons --target=iar -s -C $TEST_BSP_ROOT echo "Test to generate eclipse project" scons --target=eclipse -s -C $TEST_BSP_ROOT echo "Test to generate cmake project" diff --git a/tools/building.py b/tools/building.py index 91c6d05c99..d518441151 100644 --- a/tools/building.py +++ b/tools/building.py @@ -784,35 +784,26 @@ def DoBuilding(target, objects): def GenTargetProject(program = None): - if GetOption('target') == 'mdk': - from keil import MDKProject - from keil import MDK4Project - from keil import MDK5Project + if GetOption('target') in ['mdk', 'mdk4', 'mdk5']: + from keil import MDK2Project, MDK4Project, MDK5Project, ARMCC_Version - template = os.path.isfile('template.Uv2') - if template: - MDKProject('project.Uv2', Projects) + if os.path.isfile('template.uvprojx') and GetOption('target') not in ['mdk4']: # Keil5 + MDK5Project('project.uvprojx', Projects) + print("Keil5 project is generating...") + elif os.path.isfile('template.uvproj') and GetOption('target') not in ['mdk5']: # Keil4 + MDK4Project('project.uvproj', Projects) + print("Keil4 project is generating...") + elif os.path.isfile('template.Uv2') and GetOption('target') not in ['mdk4', 'mdk5']: # Keil2 + MDK2Project('project.Uv2', Projects) + print("Keil2 project is generating...") else: - template = os.path.isfile('template.uvproj') - if template: - MDK4Project('project.uvproj', Projects) - else: - template = os.path.isfile('template.uvprojx') - if template: - MDK5Project('project.uvprojx', Projects) - else: - print ('No template project file found.') - - if GetOption('target') == 'mdk4': - from keil import MDK4Project - MDK4Project('project.uvproj', Projects) - - if GetOption('target') == 'mdk5': - from keil import MDK5Project - MDK5Project('project.uvprojx', Projects) + print ('No template project file found.') + exit(1) + print("Keil Version: " + ARMCC_Version()) if GetOption('target') == 'iar': - from iar import IARProject + from iar import IARProject, IARVersion + print("IAR Version: " + IARVersion()) IARProject('project.ewp', Projects) if GetOption('target') == 'vs': diff --git a/tools/iar.py b/tools/iar.py index 687b125174..4568d5d664 100644 --- a/tools/iar.py +++ b/tools/iar.py @@ -204,6 +204,4 @@ def IARVersion(): stdout = str(stdout, 'utf8') # Patch for Python 3 # example stdout: IAR ANSI C/C++ Compiler V8.20.1.14183/W32 for ARM iar_version = re.search('[\d\.]+', stdout).group(0) - if GetOption('verbose'): - print("IAR version: %s" % iar_version) return iar_version diff --git a/tools/keil.py b/tools/keil.py index 4cbfb97faf..35543136bb 100644 --- a/tools/keil.py +++ b/tools/keil.py @@ -319,7 +319,7 @@ def MDK5Project(target, script): import shutil shutil.copy2('template.uvoptx', 'project.uvoptx') -def MDKProject(target, script): +def MDK2Project(target, script): template = open('template.Uv2', "r") lines = template.readlines() @@ -453,5 +453,4 @@ def ARMCC_Version(): version_Tool = version_Tool[:-1] version_str_format = '%s/%s/%s' version_str = version_str_format % (version_Product, version_Component, version_Tool) - #print('version_str:' + version_str) return version_str