Mercurial > hg > graal-jvmci-8
diff mxtool/mx.py @ 5712:dfcb73ac6ba2
made invalid javadoc cause a JDT error
switched to using -XDignore.symbol.file flag to suppress internal API warnings emitted by javac and javadoc
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Thu, 28 Jun 2012 11:30:21 +0200 |
parents | 8d31a849ca97 |
children | b30cced39597 |
line wrap: on
line diff
--- a/mxtool/mx.py Thu Jun 28 11:11:12 2012 +0200 +++ b/mxtool/mx.py Thu Jun 28 11:30:21 2012 +0200 @@ -1248,27 +1248,10 @@ try: if jdtJar is None: log('Compiling Java sources for {0} with javac...'.format(p.name)) - errFilt = None + javacCmd = [java().javac, '-g', '-J-Xmx1g', '-source', args.compliance, '-classpath', cp, '-d', outputDir, '@' + argfile.name] if not args.warnAPI: - class Filter: - """ - Class to errFilt the 'is Sun proprietary API and may be removed in a future release' - warning when compiling the VM classes. - - """ - def __init__(self): - self.c = 0 - - def eat(self, line): - if 'proprietary API' in line: - self.c = 2 - elif self.c != 0: - self.c -= 1 - else: - log(line.rstrip()) - errFilt=Filter().eat - - run([java().javac, '-g', '-J-Xmx1g', '-source', args.compliance, '-classpath', cp, '-d', outputDir, '@' + argfile.name], err=errFilt) + javacCmd.append('-XDignore.symbol.file') + run(javacCmd) else: log('Compiling Java sources for {0} with JDT...'.format(p.name)) jdtArgs = [java().java, '-Xmx1g', '-jar', jdtJar, @@ -1965,6 +1948,7 @@ parser.add_argument('--unified', action='store_true', help='put javadoc in a single directory instead of one per project') parser.add_argument('--force', action='store_true', help='(re)generate javadoc even if package-list file exists') parser.add_argument('--projects', action='store', help='comma separated projects to process (omit to process all projects)') + parser.add_argument('--Wapi', action='store_true', dest='warnAPI', help='show warnings about using internal APIs') parser.add_argument('--argfile', action='store', help='name of file containing extra javadoc options') parser.add_argument('--arg', action='append', dest='extra_args', help='extra Javadoc arguments (e.g. --arg @-use)', metavar='@<arg>', default=[]) parser.add_argument('-m', '--memory', action='store', help='-Xmx value to pass to underlying JVM') @@ -2045,9 +2029,13 @@ overview = [] if exists(overviewFile): overview = ['-overview', overviewFile] + nowarnAPI = [] + if not args.warnAPI: + nowarnAPI.append('-XDignore.symbol.file') log('Generating {2} for {0} in {1}'.format(p.name, out, docDir)) run([java().javadoc, memory, '-windowtitle', p.name + ' javadoc', + '-XDignore.symbol.file', '-classpath', cp, '-quiet', '-d', out, @@ -2055,6 +2043,7 @@ links + extraArgs + overview + + nowarnAPI + list(pkgs)) log('Generated {2} for {0} in {1}'.format(p.name, out, docDir)) else: @@ -2075,8 +2064,19 @@ out = join(args.base, docDir) cp = classpath() sp = os.pathsep.join(sp) + nowarnAPI = [] + if not args.warnAPI: + nowarnAPI.append('-XDignore.symbol.file') log('Generating {2} for {0} in {1}'.format(', '.join(names), out, docDir)) - run([java().javadoc, memory, '-classpath', cp, '-quiet', '-d', out, '-sourcepath', sp] + links + extraArgs + list(pkgs)) + run([java().javadoc, memory, + '-classpath', cp, + '-quiet', + '-d', out, + '-sourcepath', sp] + + links + + extraArgs + + nowarnAPI + + list(pkgs)) log('Generated {2} for {0} in {1}'.format(', '.join(names), out, docDir)) def findclass(args):