本文整理汇总了Python中mozpack.manifests.InstallManifest.add_pattern_copy方法的典型用法代码示例。如果您正苦于以下问题:Python InstallManifest.add_pattern_copy方法的具体用法?Python InstallManifest.add_pattern_copy怎么用?Python InstallManifest.add_pattern_copy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mozpack.manifests.InstallManifest
的用法示例。
在下文中一共展示了InstallManifest.add_pattern_copy方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _manifest_for_project
# 需要导入模块: from mozpack.manifests import InstallManifest [as 别名]
# 或者: from mozpack.manifests.InstallManifest import add_pattern_copy [as 别名]
def _manifest_for_project(self, srcdir, project):
manifest = InstallManifest()
if project.manifest:
manifest.add_copy(mozpath.join(srcdir, project.manifest), 'AndroidManifest.xml')
if project.res:
manifest.add_symlink(mozpath.join(srcdir, project.res), 'res')
else:
# Eclipse expects a res directory no matter what, so we
# make an empty directory if the project doesn't specify.
res = os.path.abspath(mozpath.join(os.path.dirname(__file__),
'templates', 'android_eclipse_empty_resource_directory'))
manifest.add_pattern_copy(res, '.**', 'res')
if project.assets:
manifest.add_symlink(mozpath.join(srcdir, project.assets), 'assets')
for cpe in project._classpathentries:
manifest.add_symlink(mozpath.join(srcdir, cpe.srcdir), cpe.dstdir)
# JARs and native libraries go in the same place. For now, we're adding
# class path entries with the full path to required JAR files (which
# makes sense for JARs in the source directory, but probably doesn't for
# JARs in the object directory). This could be a problem because we only
# know the contents of (a subdirectory of) libs/ after a successful
# build and package, which is after build-backend time. At the cost of
# some flexibility, we explicitly copy certain libraries here; if the
# libraries aren't present -- namely, when the tree hasn't been packaged
# -- this fails. That's by design, to avoid crashes on device caused by
# missing native libraries.
for src, dst in project.libs:
manifest.add_copy(mozpath.join(srcdir, src), dst)
return manifest
示例2: _manifest_for_project
# 需要导入模块: from mozpack.manifests import InstallManifest [as 别名]
# 或者: from mozpack.manifests.InstallManifest import add_pattern_copy [as 别名]
def _manifest_for_project(self, srcdir, project):
manifest = InstallManifest()
if project.manifest:
manifest.add_copy(mozpath.join(srcdir, project.manifest), 'AndroidManifest.xml')
if project.res:
manifest.add_symlink(mozpath.join(srcdir, project.res), 'res')
else:
# Eclipse expects a res directory no matter what, so we
# make an empty directory if the project doesn't specify.
res = os.path.abspath(mozpath.join(os.path.dirname(__file__),
'templates', 'android_eclipse_empty_resource_directory'))
manifest.add_pattern_copy(res, '.**', 'res')
if project.assets:
manifest.add_symlink(mozpath.join(srcdir, project.assets), 'assets')
for cpe in project._classpathentries:
manifest.add_symlink(mozpath.join(srcdir, cpe.srcdir), cpe.dstdir)
# JARs and native libraries go in the same place. For now,
# we're adding class path entries with the full path to
# required JAR files (which makes sense for JARs in the source
# directory, but probably doesn't for JARs in the object
# directory). This could be a problem because we only know
# the contents of (a subdirectory of) libs/ after a successful
# build and package, which is after build-backend time. So we
# use a pattern symlink that is resolved at manifest install
# time.
if project.libs:
manifest.add_pattern_copy(mozpath.join(srcdir, project.libs), '**', 'libs')
return manifest
示例3: _manifest_for_project
# 需要导入模块: from mozpack.manifests import InstallManifest [as 别名]
# 或者: from mozpack.manifests.InstallManifest import add_pattern_copy [as 别名]
def _manifest_for_project(self, srcdir, project):
manifest = InstallManifest()
if project.manifest:
manifest.add_copy(mozpath.join(srcdir, project.manifest), 'AndroidManifest.xml')
if project.res:
manifest.add_symlink(mozpath.join(srcdir, project.res), 'res')
if project.assets:
manifest.add_symlink(mozpath.join(srcdir, project.assets), 'assets')
for cpe in project._classpathentries:
manifest.add_symlink(mozpath.join(srcdir, cpe.srcdir), cpe.dstdir)
# JARs and native libraries go in the same place. For now,
# we're adding class path entries with the full path to
# required JAR files (which makes sense for JARs in the source
# directory, but probably doesn't for JARs in the object
# directory). This could be a problem because we only know
# the contents of (a subdirectory of) libs/ after a successful
# build and package, which is after build-backend time. So we
# use a pattern symlink that is resolved at manifest install
# time.
if project.libs:
manifest.add_pattern_copy(mozpath.join(srcdir, project.libs), '**', 'libs')
return manifest
示例4: _get_test_manifest
# 需要导入模块: from mozpack.manifests import InstallManifest [as 别名]
# 或者: from mozpack.manifests.InstallManifest import add_pattern_copy [as 别名]
def _get_test_manifest(self):
m = InstallManifest()
m.add_symlink(self.tmppath('s_source'), 's_dest')
m.add_copy(self.tmppath('c_source'), 'c_dest')
m.add_preprocess(self.tmppath('p_source'), 'p_dest', self.tmppath('p_source.pp'), '#', {'FOO':'BAR', 'BAZ':'QUX'})
m.add_required_exists('e_dest')
m.add_optional_exists('o_dest')
m.add_pattern_symlink('ps_base', '*', 'ps_dest')
m.add_pattern_copy('pc_base', '**', 'pc_dest')
return m
示例5: _get_test_manifest
# 需要导入模块: from mozpack.manifests import InstallManifest [as 别名]
# 或者: from mozpack.manifests.InstallManifest import add_pattern_copy [as 别名]
def _get_test_manifest(self):
m = InstallManifest()
m.add_symlink(self.tmppath("s_source"), "s_dest")
m.add_copy(self.tmppath("c_source"), "c_dest")
m.add_preprocess(
self.tmppath("p_source"), "p_dest", self.tmppath("p_source.pp"), "#", {"FOO": "BAR", "BAZ": "QUX"}
)
m.add_required_exists("e_dest")
m.add_optional_exists("o_dest")
m.add_pattern_symlink("ps_base", "*", "ps_dest")
m.add_pattern_copy("pc_base", "**", "pc_dest")
return m
示例6: test_adds
# 需要导入模块: from mozpack.manifests import InstallManifest [as 别名]
# 或者: from mozpack.manifests.InstallManifest import add_pattern_copy [as 别名]
def test_adds(self):
m = InstallManifest()
m.add_symlink("s_source", "s_dest")
m.add_copy("c_source", "c_dest")
m.add_required_exists("e_dest")
m.add_optional_exists("o_dest")
m.add_pattern_symlink("ps_base", "ps/*", "ps_dest")
m.add_pattern_copy("pc_base", "pc/**", "pc_dest")
m.add_preprocess("p_source", "p_dest", "p_source.pp")
self.assertEqual(len(m), 7)
self.assertIn("s_dest", m)
self.assertIn("c_dest", m)
self.assertIn("p_dest", m)
self.assertIn("e_dest", m)
self.assertIn("o_dest", m)
with self.assertRaises(ValueError):
m.add_symlink("s_other", "s_dest")
with self.assertRaises(ValueError):
m.add_copy("c_other", "c_dest")
with self.assertRaises(ValueError):
m.add_preprocess("p_other", "p_dest", "p_other.pp")
with self.assertRaises(ValueError):
m.add_required_exists("e_dest")
with self.assertRaises(ValueError):
m.add_optional_exists("o_dest")
with self.assertRaises(ValueError):
m.add_pattern_symlink("ps_base", "ps/*", "ps_dest")
with self.assertRaises(ValueError):
m.add_pattern_copy("pc_base", "pc/**", "pc_dest")