Esempio n. 1
0
 def register_options(cls, register):
   super(JVM, cls).register_options(register)
   # TODO(benjy): Options to specify the JVM version?
   register('--options', action='append', recursive=True, metavar='<option>...',
            help='Run with these extra JVM options.')
   register('--program-args', action='append', recursive=True, metavar='<arg>...',
            help='Run with these extra program args.')
   register('--debug', action='store_true', recursive=True,
            help='Run the JVM with remote debugging.')
   register('--debug-port', advanced=True, recursive=True, type=int, default=5005,
            help='The JVM will listen for a debugger on this port.')
   register('--debug-args', advanced=True, recursive=True, type=list_option,
            default=[
              '-Xdebug',
              '-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address={debug_port}'
            ],
            help='The JVM remote-debugging arguments. {debug_port} will be replaced with '
                 'the value of the --debug-port option.')
   human_readable_os_aliases = ', '.join('{}: [{}]'.format(str(key), ', '.join(sorted(val)))
                                        for key, val in OS_ALIASES.items())
   register('--jdk-paths', advanced=True, recursive=True, type=dict_option,
            help='Map of os names to lists of paths to jdks. These paths will be searched before '
                 'everything else (before the JDK_HOME, JAVA_HOME, PATH environment variables) '
                 'when locating a jvm to use. The same OS can be specified via several different '
                 'aliases, according to this map: {}'.format(human_readable_os_aliases))
Esempio n. 2
0
 def register_options(cls, register):
   super(DistributionLocator, cls).register_options(register)
   human_readable_os_aliases = ', '.join('{}: [{}]'.format(str(key), ', '.join(sorted(val)))
                                         for key, val in OS_ALIASES.items())
   register('--paths', advanced=True, type=dict_option,
            help='Map of os names to lists of paths to jdks. These paths will be searched before '
                 'everything else (before the JDK_HOME, JAVA_HOME, PATH environment variables) '
                 'when locating a jvm to use. The same OS can be specified via several different '
                 'aliases, according to this map: {}'.format(human_readable_os_aliases))
Esempio n. 3
0
 def register_options(cls, register):
   super(DistributionLocator, cls).register_options(register)
   human_readable_os_aliases = ', '.join('{}: [{}]'.format(str(key), ', '.join(sorted(val)))
                                         for key, val in OS_ALIASES.items())
   register('--paths', advanced=True, type=dict_option,
            help='Map of os names to lists of paths to jdks. These paths will be searched before '
                 'everything else (before the JDK_HOME, JAVA_HOME, PATH environment variables) '
                 'when locating a jvm to use. The same OS can be specified via several different '
                 'aliases, according to this map: {}'.format(human_readable_os_aliases))
Esempio n. 4
0
 def register_options(cls, register):
     super().register_options(register)
     human_readable_os_aliases = ", ".join(
         "{}: [{}]".format(str(key), ", ".join(sorted(val))) for key, val in OS_ALIASES.items()
     )
     register(
         "--paths",
         advanced=True,
         type=dict,
         help="Map of os names to lists of paths to jdks. These paths will be searched before "
         "everything else (before the JDK_HOME, JAVA_HOME, PATH environment variables) "
         "when locating a jvm to use. The same OS can be specified via several different "
         "aliases, according to this map: {}".format(human_readable_os_aliases),
     )
     register(
         "--minimum-version", advanced=True, help="Minimum version of the JVM pants will use"
     )
     register(
         "--maximum-version", advanced=True, help="Maximum version of the JVM pants will use"
     )
Esempio n. 5
0
 def test_keys_in_aliases(self):
     for key in OS_ALIASES.keys():
         self.assertIn(key, known_os_names())
Esempio n. 6
0
 def test_alias_normalization(self):
     for normal_os, aliases in OS_ALIASES.items():
         for alias in aliases:
             self.assertEqual(normal_os, normalize_os_name(alias))
Esempio n. 7
0
 def test_keys_in_aliases(self):
   for key in OS_ALIASES.keys():
     self.assertIn(key, known_os_names())
Esempio n. 8
0
 def test_alias_normalization(self):
   for normal_os, aliases in OS_ALIASES.items():
     for alias in aliases:
       self.assertEqual(normal_os, normalize_os_name(alias))
Esempio n. 9
0
def test_alias_normalization() -> None:
    for normal_os, aliases in OS_ALIASES.items():
        for alias in aliases:
            assert normal_os == normalize_os_name(alias)
Esempio n. 10
0
def test_keys_in_aliases() -> None:
    for key in OS_ALIASES.keys():
        assert key in _values(OS_ALIASES)
Esempio n. 11
0
def test_keys_in_aliases() -> None:
    for key in OS_ALIASES.keys():
        assert key in known_os_names()