当前位置: 首页>>代码示例>>Python>>正文


Python Bootstrapper.instance方法代码示例

本文整理汇总了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')])
开发者ID:digideskio,项目名称:pants,代码行数:10,代码来源:test_depmap_integration.py

示例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))
开发者ID:MathewJennings,项目名称:pants,代码行数:10,代码来源:test_bootstrapper.py

示例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')])
开发者ID:godwinpinto,项目名称:pants,代码行数:13,代码来源:test_depmap_integration.py

示例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)
开发者ID:hythloday,项目名称:pants,代码行数:18,代码来源:ivy_resolve.py

示例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()
开发者ID:arloherrine,项目名称:pants,代码行数:19,代码来源:ivy_resolve.py

示例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')
     )
开发者ID:harleyjcooper,项目名称:pants,代码行数:24,代码来源:test_export_integration.py

示例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')
开发者ID:aoen,项目名称:pants,代码行数:25,代码来源:ivy_resolve.py

示例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))
开发者ID:ankurgarg1986,项目名称:pants,代码行数:7,代码来源:ivy_utils.py

示例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)
开发者ID:WamBamBoozle,项目名称:pants,代码行数:7,代码来源:test_bootstrapper.py

示例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)
开发者ID:WamBamBoozle,项目名称:pants,代码行数:7,代码来源:test_bootstrapper.py

示例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)
开发者ID:Gointer,项目名称:pants,代码行数:8,代码来源:test_bootstrapper.py

示例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))
开发者ID:harleyjcooper,项目名称:pants,代码行数:7,代码来源:ivy_utils.py


注:本文中的pants.ivy.bootstrapper.Bootstrapper.instance方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。