本文整理汇总了Python中pants.ivy.bootstrapper.Bootstrapper.instance方法的典型用法代码示例。如果您正苦于以下问题:Python Bootstrapper.instance方法的具体用法?Python Bootstrapper.instance怎么用?Python Bootstrapper.instance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pants.ivy.bootstrapper.Bootstrapper
的用法示例。
在下文中一共展示了Bootstrapper.instance方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_depmap_jar_path
# 需要导入模块: from pants.ivy.bootstrapper import Bootstrapper [as 别名]
# 或者: from pants.ivy.bootstrapper.Bootstrapper import instance [as 别名]
def test_depmap_jar_path(self):
with temporary_dir(root_dir=self.workdir_root()) as workdir:
test_target = 'examples/tests/java/com/pants/examples/usethrift:usethrift'
json_data = self.run_depmap_project_info(test_target, workdir)
ivy_cache_dir = Bootstrapper.instance().ivy_cache_dir
self.assertEquals(json_data.get('libraries').get('commons-lang:commons-lang:2.5'),
[os.path.join(ivy_cache_dir,
'commons-lang/commons-lang/jars/commons-lang-2.5.jar')])
示例2: test_simple
# 需要导入模块: from pants.ivy.bootstrapper import Bootstrapper [as 别名]
# 或者: from pants.ivy.bootstrapper.Bootstrapper import instance [as 别名]
def test_simple(self):
bootstrapper = Bootstrapper.instance()
ivy = bootstrapper.ivy()
self.assertIsNotNone(ivy.ivy_cache_dir)
self.assertIsNone(ivy.ivy_settings)
bootstrap_jar_path = os.path.join(self.test_workdir,
'tools', 'jvm', 'ivy', 'bootstrap.jar')
self.assertTrue(os.path.exists(bootstrap_jar_path))
示例3: test_depmap_jar_path
# 需要导入模块: from pants.ivy.bootstrapper import Bootstrapper [as 别名]
# 或者: from pants.ivy.bootstrapper.Bootstrapper import instance [as 别名]
def test_depmap_jar_path(self):
with temporary_dir(root_dir=self.workdir_root()) as workdir:
test_target = 'examples/tests/java/com/pants/examples/usethrift:usethrift'
json_data = self.run_depmap_project_info(test_target, workdir)
# Hack because Bootstrapper.instance() reads config from cache. Will go away after we plumb
# options into IvyUtil properly.
Config.cache(Config.load())
ivy_cache_dir = Bootstrapper.instance().ivy_cache_dir
self.assertEquals(json_data.get('libraries').get('commons-lang:commons-lang:2.5'),
[os.path.join(ivy_cache_dir,
'commons-lang/commons-lang/jars/commons-lang-2.5.jar')])
示例4: __init__
# 需要导入模块: from pants.ivy.bootstrapper import Bootstrapper [as 别名]
# 或者: from pants.ivy.bootstrapper.Bootstrapper import instance [as 别名]
def __init__(self, *args, **kwargs):
super(IvyResolve, self).__init__(*args, **kwargs)
self._ivy_bootstrapper = Bootstrapper.instance()
self._cachedir = self._ivy_bootstrapper.ivy_cache_dir
self._confs = self.context.config.getlist(self._CONFIG_SECTION, 'confs', default=['default'])
self._classpath_dir = os.path.join(self.workdir, 'mapped')
self._outdir = self.get_options().outdir or os.path.join(self.workdir, 'reports')
self._open = self.get_options().open
self._report = self._open or self.get_options().report
self._ivy_utils = IvyUtils(config=self.context.config, log=self.context.log)
# Typically this should be a local cache only, since classpaths aren't portable.
self.setup_artifact_cache_from_config(config_section=self._CONFIG_SECTION)
示例5: __init__
# 需要导入模块: from pants.ivy.bootstrapper import Bootstrapper [as 别名]
# 或者: from pants.ivy.bootstrapper.Bootstrapper import instance [as 别名]
def __init__(self, *args, **kwargs):
super(IvyResolve, self).__init__(*args, **kwargs)
self._ivy_bootstrapper = Bootstrapper.instance()
self._cachedir = self._ivy_bootstrapper.ivy_cache_dir
self._classpath_dir = os.path.join(self.workdir, 'mapped')
self._outdir = self.get_options().outdir or os.path.join(self.workdir, 'reports')
self._open = self.get_options().open
self._report = self._open or self.get_options().report
self._confs = None
self._args = []
for arg in self.get_options().args:
self._args.extend(safe_shlex_split(arg))
# Typically this should be a local cache only, since classpaths aren't portable.
self.setup_artifact_cache()
示例6: test_export_jar_path
# 需要导入模块: from pants.ivy.bootstrapper import Bootstrapper [as 别名]
# 或者: from pants.ivy.bootstrapper.Bootstrapper import instance [as 别名]
def test_export_jar_path(self):
with temporary_dir(root_dir=self.workdir_root()) as workdir:
test_target = 'examples/tests/java/org/pantsbuild/example/usethrift:usethrift'
json_data = self.run_export(test_target, workdir, self._resolve_args)
# Hack because Bootstrapper.instance() reads config from cache. Will go away after we plumb
# options into IvyUtil properly.
Config.cache(Config.load())
ivy_cache_dir = Bootstrapper.instance().ivy_cache_dir
common_lang_lib_info = json_data.get('libraries').get('commons-lang:commons-lang:2.5')
self.assertIsNotNone(common_lang_lib_info)
self.assertEquals(
common_lang_lib_info.get('default'),
os.path.join(ivy_cache_dir, 'commons-lang/commons-lang/jars/commons-lang-2.5.jar')
)
self.assertEquals(
common_lang_lib_info.get('javadoc'),
os.path.join(ivy_cache_dir, 'commons-lang/commons-lang/javadocs/commons-lang-2.5-javadoc.jar')
)
self.assertEquals(
common_lang_lib_info.get('sources'),
os.path.join(ivy_cache_dir, 'commons-lang/commons-lang/sources/commons-lang-2.5-sources.jar')
)
示例7: __init__
# 需要导入模块: from pants.ivy.bootstrapper import Bootstrapper [as 别名]
# 或者: from pants.ivy.bootstrapper.Bootstrapper import instance [as 别名]
def __init__(self, context, workdir, confs=None):
super(IvyResolve, self).__init__(context, workdir)
self._ivy_bootstrapper = Bootstrapper.instance()
self._cachedir = self._ivy_bootstrapper.ivy_cache_dir
self._confs = confs or context.config.getlist('ivy-resolve', 'confs', default=['default'])
self._classpath_dir = os.path.join(self.workdir, 'mapped')
self._outdir = context.options.ivy_resolve_outdir or os.path.join(self.workdir, 'reports')
self._open = context.options.ivy_resolve_open
self._report = self._open or context.options.ivy_resolve_report
self._ivy_bootstrap_key = 'ivy'
ivy_bootstrap_tools = context.config.getlist('ivy-resolve', 'bootstrap-tools', ':xalan')
self.register_jvm_tool(self._ivy_bootstrap_key, ivy_bootstrap_tools)
self._ivy_utils = IvyUtils(config=context.config,
options=context.options,
log=context.log)
context.products.require_data('exclusives_groups')
# Typically this should be a local cache only, since classpaths aren't portable.
self.setup_artifact_cache_from_config(config_section='ivy-resolve')
示例8: xml_report_path
# 需要导入模块: from pants.ivy.bootstrapper import Bootstrapper [as 别名]
# 或者: from pants.ivy.bootstrapper.Bootstrapper import instance [as 别名]
def xml_report_path(self, targets, conf):
"""The path to the xml report ivy creates after a retrieve."""
org, name = self.identify(targets)
cachedir = Bootstrapper.instance().ivy_cache_dir
return os.path.join(cachedir, '%s-%s-%s.xml' % (org, name, conf))
示例9: test_reset
# 需要导入模块: from pants.ivy.bootstrapper import Bootstrapper [as 别名]
# 或者: from pants.ivy.bootstrapper.Bootstrapper import instance [as 别名]
def test_reset(self):
bootstrapper1 = Bootstrapper.instance()
Bootstrapper.reset_instance()
bootstrapper2 = Bootstrapper.instance()
self.assertNotEqual(bootstrapper1, bootstrapper2)
示例10: test_simple
# 需要导入模块: from pants.ivy.bootstrapper import Bootstrapper [as 别名]
# 或者: from pants.ivy.bootstrapper.Bootstrapper import instance [as 别名]
def test_simple(self):
bootstrapper = Bootstrapper.instance()
ivy = bootstrapper.ivy()
self.assertIsNotNone(ivy.ivy_cache_dir)
self.assertIsNotNone(ivy.ivy_settings)
示例11: test_reset
# 需要导入模块: from pants.ivy.bootstrapper import Bootstrapper [as 别名]
# 或者: from pants.ivy.bootstrapper.Bootstrapper import instance [as 别名]
def test_reset(self):
with subsystem_instance(IvySubsystem):
bootstrapper1 = Bootstrapper.instance()
Bootstrapper.reset_instance()
bootstrapper2 = Bootstrapper.instance()
self.assertIsNot(bootstrapper1, bootstrapper2)
示例12: xml_report_path
# 需要导入模块: from pants.ivy.bootstrapper import Bootstrapper [as 别名]
# 或者: from pants.ivy.bootstrapper.Bootstrapper import instance [as 别名]
def xml_report_path(cls, targets, conf):
"""The path to the xml report ivy creates after a retrieve."""
org, name = cls.identify(targets)
cachedir = Bootstrapper.instance().ivy_cache_dir
return os.path.join(cachedir, '{}-{}-{}.xml'.format(org, name, conf))