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

Method clean_build

pythonforandroid/recipe.py:639–669  ·  view source on GitHub ↗

Deletes all the build information of the recipe. If arch is not None, only this arch dir is deleted. Otherwise (the default) all builds for all archs are deleted. By default, this just deletes the main build dir. If the recipe has e.g. object files biglinked, or .so

(self, arch=None)

Source from the content-addressed store, hash-verified

637 self.unpack(arch)
638
639 def clean_build(self, arch=None):
640 '''Deletes all the build information of the recipe.
641
642 If arch is not None, only this arch dir is deleted. Otherwise
643 (the default) all builds for all archs are deleted.
644
645 By default, this just deletes the main build dir. If the
646 recipe has e.g. object files biglinked, or .so files stored
647 elsewhere, you should override this method.
648
649 This method is intended for testing purposes, it may have
650 strange results. Rebuild everything if this seems to happen.
651
652 '''
653 if arch is None:
654 base_dir = join(self.ctx.build_dir, 'other_builds', self.name)
655 else:
656 base_dir = self.get_build_container_dir(arch)
657 dirs = glob.glob(base_dir + '-*')
658 if exists(base_dir):
659 dirs.append(base_dir)
660 if not dirs:
661 warning('Attempted to clean build for {} but found no existing '
662 'build dirs'.format(self.name))
663
664 for directory in dirs:
665 rmdir(directory)
666
667 # Delete any Python distributions to ensure the recipe build
668 # doesn't persist in site-packages
669 rmdir(self.ctx.python_installs_dir)
670
671 def install_libs(self, arch, *libs):
672 libs_dir = self.ctx.get_libs_dir(arch.arch)

Callers 2

clean_buildMethod · 0.45
clean_recipe_buildMethod · 0.45

Calls 3

rmdirFunction · 0.90
formatMethod · 0.80

Tested by

no test coverage detected