# HG changeset patch # User Doug Simon # Date 1397581586 -7200 # Node ID 3a1f48125f53603cc15bee0a5f4ea7b236181978 # Parent e301d31927fbd03129b4412eb68759f36c24f10b added --jdt-show-task-tags option to build command diff -r e301d31927fb -r 3a1f48125f53 mxtool/mx.py --- a/mxtool/mx.py Tue Apr 15 16:16:24 2014 +0200 +++ b/mxtool/mx.py Tue Apr 15 19:06:26 2014 +0200 @@ -1694,6 +1694,7 @@ parser.add_argument('--force-javac', action='store_true', dest='javac', help='use javac despite ecj.jar is found or not') parser.add_argument('--jdt', help='path to ecj.jar, the Eclipse batch compiler (default: ' + defaultEcjPath + ')', default=defaultEcjPath, metavar='') parser.add_argument('--jdt-warning-as-error', action='store_true', help='convert all Eclipse batch compiler warnings to errors') + parser.add_argument('--jdt-show-task-tags', action='store_true', help='show task tags as Eclipse batch compiler warnings') parser.add_argument('--error-prone', dest='error_prone', help='path to error-prone.jar', metavar='') if suppliedParser: @@ -1919,11 +1920,15 @@ if not exists(jdtProperties): log('JDT properties file {0} not found'.format(jdtProperties)) else: - # convert all warnings to errors - if args.jdt_warning_as_error: + with open(jdtProperties) as fp: + origContent = fp.read() + content = origContent + if args.jdt_warning_as_error: + content = content.replace('=warning', '=error') + if not args.jdt_show_task_tags: + content = content + '\norg.eclipse.jdt.core.compiler.problem.tasks=ignore' + if origContent != content: jdtPropertiesTmp = jdtProperties + '.tmp' - with open(jdtProperties) as fp: - content = fp.read().replace('=warning', '=error') with open(jdtPropertiesTmp, 'w') as fp: fp.write(content) toBeDeleted.append(jdtPropertiesTmp)