From 1ba027e85d22bc9843c51a260cdc0180b843fe10 Mon Sep 17 00:00:00 2001 From: Mathieu Virbel Date: Wed, 19 Dec 2012 18:27:28 +0100 Subject: [PATCH] avoid multiple execution of build() and prepare_for_build() method --- buildozer/__init__.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/buildozer/__init__.py b/buildozer/__init__.py index d6d0fe8..2e34b09 100644 --- a/buildozer/__init__.py +++ b/buildozer/__init__.py @@ -349,6 +349,9 @@ class Buildozer(object): self.target.run_commands(args) def prepare_for_build(self): + if hasattr(self.target, '_build_prepared'): + return + self.log('Preparing build') self.log('Ensure build layout') @@ -366,13 +369,22 @@ class Buildozer(object): self.log('Compile platform') self.target.compile_platform() + # flag to prevent multiple build + self.target._build_prepared = True + def build(self): + if hasattr(self.target, '_build_done'): + return + self.log('Build the application') self.build_application() self.log('Package the application') self.target.build_package() + # flag to prevent multiple build + self.target._build_done = True + def cmd_init(self, *args): '''Create a initial buildozer.spec in the current directory '''