comparison mxtool/mx.py @ 9004:9f3a77848ea2

Merge with d2c34ddac70fe8636b79944417f44d396c0f9acf
author Michael Haupt <michael.haupt@oracle.com>
date Thu, 11 Apr 2013 11:26:38 +0200
parents 096725f4da58
children 7844a36d0216
comparison
equal deleted inserted replaced
9003:a8fea2979e63 9004:9f3a77848ea2
1559 args = parser.parse_args(args) 1559 args = parser.parse_args(args)
1560 if args.eclipse_exe is None: 1560 if args.eclipse_exe is None:
1561 args.eclipse_exe = os.environ.get('ECLIPSE_EXE') 1561 args.eclipse_exe = os.environ.get('ECLIPSE_EXE')
1562 if args.eclipse_exe is None: 1562 if args.eclipse_exe is None:
1563 abort('Could not find Eclipse executable. Use -e option or ensure ECLIPSE_EXE environment variable is set.') 1563 abort('Could not find Eclipse executable. Use -e option or ensure ECLIPSE_EXE environment variable is set.')
1564
1565 # Maybe an Eclipse installation dir was specified - look for the executable in it
1566 if join(args.eclipse_exe, exe_suffix('eclipse')):
1567 args.eclipse_exe = join(args.eclipse_exe, exe_suffix('eclipse'))
1568
1569 if not os.path.isfile(args.eclipse_exe) or not os.access(args.eclipse_exe, os.X_OK):
1570 abort('Not an executable file: ' + args.eclipse_exe)
1564 1571
1565 eclipseinit([], buildProcessorJars=False) 1572 eclipseinit([], buildProcessorJars=False)
1566 1573
1567 # build list of projects to be processed 1574 # build list of projects to be processed
1568 projects = sorted_deps() 1575 projects = sorted_deps()
1811 1818
1812 if not mustCheck: 1819 if not mustCheck:
1813 log('[all Java sources in {0} already checked - skipping]'.format(sourceDir)) 1820 log('[all Java sources in {0} already checked - skipping]'.format(sourceDir))
1814 continue 1821 continue
1815 1822
1816 if exists(timestampFile):
1817 os.utime(timestampFile, None)
1818 else:
1819 file(timestampFile, 'a')
1820
1821 dotCheckstyleXML = xml.dom.minidom.parse(dotCheckstyle) 1823 dotCheckstyleXML = xml.dom.minidom.parse(dotCheckstyle)
1822 localCheckConfig = dotCheckstyleXML.getElementsByTagName('local-check-config')[0] 1824 localCheckConfig = dotCheckstyleXML.getElementsByTagName('local-check-config')[0]
1823 configLocation = localCheckConfig.getAttribute('location') 1825 configLocation = localCheckConfig.getAttribute('location')
1824 configType = localCheckConfig.getAttribute('type') 1826 configType = localCheckConfig.getAttribute('type')
1825 if configType == 'project': 1827 if configType == 'project':
1881 with open(auditfileName) as f: 1883 with open(auditfileName) as f:
1882 warnings = [line.strip() for line in f if 'warning:' in line] 1884 warnings = [line.strip() for line in f if 'warning:' in line]
1883 if len(warnings) != 0: 1885 if len(warnings) != 0:
1884 map(log, warnings) 1886 map(log, warnings)
1885 return 1 1887 return 1
1888 else:
1889 if exists(timestampFile):
1890 os.utime(timestampFile, None)
1891 else:
1892 file(timestampFile, 'a')
1886 finally: 1893 finally:
1887 if exists(auditfileName): 1894 if exists(auditfileName):
1888 os.unlink(auditfileName) 1895 os.unlink(auditfileName)
1889 return 0 1896 return 0
1890 1897