@@ -93,8 +93,7 @@ def require_prebuilt_dist(func):
93
93
def wrapper_func (self , args ):
94
94
ctx = self .ctx
95
95
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 ,
98
97
user_ndk_dir = self .ndk_dir ,
99
98
user_android_api = self .android_api ,
100
99
user_ndk_ver = self .ndk_version )
@@ -298,6 +297,7 @@ def __init__(self):
298
297
if args .debug :
299
298
logger .setLevel (logging .DEBUG )
300
299
self .storage_dir = args .storage_dir
300
+ self .ctx .setup_dirs (self .storage_dir )
301
301
self .sdk_dir = args .sdk_dir
302
302
self .ndk_dir = args .ndk_dir
303
303
self .android_api = args .android_api
@@ -423,7 +423,7 @@ def clean_dists(self, args):
423
423
parser = argparse .ArgumentParser (
424
424
description = "Delete any distributions that have been built." )
425
425
args = parser .parse_args (args )
426
- ctx = Context ()
426
+ ctx = self . ctx
427
427
if exists (ctx .dist_dir ):
428
428
shutil .rmtree (ctx .dist_dir )
429
429
@@ -438,7 +438,7 @@ def clean_builds(self, args):
438
438
parser = argparse .ArgumentParser (
439
439
description = "Delete all build files (but not download caches)" )
440
440
args = parser .parse_args (args )
441
- ctx = Context ()
441
+ ctx = self . ctx
442
442
# if exists(ctx.dist_dir):
443
443
# shutil.rmtree(ctx.dist_dir)
444
444
if exists (ctx .build_dir ):
@@ -476,7 +476,7 @@ def clean_download_cache(self, args):
476
476
parser = argparse .ArgumentParser (
477
477
description = "Delete all download caches" )
478
478
args = parser .parse_args (args )
479
- ctx = Context ()
479
+ ctx = self . ctx
480
480
if exists (ctx .packages_path ):
481
481
shutil .rmtree (ctx .packages_path )
482
482
@@ -641,7 +641,7 @@ def print_context_info(self, args):
641
641
python-for-android will internally use for package building, along
642
642
with information about where the Android SDK and NDK will be called
643
643
from.'''
644
- ctx = Context ()
644
+ ctx = self . ctx
645
645
for attribute in ('root_dir' , 'build_dir' , 'dist_dir' , 'libs_dir' ,
646
646
'ccache' , 'cython' , 'sdk_dir' , 'ndk_dir' ,
647
647
'ndk_platform' , 'ndk_ver' , 'android_api' ):
@@ -661,7 +661,7 @@ def dists(self, args):
661
661
def distributions (self , args ):
662
662
'''Lists all distributions currently available (i.e. that have already
663
663
been built).'''
664
- ctx = Context ()
664
+ ctx = self . ctx
665
665
dists = Distribution .get_distributions (ctx )
666
666
667
667
if dists :
0 commit comments