Returns an instance of a bootstrap with the given name. This is the only way you should access a bootstrap class, as it sets the bootstrap directory correctly.
(cls, name, ctx)
| 346 | |
| 347 | @classmethod |
| 348 | def get_bootstrap(cls, name, ctx): |
| 349 | '''Returns an instance of a bootstrap with the given name. |
| 350 | |
| 351 | This is the only way you should access a bootstrap class, as |
| 352 | it sets the bootstrap directory correctly. |
| 353 | ''' |
| 354 | if name is None: |
| 355 | return None |
| 356 | if not hasattr(cls, 'bootstraps'): |
| 357 | cls.bootstraps = {} |
| 358 | if name in cls.bootstraps: |
| 359 | return cls.bootstraps[name] |
| 360 | mod = importlib.import_module('pythonforandroid.bootstraps.{}' |
| 361 | .format(name)) |
| 362 | if len(logger.handlers) > 1: |
| 363 | logger.removeHandler(logger.handlers[1]) |
| 364 | bootstrap = mod.bootstrap |
| 365 | bootstrap.bootstrap_dir = join(ctx.root_dir, 'bootstraps', name) |
| 366 | bootstrap.ctx = ctx |
| 367 | return bootstrap |
| 368 | |
| 369 | def distribute_libs(self, arch, src_dirs, wildcard='*', dest_dir="libs"): |
| 370 | '''Copy existing arch libs from build dirs to current dist dir.''' |