From 2f182febfb14d8895aa89863149599d2fc044dc0 Mon Sep 17 00:00:00 2001 From: Ciaran Gultnieks Date: Fri, 13 Jan 2012 12:28:11 +0000 Subject: [PATCH] Allow for subdirectories being present only in relevant commit --- common.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/common.py b/common.py index 262208d1..358ba824 100644 --- a/common.py +++ b/common.py @@ -555,8 +555,6 @@ def prepare_source(vcs, app, build, build_dir, sdk_path, ndk_path, javacc_path, # Optionally, the actual app source can be in a subdirectory... if build.has_key('subdir'): root_dir = os.path.join(build_dir, build['subdir']) - if not os.path.exists(root_dir): - raise BuildException('Missing subdir ' + root_dir) else: root_dir = build_dir @@ -564,6 +562,11 @@ def prepare_source(vcs, app, build, build_dir, sdk_path, ndk_path, javacc_path, print "Resetting repository to " + build['commit'] vcs.reset(build['commit']) + # Check that a subdir (if we're using one) exists. This has to happen + # after the checkout, since it might not exist elsewhere... + if not os.path.exists(root_dir): + raise BuildException('Missing subdir ' + root_dir) + # Initialise submodules if requred... if build.get('submodules', 'no') == 'yes': vcs.initsubmodules() -- 2.30.2