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


Python ScalaPlatform.versioned_tool_name方法代码示例

本文整理汇总了Python中pants.backend.jvm.subsystems.scala_platform.ScalaPlatform.versioned_tool_name方法的典型用法代码示例。如果您正苦于以下问题:Python ScalaPlatform.versioned_tool_name方法的具体用法?Python ScalaPlatform.versioned_tool_name怎么用?Python ScalaPlatform.versioned_tool_name使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pants.backend.jvm.subsystems.scala_platform.ScalaPlatform的用法示例。


在下文中一共展示了ScalaPlatform.versioned_tool_name方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _fetch_tool_jar_from_scalac_classpath

# 需要导入模块: from pants.backend.jvm.subsystems.scala_platform import ScalaPlatform [as 别名]
# 或者: from pants.backend.jvm.subsystems.scala_platform.ScalaPlatform import versioned_tool_name [as 别名]
 def _fetch_tool_jar_from_scalac_classpath(self, products, jar_name):
   scala_version = ScalaPlatform.global_instance().version
   classpath = self.tool_classpath_from_products(products,
                                                 ScalaPlatform.versioned_tool_name('scalac', scala_version),
                                                 scope=self.options_scope)
   candidates = [jar for jar in classpath if jar_name in jar]
   assert(len(candidates) == 1)
   return candidates[0]
开发者ID:cosmicexplorer,项目名称:pants,代码行数:10,代码来源:zinc.py

示例2: register_options

# 需要导入模块: from pants.backend.jvm.subsystems.scala_platform import ScalaPlatform [as 别名]
# 或者: from pants.backend.jvm.subsystems.scala_platform.ScalaPlatform import versioned_tool_name [as 别名]
    def register_options(cls, register):
      super(Zinc.Factory, cls).register_options(register)

      zinc_rev = '1.0.3'

      shader_rules = [
          # The compiler-interface and compiler-bridge tool jars carry xsbt and
          # xsbti interfaces that are used across the shaded tool jar boundary so
          # we preserve these root packages wholesale along with the core scala
          # APIs.
          Shader.exclude_package('scala', recursive=True),
          Shader.exclude_package('xsbt', recursive=True),
          Shader.exclude_package('xsbti', recursive=True),
          # Unfortunately, is loaded reflectively by the compiler.
          Shader.exclude_package('org.apache.logging.log4j', recursive=True),
        ]

      cls.register_jvm_tool(register,
                            Zinc.ZINC_BOOTSTRAPPER_TOOL_NAME,
                            classpath=[
                              JarDependency('org.pantsbuild', 'zinc-bootstrapper_2.11', '0.0.4'),
                            ],
                            main=Zinc.ZINC_BOOTSTRAPER_MAIN,
                            custom_rules=shader_rules,
                          )

      cls.register_jvm_tool(register,
                            Zinc.ZINC_COMPILER_TOOL_NAME,
                            classpath=[
                              JarDependency('org.pantsbuild', 'zinc-compiler_2.11', '0.0.9'),
                            ],
                            main=Zinc.ZINC_COMPILE_MAIN,
                            custom_rules=shader_rules)

      cls.register_jvm_tool(register,
                            'compiler-bridge',
                            classpath=[
                              ScalaJarDependency(org='org.scala-sbt',
                                                name='compiler-bridge',
                                                rev=zinc_rev,
                                                classifier='sources',
                                                intransitive=True),
                            ])

      cls.register_jvm_tool(register,
                            'compiler-interface',
                            classpath=[
                              JarDependency(org='org.scala-sbt',
                                            name='compiler-interface',
                                            rev=zinc_rev),
                            ],
                            # NB: We force a noop-jarjar'ing of the interface, since it is now
                            # broken up into multiple jars, but zinc does not yet support a sequence
                            # of jars for the interface.
                            main='no.such.main.Main',
                            custom_rules=shader_rules)

      cls.register_jvm_tool(register,
                            Zinc.ZINC_EXTRACTOR_TOOL_NAME,
                            classpath=[
                              JarDependency('org.pantsbuild', 'zinc-extractor_2.11', '0.0.6')
                            ])

      # Register scalac for fixed versions of Scala, 2.10, 2.11 and 2.12.
      # Relies on ScalaPlatform to get the revision version from the major.minor version.
      # The tool with the correct scala version will be retrieved later,
      # taking the user-passed option into account.
      supported_scala_versions=['2.10', '2.11', '2.12']
      wanted_jars = ['scala-compiler', 'scala-library', 'scala-reflect']
      for scala_version in supported_scala_versions:
        cls.register_jvm_tool(register,
                              ScalaPlatform.versioned_tool_name('scalac', scala_version),
                              classpath=[
                                ScalaPlatform.create_jardep(jar, scala_version) for jar in wanted_jars
                              ])

      # Register custom scalac tool.
      cls.register_jvm_tool(register,
                            ScalaPlatform.versioned_tool_name('scalac', 'custom'),
                            classpath=[JarDependency('missing spec', ' //:scalac')])
开发者ID:cosmicexplorer,项目名称:pants,代码行数:82,代码来源:zinc.py


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