Skip to content

Commit 506672a

Browse files
committed
review fixes
1 parent ef8fcc0 commit 506672a

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

compiler/mx.compiler/mx_graal_tools.py

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@
2626
from __future__ import print_function
2727

2828
import os
29-
import shutil
3029
import re
30+
import shutil
3131
import sys
32-
from os.path import join, exists
3332
from argparse import ArgumentParser, REMAINDER
33+
from os.path import join, exists
3434

3535
import mx
3636

@@ -41,7 +41,7 @@
4141

4242
_suite = mx.suite('compiler')
4343

44-
def run_netbeans_app(app_name, jdkhome, args=None, dist=None):
44+
def run_netbeans_app(app_name, jdkhome, args=None, dist=None, launch_message=None):
4545
args = [] if args is None else args
4646
if dist is None:
4747
dist = app_name.upper() + '_DIST'
@@ -75,12 +75,12 @@ def run_netbeans_app(app_name, jdkhome, args=None, dist=None):
7575
if mx.get_os() == 'linux':
7676
# Mitigates X server crashes on Linux
7777
launch.append('-J-Dsun.java2d.xrender=false')
78-
print('Consider flag -J-Dsun.java2d.uiScale=2 if on a high resolution display')
79-
print('Consider flag -J-Xms4g -J-Xmx8g if dealing with large graphs')
78+
if launch_message:
79+
launch_message()
8080
mx.run(launch+args)
8181

8282

83-
def netbeans_docstring(fullname, mixedname, mxname):
83+
def netbeans_docstring(fullname, mxname):
8484
return f"""run the {fullname}
8585
8686
The current version is based on NetBeans 26 which officially supports JDK 17 through JDK 24. A
@@ -100,7 +100,7 @@ def netbeans_docstring(fullname, mixedname, mxname):
100100
101101
"""
102102

103-
def launch_netbeans_app(fullname, mixedname, mxname, args):
103+
def launch_netbeans_app(fullname, distname, mxname, args, launch_message=None):
104104
min_version = 17
105105
max_version = 24
106106
min_version_spec = mx.VersionSpec(str(min_version))
@@ -127,17 +127,21 @@ def _do_not_abort(msg):
127127
mx.warn(f'If you experience any problems try to use an LTS release between JDK {min_version} and JDK {max_version} instead.')
128128
mx.warn(f'mx help {mxname} provides more details.')
129129

130-
run_netbeans_app(mixedname, jdkhome, args=args, dist=f'{mixedname.upper()}_DIST')
130+
run_netbeans_app(distname, jdkhome, args=args, dist=f'{distname.upper()}_DIST', launch_message=launch_message)
131131

132132
def igv(args):
133-
launch_netbeans_app('Ideal Graph Visualizer', 'IdealGraphVisualizer', 'igv', args)
133+
def help_message():
134+
print('Consider flag -J-Dsun.java2d.uiScale=2 if on a high resolution display')
135+
print('Consider flag -J-Xms4g -J-Xmx8g if dealing with large graphs')
136+
137+
launch_netbeans_app('Ideal Graph Visualizer', 'IdealGraphVisualizer', 'igv', args, launch_message=help_message)
134138

135-
igv.__doc__ = netbeans_docstring('Ideal Graph Visualizer', 'IdealGraphVisualizer', 'igv')
139+
igv.__doc__ = netbeans_docstring('Ideal Graph Visualizer', 'igv')
136140

137141
def c1visualizer(args):
138142
launch_netbeans_app('C1 Visualizer', 'C1Visualizer', 'c1visualizer', args)
139143

140-
c1visualizer.__doc__ = netbeans_docstring('C1 Visualizer', 'C1Visualizer', 'c1visualizer')
144+
c1visualizer.__doc__ = netbeans_docstring('C1 Visualizer', 'c1visualizer')
141145

142146

143147
def hsdis(args, copyToDir=None):

0 commit comments

Comments
 (0)