|
34 | 34 | from tools.options import extract_profile
|
35 | 35 | from tools.build_api import build_library, build_mbed_libs, build_lib
|
36 | 36 | from tools.build_api import mcu_toolchain_matrix
|
37 |
| -from tools.build_api import static_analysis_scan, static_analysis_scan_lib, static_analysis_scan_library |
38 | 37 | from tools.build_api import print_build_results
|
39 | 38 | from tools.settings import CPPCHECK_CMD, CPPCHECK_MSG_FORMAT
|
40 | 39 | from utils import argparse_filestring_type, args_error
|
|
120 | 119 | default=None,
|
121 | 120 | help='For some commands you can use filter to filter out results')
|
122 | 121 |
|
123 |
| - parser.add_argument("--cppcheck", |
124 |
| - action="store_true", |
125 |
| - dest="cppcheck_validation", |
126 |
| - default=False, |
127 |
| - help="Forces 'cppcheck' static code analysis") |
128 |
| - |
129 | 122 | parser.add_argument("-j", "--jobs", type=int, dest="jobs",
|
130 | 123 | default=0, help="Number of concurrent jobs. Default: 0/auto (based on host machine's number of CPUs)")
|
131 | 124 | parser.add_argument("-N", "--artifact-name", dest="artifact_name",
|
|
212 | 205 |
|
213 | 206 | for toolchain in toolchains:
|
214 | 207 | for target in targets:
|
215 |
| - # CPPCHECK code validation |
216 |
| - if options.cppcheck_validation: |
| 208 | + tt_id = "%s::%s" % (toolchain, target) |
| 209 | + if toolchain not in TARGET_MAP[target].supported_toolchains: |
| 210 | + # Log this later |
| 211 | + print "%s skipped: toolchain not supported" % tt_id |
| 212 | + skipped.append(tt_id) |
| 213 | + else: |
217 | 214 | try:
|
218 | 215 | mcu = TARGET_MAP[target]
|
219 |
| - # CMSIS and MBED libs analysis |
220 | 216 | profile = extract_profile(parser, options, toolchain)
|
221 |
| - static_analysis_scan( |
222 |
| - mcu, toolchain, CPPCHECK_CMD, CPPCHECK_MSG_FORMAT, |
223 |
| - verbose=options.verbose, jobs=options.jobs, |
224 |
| - build_profile=profile) |
| 217 | + if options.source_dir: |
| 218 | + lib_build_res = build_library(options.source_dir, options.build_dir, mcu, toolchain, |
| 219 | + extra_verbose=options.extra_verbose_notify, |
| 220 | + verbose=options.verbose, |
| 221 | + silent=options.silent, |
| 222 | + jobs=options.jobs, |
| 223 | + clean=options.clean, |
| 224 | + archive=(not options.no_archive), |
| 225 | + macros=options.macros, |
| 226 | + name=options.artifact_name, |
| 227 | + build_profile=profile) |
| 228 | + else: |
| 229 | + lib_build_res = build_mbed_libs(mcu, toolchain, |
| 230 | + extra_verbose=options.extra_verbose_notify, |
| 231 | + verbose=options.verbose, |
| 232 | + silent=options.silent, |
| 233 | + jobs=options.jobs, |
| 234 | + clean=options.clean, |
| 235 | + macros=options.macros, |
| 236 | + build_profile=profile) |
| 237 | + |
225 | 238 | for lib_id in libraries:
|
226 |
| - # Static check for library |
227 |
| - static_analysis_scan_lib( |
228 |
| - lib_id, mcu, toolchain, CPPCHECK_CMD, |
229 |
| - CPPCHECK_MSG_FORMAT, |
230 |
| - extra_verbose=options.extra_verbose_notify, |
231 |
| - verbose=options.verbose, jobs=options.jobs, |
232 |
| - clean=options.clean, macros=options.macros, |
233 |
| - build_profile=profile) |
234 |
| - pass |
| 239 | + build_lib(lib_id, mcu, toolchain, |
| 240 | + extra_verbose=options.extra_verbose_notify, |
| 241 | + verbose=options.verbose, |
| 242 | + silent=options.silent, |
| 243 | + clean=options.clean, |
| 244 | + macros=options.macros, |
| 245 | + jobs=options.jobs, |
| 246 | + build_profile=profile) |
| 247 | + if lib_build_res: |
| 248 | + successes.append(tt_id) |
| 249 | + else: |
| 250 | + skipped.append(tt_id) |
235 | 251 | except Exception, e:
|
236 | 252 | if options.verbose:
|
237 | 253 | import traceback
|
238 | 254 | traceback.print_exc(file=sys.stdout)
|
239 | 255 | sys.exit(1)
|
| 256 | + failures.append(tt_id) |
240 | 257 | print e
|
241 |
| - else: |
242 |
| - # Build |
243 |
| - tt_id = "%s::%s" % (toolchain, target) |
244 |
| - if toolchain not in TARGET_MAP[target].supported_toolchains: |
245 |
| - # Log this later |
246 |
| - print "%s skipped: toolchain not supported" % tt_id |
247 |
| - skipped.append(tt_id) |
248 |
| - else: |
249 |
| - try: |
250 |
| - mcu = TARGET_MAP[target] |
251 |
| - profile = extract_profile(parser, options, toolchain) |
252 |
| - if options.source_dir: |
253 |
| - lib_build_res = build_library(options.source_dir, options.build_dir, mcu, toolchain, |
254 |
| - extra_verbose=options.extra_verbose_notify, |
255 |
| - verbose=options.verbose, |
256 |
| - silent=options.silent, |
257 |
| - jobs=options.jobs, |
258 |
| - clean=options.clean, |
259 |
| - archive=(not options.no_archive), |
260 |
| - macros=options.macros, |
261 |
| - name=options.artifact_name, |
262 |
| - build_profile=profile) |
263 |
| - else: |
264 |
| - lib_build_res = build_mbed_libs(mcu, toolchain, |
265 |
| - extra_verbose=options.extra_verbose_notify, |
266 |
| - verbose=options.verbose, |
267 |
| - silent=options.silent, |
268 |
| - jobs=options.jobs, |
269 |
| - clean=options.clean, |
270 |
| - macros=options.macros, |
271 |
| - build_profile=profile) |
272 |
| - |
273 |
| - for lib_id in libraries: |
274 |
| - build_lib(lib_id, mcu, toolchain, |
275 |
| - extra_verbose=options.extra_verbose_notify, |
276 |
| - verbose=options.verbose, |
277 |
| - silent=options.silent, |
278 |
| - clean=options.clean, |
279 |
| - macros=options.macros, |
280 |
| - jobs=options.jobs, |
281 |
| - build_profile=profile) |
282 |
| - if lib_build_res: |
283 |
| - successes.append(tt_id) |
284 |
| - else: |
285 |
| - skipped.append(tt_id) |
286 |
| - except Exception, e: |
287 |
| - if options.verbose: |
288 |
| - import traceback |
289 |
| - traceback.print_exc(file=sys.stdout) |
290 |
| - sys.exit(1) |
291 |
| - failures.append(tt_id) |
292 |
| - print e |
293 | 258 |
|
294 | 259 |
|
295 | 260 | # Write summary of the builds
|
|
0 commit comments