comparison mxtool/mx.py @ 15118:3a1f48125f53

added --jdt-show-task-tags option to build command
author Doug Simon <doug.simon@oracle.com>
date Tue, 15 Apr 2014 19:06:26 +0200
parents f3e74d317e83
children 11a591a99515
comparison
equal deleted inserted replaced
15117:e301d31927fb 15118:3a1f48125f53
1692 parser.add_argument('--no-java', action='store_false', dest='java', help='do not build Java projects') 1692 parser.add_argument('--no-java', action='store_false', dest='java', help='do not build Java projects')
1693 parser.add_argument('--no-native', action='store_false', dest='native', help='do not build native projects') 1693 parser.add_argument('--no-native', action='store_false', dest='native', help='do not build native projects')
1694 parser.add_argument('--force-javac', action='store_true', dest='javac', help='use javac despite ecj.jar is found or not') 1694 parser.add_argument('--force-javac', action='store_true', dest='javac', help='use javac despite ecj.jar is found or not')
1695 parser.add_argument('--jdt', help='path to ecj.jar, the Eclipse batch compiler (default: ' + defaultEcjPath + ')', default=defaultEcjPath, metavar='<path>') 1695 parser.add_argument('--jdt', help='path to ecj.jar, the Eclipse batch compiler (default: ' + defaultEcjPath + ')', default=defaultEcjPath, metavar='<path>')
1696 parser.add_argument('--jdt-warning-as-error', action='store_true', help='convert all Eclipse batch compiler warnings to errors') 1696 parser.add_argument('--jdt-warning-as-error', action='store_true', help='convert all Eclipse batch compiler warnings to errors')
1697 parser.add_argument('--jdt-show-task-tags', action='store_true', help='show task tags as Eclipse batch compiler warnings')
1697 parser.add_argument('--error-prone', dest='error_prone', help='path to error-prone.jar', metavar='<path>') 1698 parser.add_argument('--error-prone', dest='error_prone', help='path to error-prone.jar', metavar='<path>')
1698 1699
1699 if suppliedParser: 1700 if suppliedParser:
1700 parser.add_argument('remainder', nargs=REMAINDER, metavar='...') 1701 parser.add_argument('remainder', nargs=REMAINDER, metavar='...')
1701 1702
1917 # Try to fix a missing properties file by running eclipseinit 1918 # Try to fix a missing properties file by running eclipseinit
1918 eclipseinit([], buildProcessorJars=False) 1919 eclipseinit([], buildProcessorJars=False)
1919 if not exists(jdtProperties): 1920 if not exists(jdtProperties):
1920 log('JDT properties file {0} not found'.format(jdtProperties)) 1921 log('JDT properties file {0} not found'.format(jdtProperties))
1921 else: 1922 else:
1922 # convert all warnings to errors 1923 with open(jdtProperties) as fp:
1923 if args.jdt_warning_as_error: 1924 origContent = fp.read()
1925 content = origContent
1926 if args.jdt_warning_as_error:
1927 content = content.replace('=warning', '=error')
1928 if not args.jdt_show_task_tags:
1929 content = content + '\norg.eclipse.jdt.core.compiler.problem.tasks=ignore'
1930 if origContent != content:
1924 jdtPropertiesTmp = jdtProperties + '.tmp' 1931 jdtPropertiesTmp = jdtProperties + '.tmp'
1925 with open(jdtProperties) as fp:
1926 content = fp.read().replace('=warning', '=error')
1927 with open(jdtPropertiesTmp, 'w') as fp: 1932 with open(jdtPropertiesTmp, 'w') as fp:
1928 fp.write(content) 1933 fp.write(content)
1929 toBeDeleted.append(jdtPropertiesTmp) 1934 toBeDeleted.append(jdtPropertiesTmp)
1930 jdtArgs += ['-properties', jdtPropertiesTmp] 1935 jdtArgs += ['-properties', jdtPropertiesTmp]
1931 else: 1936 else: