本文整理汇总了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]
示例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')])