# HG changeset patch # User Doug Simon # Date 1340813163 -7200 # Node ID 6f2ccb483d96c3c7374fc3ec8a3b31d6726bd86c # Parent f96e7b39e9fe0b0a074f6bdf6969cfdca5cc6731 added overview.html for each project and integrated it into the generated 'mx site' command diff -r f96e7b39e9fe -r 6f2ccb483d96 graal/com.oracle.graal.alloc/overview.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.graal.alloc/overview.html Wed Jun 27 18:06:03 2012 +0200 @@ -0,0 +1,36 @@ + + + + + + + + +Documentation for the com.oracle.graal.alloc project. + + + diff -r f96e7b39e9fe -r 6f2ccb483d96 graal/com.oracle.graal.api.code/overview.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.graal.api.code/overview.html Wed Jun 27 18:06:03 2012 +0200 @@ -0,0 +1,36 @@ + + + + + + + + +Documentation for the com.oracle.graal.api.code project. + + + diff -r f96e7b39e9fe -r 6f2ccb483d96 graal/com.oracle.graal.api.interpreter/overview.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.graal.api.interpreter/overview.html Wed Jun 27 18:06:03 2012 +0200 @@ -0,0 +1,36 @@ + + + + + + + + +Documentation for the com.oracle.graal.api.interpreter project. + + + diff -r f96e7b39e9fe -r 6f2ccb483d96 graal/com.oracle.graal.api.meta/overview.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.graal.api.meta/overview.html Wed Jun 27 18:06:03 2012 +0200 @@ -0,0 +1,36 @@ + + + + + + + + +Documentation for the com.oracle.graal.api.meta project. + + + diff -r f96e7b39e9fe -r 6f2ccb483d96 graal/com.oracle.graal.api.test/overview.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.graal.api.test/overview.html Wed Jun 27 18:06:03 2012 +0200 @@ -0,0 +1,36 @@ + + + + + + + + +Documentation for the com.oracle.graal.api.test project. + + + diff -r f96e7b39e9fe -r 6f2ccb483d96 graal/com.oracle.graal.api/overview.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.graal.api/overview.html Wed Jun 27 18:06:03 2012 +0200 @@ -0,0 +1,36 @@ + + + + + + + + +Documentation for the com.oracle.graal.api project. + + + diff -r f96e7b39e9fe -r 6f2ccb483d96 graal/com.oracle.graal.boot.test/overview.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.graal.boot.test/overview.html Wed Jun 27 18:06:03 2012 +0200 @@ -0,0 +1,36 @@ + + + + + + + + +Documentation for the com.oracle.graal.boot.test project. + + + diff -r f96e7b39e9fe -r 6f2ccb483d96 graal/com.oracle.graal.boot/overview.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.graal.boot/overview.html Wed Jun 27 18:06:03 2012 +0200 @@ -0,0 +1,36 @@ + + + + + + + + +Documentation for the com.oracle.graal.boot project. + + + diff -r f96e7b39e9fe -r 6f2ccb483d96 graal/com.oracle.graal.bytecode/overview.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.graal.bytecode/overview.html Wed Jun 27 18:06:03 2012 +0200 @@ -0,0 +1,36 @@ + + + + + + + + +Documentation for the com.oracle.graal.bytecode project. + + + diff -r f96e7b39e9fe -r 6f2ccb483d96 graal/com.oracle.graal.compiler/overview.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.graal.compiler/overview.html Wed Jun 27 18:06:03 2012 +0200 @@ -0,0 +1,36 @@ + + + + + + + + +Documentation for the com.oracle.graal.compiler project. + + + diff -r f96e7b39e9fe -r 6f2ccb483d96 graal/com.oracle.graal.debug/overview.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.graal.debug/overview.html Wed Jun 27 18:06:03 2012 +0200 @@ -0,0 +1,36 @@ + + + + + + + + +Documentation for the com.oracle.graal.debug project. + + + diff -r f96e7b39e9fe -r 6f2ccb483d96 graal/com.oracle.graal.examples/overview.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.graal.examples/overview.html Wed Jun 27 18:06:03 2012 +0200 @@ -0,0 +1,36 @@ + + + + + + + + +Documentation for the com.oracle.graal.examples project. + + + diff -r f96e7b39e9fe -r 6f2ccb483d96 graal/com.oracle.graal.graph.test/overview.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.graal.graph.test/overview.html Wed Jun 27 18:06:03 2012 +0200 @@ -0,0 +1,36 @@ + + + + + + + + +Documentation for the com.oracle.graal.graph.test project. + + + diff -r f96e7b39e9fe -r 6f2ccb483d96 graal/com.oracle.graal.graph/overview.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.graal.graph/overview.html Wed Jun 27 18:06:03 2012 +0200 @@ -0,0 +1,36 @@ + + + + + + + + +Documentation for the com.oracle.graal.graph project. + + + diff -r f96e7b39e9fe -r 6f2ccb483d96 graal/com.oracle.graal.hotspot.server/overview.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.graal.hotspot.server/overview.html Wed Jun 27 18:06:03 2012 +0200 @@ -0,0 +1,36 @@ + + + + + + + + +Documentation for the com.oracle.graal.hotspot.server project. + + + diff -r f96e7b39e9fe -r 6f2ccb483d96 graal/com.oracle.graal.hotspot/overview.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.graal.hotspot/overview.html Wed Jun 27 18:06:03 2012 +0200 @@ -0,0 +1,36 @@ + + + + + + + + +Documentation for the com.oracle.graal.hotspot project. + + + diff -r f96e7b39e9fe -r 6f2ccb483d96 graal/com.oracle.graal.interpreter/overview.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.graal.interpreter/overview.html Wed Jun 27 18:06:03 2012 +0200 @@ -0,0 +1,36 @@ + + + + + + + + +Documentation for the com.oracle.graal.interpreter project. + + + diff -r f96e7b39e9fe -r 6f2ccb483d96 graal/com.oracle.graal.java/overview.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.graal.java/overview.html Wed Jun 27 18:06:03 2012 +0200 @@ -0,0 +1,36 @@ + + + + + + + + +Documentation for the com.oracle.graal.java project. + + + diff -r f96e7b39e9fe -r 6f2ccb483d96 graal/com.oracle.graal.jtt/overview.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.graal.jtt/overview.html Wed Jun 27 18:06:03 2012 +0200 @@ -0,0 +1,36 @@ + + + + + + + + +Documentation for the com.oracle.graal.jtt project. + + + diff -r f96e7b39e9fe -r 6f2ccb483d96 graal/com.oracle.graal.lir.amd64/overview.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.graal.lir.amd64/overview.html Wed Jun 27 18:06:03 2012 +0200 @@ -0,0 +1,36 @@ + + + + + + + + +Documentation for the com.oracle.graal.lir.amd64 project. + + + diff -r f96e7b39e9fe -r 6f2ccb483d96 graal/com.oracle.graal.lir/overview.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.graal.lir/overview.html Wed Jun 27 18:06:03 2012 +0200 @@ -0,0 +1,36 @@ + + + + + + + + +Documentation for the com.oracle.graal.lir project. + + + diff -r f96e7b39e9fe -r 6f2ccb483d96 graal/com.oracle.graal.nodes/overview.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.graal.nodes/overview.html Wed Jun 27 18:06:03 2012 +0200 @@ -0,0 +1,36 @@ + + + + + + + + +Documentation for the com.oracle.graal.nodes project. + + + diff -r f96e7b39e9fe -r 6f2ccb483d96 graal/com.oracle.graal.printer/overview.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.graal.printer/overview.html Wed Jun 27 18:06:03 2012 +0200 @@ -0,0 +1,36 @@ + + + + + + + + +Documentation for the com.oracle.graal.printer project. + + + diff -r f96e7b39e9fe -r 6f2ccb483d96 graal/com.oracle.graal.snippets.test/overview.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.graal.snippets.test/overview.html Wed Jun 27 18:06:03 2012 +0200 @@ -0,0 +1,36 @@ + + + + + + + + +Documentation for the com.oracle.graal.snippets.test project. + + + diff -r f96e7b39e9fe -r 6f2ccb483d96 graal/com.oracle.graal.snippets/overview.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.graal.snippets/overview.html Wed Jun 27 18:06:03 2012 +0200 @@ -0,0 +1,36 @@ + + + + + + + + +Documentation for the com.oracle.graal.snippets project. + + + diff -r f96e7b39e9fe -r 6f2ccb483d96 graal/com.oracle.graal.tests/overview.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.graal.tests/overview.html Wed Jun 27 18:06:03 2012 +0200 @@ -0,0 +1,36 @@ + + + + + + + + +Documentation for the com.oracle.graal.tests project. + + + diff -r f96e7b39e9fe -r 6f2ccb483d96 graal/com.oracle.max.asm/overview.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.max.asm/overview.html Wed Jun 27 18:06:03 2012 +0200 @@ -0,0 +1,36 @@ + + + + + + + + +Documentation for the com.oracle.max.asm project. + + + diff -r f96e7b39e9fe -r 6f2ccb483d96 graal/com.oracle.max.cri/overview.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.max.cri/overview.html Wed Jun 27 18:06:03 2012 +0200 @@ -0,0 +1,36 @@ + + + + + + + + +Documentation for the com.oracle.max.cri project. + + + diff -r f96e7b39e9fe -r 6f2ccb483d96 graal/com.oracle.max.criutils/overview.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.max.criutils/overview.html Wed Jun 27 18:06:03 2012 +0200 @@ -0,0 +1,36 @@ + + + + + + + + +Documentation for the com.oracle.max.criutils project. + + + diff -r f96e7b39e9fe -r 6f2ccb483d96 graal/overview.html --- a/graal/overview.html Wed Jun 27 15:40:03 2012 +0200 +++ b/graal/overview.html Wed Jun 27 18:06:03 2012 +0200 @@ -28,8 +28,6 @@ --> - - diff -r f96e7b39e9fe -r 6f2ccb483d96 mx/commands.py --- a/mx/commands.py Wed Jun 27 15:40:03 2012 +0200 +++ b/mx/commands.py Wed Jun 27 18:06:03 2012 +0200 @@ -1001,12 +1001,77 @@ mx.abort('jacocoreport takes only one argument : an output directory') mx.run_java(['-jar', jacocoreport.get_path(True), '-in', 'jacoco.exec', '-g', join(_graal_home, 'graal'), out]) +def _fix_overview_summary(path, topLink): + """ + Processes an "overview-summary.html" generated by javadoc to put the complete + summary text above the Packages table. + """ + + # This uses scraping and so will break if the relevant content produced by javadoc changes in any way! + orig = path + '.orig' + if exists(orig): + with open(orig) as fp: + content = fp.read() + else: + with open(path) as fp: + content = fp.read() + with open(orig, 'w') as fp: + fp.write(content) + + class Chunk: + def __init__(self, content, ldelim, rdelim): + lindex = content.find(ldelim) + rindex = content.find(rdelim) + self.ldelim = ldelim + self.rdelim = rdelim + if lindex != -1 and rindex != -1 and rindex > lindex: + self.text = content[lindex + len(ldelim):rindex] + else: + self.text = None + + def replace(self, content, repl): + lindex = content.find(self.ldelim) + rindex = content.find(self.rdelim) + old = content[lindex:rindex + len(self.rdelim)] + return content.replace(old, repl) + + chunk1 = Chunk(content, """
+
+
""", """
+
+

