本文整理汇总了Python中pants.contrib.node.tasks.node_resolve.NodeResolve.register_resolver_for_type方法的典型用法代码示例。如果您正苦于以下问题:Python NodeResolve.register_resolver_for_type方法的具体用法?Python NodeResolve.register_resolver_for_type怎么用?Python NodeResolve.register_resolver_for_type使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pants.contrib.node.tasks.node_resolve.NodeResolve
的用法示例。
在下文中一共展示了NodeResolve.register_resolver_for_type方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: register_goals
# 需要导入模块: from pants.contrib.node.tasks.node_resolve import NodeResolve [as 别名]
# 或者: from pants.contrib.node.tasks.node_resolve.NodeResolve import register_resolver_for_type [as 别名]
def register_goals():
NodeResolve.register_resolver_for_type(ScalaJSBinary, ScalaJSPlatform)
# NB: These task/goal assignments are pretty nuts, but are necessary in order to
# prevent product-graph cycles between the JVM and node.js.
# see https://github.com/pantsbuild/pants/labels/engine
task(name='scala-js-compile', action=ScalaJSZincCompile).install('resolve')
task(name='scala-js-link', action=ScalaJSLink).install('resolve')
示例2: test_register_resolver_for_type
# 需要导入模块: from pants.contrib.node.tasks.node_resolve import NodeResolve [as 别名]
# 或者: from pants.contrib.node.tasks.node_resolve.NodeResolve import register_resolver_for_type [as 别名]
def test_register_resolver_for_type(self):
NodeResolve._clear_resolvers()
self.assertIsNone(NodeResolve._resolver_for_target(NodePreinstalledModule))
self.assertIsNone(NodeResolve._resolver_for_target(NodeModule))
node_preinstalled__module_target = self.make_target(
spec=":empty_fake_node_preinstalled_module_target", target_type=NodePreinstalledModule
)
NodeResolve.register_resolver_for_type(NodePreinstalledModule, NodePreinstalledModuleResolver)
self.assertEqual(
NodePreinstalledModuleResolver, NodeResolve._resolver_for_target(node_preinstalled__module_target)
)
node_module_target = self.make_target(spec=":empty_fake_node_module_target", target_type=NodeModule)
NodeResolve.register_resolver_for_type(NodeModule, NpmResolver)
self.assertEqual(NpmResolver, NodeResolve._resolver_for_target(node_module_target))
示例3: register_options
# 需要导入模块: from pants.contrib.node.tasks.node_resolve import NodeResolve [as 别名]
# 或者: from pants.contrib.node.tasks.node_resolve.NodeResolve import register_resolver_for_type [as 别名]
def register_options(cls, register):
super(NpmResolver, cls).register_options(register)
register(
'--install-optional', type=bool, default=False, fingerprint=True,
help='If enabled, install optional dependencies.')
register(
'--install-production', type=bool, default=False, fingerprint=True,
help='If enabled, do not install devDependencies.')
register(
'--force', type=bool, default=False, fingerprint=True,
help='If enabled, refetch and resolve dependencies even if they are already built.')
register(
'--frozen-lockfile', type=bool, default=True, fingerprint=True,
help='If enabled, disallow automatic update of lock files.')
# There are cases where passed through options does not override hard-coded options.
# One example is for node-install, --frozen-lockfile=False is the dominate configuration
# as it allows the user to modify dependencies and generate a new lockfile.
# By turning on --force-option-override, the user accepts full responsibilities.
register(
'--force-option-override', type=bool, default=False, fingerprint=True, advanced=True,
help='If enabled, options will override hard-coded values. Be aware of default values.')
NodeResolve.register_resolver_for_type(NodeModule, cls)
示例4: setUp
# 需要导入模块: from pants.contrib.node.tasks.node_resolve import NodeResolve [as 别名]
# 或者: from pants.contrib.node.tasks.node_resolve.NodeResolve import register_resolver_for_type [as 别名]
def setUp(self):
super(NodeTestTest, self).setUp()
NodeResolve.register_resolver_for_type(NodeModule, NpmResolver)
示例5: register_options
# 需要导入模块: from pants.contrib.node.tasks.node_resolve import NodeResolve [as 别名]
# 或者: from pants.contrib.node.tasks.node_resolve.NodeResolve import register_resolver_for_type [as 别名]
def register_options(cls, register):
super(NodePreinstalledModuleResolver, cls).register_options(register)
NodeResolve.register_resolver_for_type(NodePreinstalledModule, cls)
示例6: setUp
# 需要导入模块: from pants.contrib.node.tasks.node_resolve import NodeResolve [as 别名]
# 或者: from pants.contrib.node.tasks.node_resolve.NodeResolve import register_resolver_for_type [as 别名]
def setUp(self):
super(NodeResolveSourceDepsTest, self).setUp()
NodeResolve.register_resolver_for_type(NodePreinstalledModule, NodePreinstalledModuleResolver)
NodeResolve.register_resolver_for_type(NodeModule, NpmResolver)
示例7: register_options
# 需要导入模块: from pants.contrib.node.tasks.node_resolve import NodeResolve [as 别名]
# 或者: from pants.contrib.node.tasks.node_resolve.NodeResolve import register_resolver_for_type [as 别名]
def register_options(cls, register):
super(NpmResolver, cls).register_options(register)
register(
'--install-optional', type=bool, default=False, fingerprint=True,
help='If enabled, install optional dependencies.')
NodeResolve.register_resolver_for_type(NodeModule, cls)
示例8: register_options
# 需要导入模块: from pants.contrib.node.tasks.node_resolve import NodeResolve [as 别名]
# 或者: from pants.contrib.node.tasks.node_resolve.NodeResolve import register_resolver_for_type [as 别名]
def register_options(cls, register):
register('--fetch-timeout-secs', type=int, advanced=True, default=10,
help='Timeout the fetch if the connection is idle for longer than this value.')
super(NodePreinstalledModuleResolver, cls).register_options(register)
NodeResolve.register_resolver_for_type(NodePreinstalledModule, cls)
示例9: register_options
# 需要导入模块: from pants.contrib.node.tasks.node_resolve import NodeResolve [as 别名]
# 或者: from pants.contrib.node.tasks.node_resolve.NodeResolve import register_resolver_for_type [as 别名]
def register_options(cls, register):
super(NpmResolver, cls).register_options(register)
NodeResolve.register_resolver_for_type(NodeModule, cls)
示例10: register_options
# 需要导入模块: from pants.contrib.node.tasks.node_resolve import NodeResolve [as 别名]
# 或者: from pants.contrib.node.tasks.node_resolve.NodeResolve import register_resolver_for_type [as 别名]
def register_options(cls, register):
NodeResolve.register_resolver_for_type(WebPackModule, cls)
NodeResolve.register_resolver_for_type(NpmResource, cls)
super(WebPackResolver, cls).register_options(register)