MCPcopy Index your code
hub / github.com/kivy/python-for-android / assemble_distribution

Method assemble_distribution

pythonforandroid/bootstrap.py:204–234  ·  view source on GitHub ↗

Assemble the distribution by copying files and creating Python bundle. This default implementation works for most bootstraps. Override _assemble_distribution_for_arch() for per-arch customization, or override this entire method for fundamentally different behavior.

(self)

Source from the content-addressed store, hash-verified

202 self.fry_eggs(site_packages_dir)
203
204 def assemble_distribution(self):
205 """Assemble the distribution by copying files and creating Python bundle.
206
207 This default implementation works for most bootstraps. Override
208 _assemble_distribution_for_arch() for per-arch customization, or
209 override this entire method for fundamentally different behavior.
210 """
211 info_main(f'# Creating Android project ({self.name})')
212
213 rmdir(self.dist_dir)
214 shprint(sh.cp, '-r', self.build_dir, self.dist_dir)
215
216 with current_directory(self.dist_dir):
217 with open('local.properties', 'w') as fileh:
218 fileh.write('sdk.dir={}'.format(self.ctx.sdk_dir))
219
220 with current_directory(self.dist_dir):
221 info('Copying Python distribution')
222
223 self.distribute_javaclasses(self.ctx.javaclass_dir,
224 dest_dir=join("src", "main", "java"))
225
226 for arch in self.ctx.archs:
227 self._assemble_distribution_for_arch(arch)
228
229 if 'sqlite3' not in self.ctx.recipe_build_order:
230 with open('blacklist.txt', 'a') as fileh:
231 fileh.write('\nsqlite3/*\nlib-dynload/_sqlite3.so\n')
232
233 self._copy_in_final_files()
234 self.distribution.save_info(self.dist_dir)
235
236 @classmethod
237 def all_bootstraps(cls):

Callers 3

build_dist_from_argsFunction · 0.45

Calls 9

_copy_in_final_filesMethod · 0.95
info_mainFunction · 0.90
rmdirFunction · 0.90
shprintFunction · 0.90
current_directoryFunction · 0.90
formatMethod · 0.80
save_infoMethod · 0.80

Tested by 2