Merge pull request #335 from kived/build-dirs
improve build directory handling, add values to default.spec
This commit is contained in:
commit
f200b836a9
2 changed files with 27 additions and 15 deletions
|
@ -129,8 +129,18 @@ class Buildozer(object):
|
||||||
'buildozer', 'log_level', '1'))
|
'buildozer', 'log_level', '1'))
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
self.builddir = self.config.getdefault('buildozer', 'builddir', None)
|
|
||||||
self.bin_apk_dir = self.config.getdefault('buildozer', 'bin_dir', None)
|
build_dir = self.config.getdefault('buildozer', 'builddir', None)
|
||||||
|
if build_dir:
|
||||||
|
# for backwards compatibility, append .buildozer to builddir
|
||||||
|
build_dir = join(build_dir, '.buildozer')
|
||||||
|
self.build_dir = self.config.getdefault('buildozer', 'build_dir', build_dir)
|
||||||
|
|
||||||
|
if self.build_dir:
|
||||||
|
self.build_dir = realpath(join(self.root_dir, self.build_dir))
|
||||||
|
self.user_bin_dir = self.config.getdefault('buildozer', 'bin_dir', None)
|
||||||
|
if self.user_bin_dir:
|
||||||
|
self.user_bin_dir = realpath(join(self.root_dir, self.user_bin_dir))
|
||||||
|
|
||||||
self.targetname = None
|
self.targetname = None
|
||||||
self.target = None
|
self.target = None
|
||||||
|
@ -414,7 +424,7 @@ class Buildozer(object):
|
||||||
|
|
||||||
if not exists(self.specfilename):
|
if not exists(self.specfilename):
|
||||||
print('No {0} found in the current directory. Abandon.'.format(
|
print('No {0} found in the current directory. Abandon.'.format(
|
||||||
self.specfilename))
|
self.specfilename))
|
||||||
exit(1)
|
exit(1)
|
||||||
|
|
||||||
# create global dir
|
# create global dir
|
||||||
|
@ -429,14 +439,11 @@ class Buildozer(object):
|
||||||
self.mkdir(self.applibs_dir)
|
self.mkdir(self.applibs_dir)
|
||||||
self.state = JsonStore(join(self.buildozer_dir, 'state.db'))
|
self.state = JsonStore(join(self.buildozer_dir, 'state.db'))
|
||||||
|
|
||||||
if self.targetname:
|
target = self.targetname
|
||||||
specdir = dirname(self.specfilename)
|
if target:
|
||||||
if self.builddir:
|
|
||||||
specdir = self.builddir
|
|
||||||
target = self.targetname
|
|
||||||
self.mkdir(join(self.global_platform_dir, target, 'platform'))
|
self.mkdir(join(self.global_platform_dir, target, 'platform'))
|
||||||
self.mkdir(join(specdir, '.buildozer', target, 'platform'))
|
self.mkdir(join(self.buildozer_dir, target, 'platform'))
|
||||||
self.mkdir(join(specdir, '.buildozer', target, 'app'))
|
self.mkdir(join(self.buildozer_dir, target, 'app'))
|
||||||
|
|
||||||
def check_application_requirements(self):
|
def check_application_requirements(self):
|
||||||
'''Ensure the application requirements are all available and ready to be
|
'''Ensure the application requirements are all available and ready to be
|
||||||
|
@ -824,18 +831,18 @@ class Buildozer(object):
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def root_dir(self):
|
def root_dir(self):
|
||||||
return realpath(join(dirname(self.specfilename)))
|
return realpath(dirname(self.specfilename))
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def buildozer_dir(self):
|
def buildozer_dir(self):
|
||||||
if self.builddir:
|
if self.build_dir:
|
||||||
return join(self.builddir, '.buildozer')
|
return self.build_dir
|
||||||
return join(self.root_dir, '.buildozer')
|
return join(self.root_dir, '.buildozer')
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def bin_dir(self):
|
def bin_dir(self):
|
||||||
if self.bin_apk_dir:
|
if self.user_bin_dir:
|
||||||
return self.bin_apk_dir
|
return self.user_bin_dir
|
||||||
return join(self.root_dir, 'bin')
|
return join(self.root_dir, 'bin')
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|
|
@ -182,6 +182,11 @@ log_level = 1
|
||||||
# (int) Display warning if buildozer is run as root (0 = False, 1 = True)
|
# (int) Display warning if buildozer is run as root (0 = False, 1 = True)
|
||||||
warn_on_root = 1
|
warn_on_root = 1
|
||||||
|
|
||||||
|
# (str) Path to build artifact storage, absolute or relative to spec file
|
||||||
|
# build_dir = ./.buildozer
|
||||||
|
|
||||||
|
# (str) Path to build output (i.e. .apk, .ipa) storage
|
||||||
|
# bin_dir = ./bin
|
||||||
|
|
||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
# List as sections
|
# List as sections
|
||||||
|
|
Loading…
Reference in a new issue