bin_dir option is added to the spec file

This commit is contained in:
Jabba Laci 2016-01-24 19:45:55 +01:00
parent 83a44887b5
commit 38f80ab5e4

View file

@ -130,6 +130,7 @@ class Buildozer(object):
except: except:
pass pass
self.builddir = self.config.getdefault('buildozer', 'builddir', None) self.builddir = self.config.getdefault('buildozer', 'builddir', None)
self.bin_apk_dir = self.config.getdefault('buildozer', 'bin_dir', None)
self.targetname = None self.targetname = None
self.target = None self.target = None
@ -417,17 +418,18 @@ class Buildozer(object):
self.mkdir(self.global_buildozer_dir) self.mkdir(self.global_buildozer_dir)
self.mkdir(self.global_cache_dir) self.mkdir(self.global_cache_dir)
# create local dir # create local .buildozer/ dir
specdir = dirname(self.specfilename) self.mkdir(self.buildozer_dir)
if self.builddir: # create local bin/ dir
specdir = self.builddir self.mkdir(self.bin_dir)
self.mkdir(join(specdir, '.buildozer'))
self.mkdir(join(specdir, 'bin'))
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: if self.targetname:
specdir = dirname(self.specfilename)
if self.builddir:
specdir = self.builddir
target = self.targetname 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(specdir, '.buildozer', target, 'platform'))
@ -818,8 +820,8 @@ class Buildozer(object):
@property @property
def bin_dir(self): def bin_dir(self):
if self.builddir: if self.bin_apk_dir:
return join(self.builddir, 'bin') return join(self.bin_apk_dir, 'bin')
return join(self.root_dir, 'bin') return join(self.root_dir, 'bin')
@property @property