本文整理汇总了Python中pants.backend.jvm.subsystems.shader.Shading.create_zap_package方法的典型用法代码示例。如果您正苦于以下问题:Python Shading.create_zap_package方法的具体用法?Python Shading.create_zap_package怎么用?Python Shading.create_zap_package使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pants.backend.jvm.subsystems.shader.Shading
的用法示例。
在下文中一共展示了Shading.create_zap_package方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_rules_file
# 需要导入模块: from pants.backend.jvm.subsystems.shader import Shading [as 别名]
# 或者: from pants.backend.jvm.subsystems.shader.Shading import create_zap_package [as 别名]
def test_rules_file(self):
expected = [
'rule a.b.c.** [email protected]\n',
'rule a.*.b [email protected]\n',
'rule x.y.z.** [email protected]\n',
'zap com.foo.bar.Main\n',
'zap com.baz.*\n',
'keep org.foobar.vegetable.Potato\n',
'keep org.foobar.fruit.**\n',
]
rules = [
Shading.create_relocate('a.b.c.**', '[email protected]'),
Shading.create_relocate('a.*.b', shade_prefix='shaded.'),
Shading.create_relocate_package('x.y.z', shade_prefix='shaded.'),
Shading.create_zap('com.foo.bar.Main'),
Shading.create_zap_package('com.baz', recursive=False),
Shading.create_keep('org.foobar.vegetable.Potato'),
Shading.create_keep_package('org.foobar.fruit'),
]
with self.shader.temporary_rules_file(rules) as fname:
with open(fname, 'r') as f:
received = f.readlines()
self.assertEqual(received, expected)
示例2: test_rules_file
# 需要导入模块: from pants.backend.jvm.subsystems.shader import Shading [as 别名]
# 或者: from pants.backend.jvm.subsystems.shader.Shading import create_zap_package [as 别名]
def test_rules_file(self):
expected = [
"rule a.b.c.** [email protected]\n",
"rule a.*.b [email protected]\n",
"rule x.y.z.** [email protected]\n",
"zap com.foo.bar.Main\n",
"zap com.baz.*\n",
"keep org.foobar.vegetable.Potato\n",
"keep org.foobar.fruit.**\n",
]
rules = [
Shading.create_relocate("a.b.c.**", "[email protected]"),
Shading.create_relocate("a.*.b", shade_prefix="shaded."),
Shading.create_relocate_package("x.y.z", shade_prefix="shaded."),
Shading.create_zap("com.foo.bar.Main"),
Shading.create_zap_package("com.baz", recursive=False),
Shading.create_keep("org.foobar.vegetable.Potato"),
Shading.create_keep_package("org.foobar.fruit"),
]
with self.shader.temporary_rules_file(rules) as fname:
with open(fname, "r") as f:
received = f.readlines()
self.assertEqual(received, expected)
示例3: test_zap_package
# 需要导入模块: from pants.backend.jvm.subsystems.shader import Shading [as 别名]
# 或者: from pants.backend.jvm.subsystems.shader.Shading import create_zap_package [as 别名]
def test_zap_package(self):
self.assertEqual(('zap', 'com.foo.bar.**'), Shading.create_zap_package('com.foo.bar', True))
self.assertEqual(('zap', 'com.foo.bar.*'), Shading.create_zap_package('com.foo.bar', False))
示例4: test_zap_package
# 需要导入模块: from pants.backend.jvm.subsystems.shader import Shading [as 别名]
# 或者: from pants.backend.jvm.subsystems.shader.Shading import create_zap_package [as 别名]
def test_zap_package(self):
self.assertEqual(("zap", "com.foo.bar.**"), Shading.create_zap_package("com.foo.bar", True))
self.assertEqual(("zap", "com.foo.bar.*"), Shading.create_zap_package("com.foo.bar", False))