See: Description

+
""") + + chunk2 = Chunk(content, """ +""") + + if not chunk1.text: + mx.log('Could not find header section in ' + path) + return + + if not chunk2.text: + mx.log('Could not find footer section in ' + path) + return + + content = chunk1.replace(content, '
' + chunk2.text + topLink +'
') + content = chunk2.replace(content, '') + + with open(path, 'w') as fp: + fp.write(content) + def site(args): """creates a website containing javadoc and the project dependency graph""" parser = ArgumentParser(prog='site') parser.add_argument('-d', '--base', action='store', help='directory for generated site', required=True, metavar='') parser.add_argument('-c', '--clean', action='store_true', help='remove existing site in ') + parser.add_argument('-t', '--test', action='store_true', help='omit the Javadoc execution (useful for testing)') args = parser.parse_args(args) @@ -1018,14 +1083,23 @@ shutil.rmtree(args.base) os.mkdir(args.base) - mx.javadoc(['--base', args.base]) + unified = join(args.base, 'all') + + if not args.test: + # Create javadoc for each project + mx.javadoc(['--base', args.base]) - unified = join(args.base, 'all') - if exists(unified): - shutil.rmtree(unified) - mx.javadoc(['--base', args.base, '--unified', '--arg', '@-overview', '--arg', '@' + join(_graal_home, 'graal', 'overview.html')]) - os.rename(join(args.base, 'javadoc'), unified) - + # Create unified javadoc for all projects + if exists(unified): + shutil.rmtree(unified) + mx.javadoc(['--base', args.base, + '--unified', + '--arg', '@-windowtitle', '--arg', '@Unified Graal Javadoc', + '--arg', '@-doctitle', '--arg', '@Unified Graal Javadoc', + '--arg', '@-overview', '--arg', '@' + join(_graal_home, 'graal', 'overview.html')]) + os.rename(join(args.base, 'javadoc'), unified) + + # Generate dependency graph with Graphviz _, tmp = tempfile.mkstemp() try: svg = join(args.base, 'all', 'modules.svg') @@ -1050,18 +1124,31 @@ mx.run(['dot', '-Tsvg', '-o' + svg, tmp]) - # Post-process generated SVG to remove unified title elements which most browsers - # render as redundant (and annoying) tooltips. - with open(svg, 'r') as fp: - content = fp.read() - content = re.sub('.*', '', content) - content = re.sub('xlink:title="[^"]*"', '', content) - with open(svg, 'w') as fp: - fp.write(content) - - print 'Created website - root is ' + join(unified, 'index.html') finally: os.remove(tmp) + + # Post-process generated SVG to remove title elements which most browsers + # render as redundant (and annoying) tooltips. + with open(svg, 'r') as fp: + content = fp.read() + content = re.sub('.*', '', content) + content = re.sub('xlink:title="[^"]*"', '', content) + with open(svg, 'w') as fp: + fp.write(content) + + # Post-process generated overview-summary.html files + top = join(args.base, 'all', 'overview-summary.html') + for root, _, files in os.walk(args.base): + for f in files: + if f == 'overview-summary.html': + path = join(root, f) + topLink = '' + if top != path: + link = os.path.relpath(join(args.base, 'all', 'index.html'), dirname(path)) + topLink = '

[return to the unified Graal javadoc]

' + _fix_overview_summary(path, topLink) + + print 'Created website - root is ' + join(unified, 'index.html') def mx_init(): _vmbuild = 'product' diff -r f96e7b39e9fe -r 6f2ccb483d96 mxtool/mx.py --- a/mxtool/mx.py Wed Jun 27 15:40:03 2012 +0200 +++ b/mxtool/mx.py Wed Jun 27 18:06:03 2012 +0200 @@ -2038,8 +2038,21 @@ links.append(os.path.relpath(depOut, out)) cp = classpath(p.name, includeSelf=True) sp = os.pathsep.join(p.source_dirs()) + overviewFile = join(p.dir, 'overview.html') + overview = [] + if exists(overviewFile): + overview = ['-overview', overviewFile] log('Generating {2} for {0} in {1}'.format(p.name, out, docDir)) - run([java().javadoc, memory, '-classpath', cp, '-quiet', '-d', out, '-sourcepath', sp] + links + extraArgs + list(pkgs)) + run([java().javadoc, memory, + '-windowtitle', p.name + ' javadoc', + '-classpath', cp, + '-quiet', + '-d', out, + '-sourcepath', sp] + + links + + extraArgs + + overview + + list(pkgs)) log('Generated {2} for {0} in {1}'.format(p.name, out, docDir)) else: pkgs = set()