@@ -93,8 +93,7 @@ def require_prebuilt_dist(func):
9393 def wrapper_func (self , args ):
9494 ctx = self .ctx
9595 ctx .set_archs (self ._archs )
96- ctx .prepare_build_environment (storage_dir = self .storage_dir ,
97- user_sdk_dir = self .sdk_dir ,
96+ ctx .prepare_build_environment (user_sdk_dir = self .sdk_dir ,
9897 user_ndk_dir = self .ndk_dir ,
9998 user_android_api = self .android_api ,
10099 user_ndk_ver = self .ndk_version )
@@ -298,6 +297,7 @@ def __init__(self):
298297 if args .debug :
299298 logger .setLevel (logging .DEBUG )
300299 self .storage_dir = args .storage_dir
300+ self .ctx .setup_dirs (self .storage_dir )
301301 self .sdk_dir = args .sdk_dir
302302 self .ndk_dir = args .ndk_dir
303303 self .android_api = args .android_api
@@ -423,7 +423,7 @@ def clean_dists(self, args):
423423 parser = argparse .ArgumentParser (
424424 description = "Delete any distributions that have been built." )
425425 args = parser .parse_args (args )
426- ctx = Context ()
426+ ctx = self . ctx
427427 if exists (ctx .dist_dir ):
428428 shutil .rmtree (ctx .dist_dir )
429429
@@ -438,7 +438,7 @@ def clean_builds(self, args):
438438 parser = argparse .ArgumentParser (
439439 description = "Delete all build files (but not download caches)" )
440440 args = parser .parse_args (args )
441- ctx = Context ()
441+ ctx = self . ctx
442442 # if exists(ctx.dist_dir):
443443 # shutil.rmtree(ctx.dist_dir)
444444 if exists (ctx .build_dir ):
@@ -476,7 +476,7 @@ def clean_download_cache(self, args):
476476 parser = argparse .ArgumentParser (
477477 description = "Delete all download caches" )
478478 args = parser .parse_args (args )
479- ctx = Context ()
479+ ctx = self . ctx
480480 if exists (ctx .packages_path ):
481481 shutil .rmtree (ctx .packages_path )
482482
@@ -641,7 +641,7 @@ def print_context_info(self, args):
641641 python-for-android will internally use for package building, along
642642 with information about where the Android SDK and NDK will be called
643643 from.'''
644- ctx = Context ()
644+ ctx = self . ctx
645645 for attribute in ('root_dir' , 'build_dir' , 'dist_dir' , 'libs_dir' ,
646646 'ccache' , 'cython' , 'sdk_dir' , 'ndk_dir' ,
647647 'ndk_platform' , 'ndk_ver' , 'android_api' ):
@@ -661,7 +661,7 @@ def dists(self, args):
661661 def distributions (self , args ):
662662 '''Lists all distributions currently available (i.e. that have already
663663 been built).'''
664- ctx = Context ()
664+ ctx = self . ctx
665665 dists = Distribution .get_distributions (ctx )
666666
667667 if dists :
0 commit comments