subprocess.call(['vagrant', 'suspend'], cwd='builder')
-def build_local(app, thisbuild, vcs, build_dir, output_dir, extlib_dir, tmp_dir, install, force, verbose=False):
+def build_local(app, thisbuild, vcs, build_dir, output_dir, srclib_dir, extlib_dir, tmp_dir, install, force, verbose=False):
"""Do a build locally."""
# Prepare the source code...
root_dir, srclibpaths = common.prepare_source(vcs, app, thisbuild,
- build_dir, extlib_dir, sdk_path, ndk_path,
+ build_dir, srclib_dir, extlib_dir, sdk_path, ndk_path,
javacc_path, mvn3, verbose)
# Scan before building...
os.path.join(output_dir, tarfilename))
-def trybuild(app, thisbuild, build_dir, output_dir, also_check_dir, extlib_dir,
+def trybuild(app, thisbuild, build_dir, output_dir, also_check_dir, srclib_dir, extlib_dir,
tmp_dir, repo_dir, vcs, test, server, install, force, verbose=False):
"""
Build a particular version of an application, if it needs building.
build_server(app, thisbuild, vcs, build_dir, output_dir, sdk_path, force)
else:
- build_local(app, thisbuild, vcs, build_dir, output_dir, extlib_dir, tmp_dir, install, force, verbose)
+ build_local(app, thisbuild, vcs, build_dir, output_dir, srclib_dir, extlib_dir, tmp_dir, install, force, verbose)
return True
if not os.path.isdir(build_dir):
print "Creating build directory"
os.makedirs(build_dir)
+ srclib_dir = os.path.join(build_dir, 'srclib')
extlib_dir = os.path.join(build_dir, 'extlib')
# Filter apps and build versions according to command-line options, etc...
wikilog = None
try:
if trybuild(app, thisbuild, build_dir, output_dir, also_check_dir,
- extlib_dir, tmp_dir, repo_dir, vcs, options.test,
+ srclib_dir, extlib_dir, tmp_dir, repo_dir, vcs, options.test,
options.server, options.install, options.force,
options.verbose):
build_succeeded.append(app)
def gotorevisionx(self, rev):
- # Yuk...
- extlib_dir = 'build/extlib'
+ srclib_dir = 'build/srclib'
if os.path.exists(self.local):
shutil.rmtree(self.local)
else:
srclib = self.remote
path = None
- libdir = getsrclib(srclib + '@' + rev, extlib_dir, self.sdk_path)
+ libdir = getsrclib(srclib + '@' + rev, srclib_dir, self.sdk_path)
self.srclib = (srclib, libdir)
if path:
libdir = os.path.join(libdir, path)
# Returns the path to it. Normally this is the path to be used when referencing
# it, which may be a subdirectory of the actual project. If you want the base
# directory of the project, pass 'basepath=True'.
-def getsrclib(spec, extlib_dir, sdk_path, basepath=False):
+def getsrclib(spec, srclib_dir, sdk_path, basepath=False):
name, ref = spec.split('@')
srclib = parse_srclib(srclib_path)
- sdir = os.path.join(extlib_dir, name)
+ sdir = os.path.join(srclib_dir, name)
+ print sdir
vcs = getvcs(srclib["Repo Type"], srclib["Repo"], sdir, sdk_path)
vcs.gotorevision(ref)
# 'build' - the build details from the metadata
# 'build_dir' - the path to the build directory, usually
# 'build/app.id'
+# 'srclib_dir' - the path to the source libraries directory, usually
+# 'build/srclib'
# 'extlib_dir' - the path to the external libraries directory, usually
# 'build/extlib'
# 'sdk_path' - the path to the Android SDK
# 'root' is the root directory, which may be the same as 'build_dir' or may
# be a subdirectory of it.
# 'srclibpaths' is information on the srclibs being used
-def prepare_source(vcs, app, build, build_dir, extlib_dir, sdk_path, ndk_path, javacc_path, mvn3, verbose=False):
+def prepare_source(vcs, app, build, build_dir, srclib_dir, extlib_dir, sdk_path, ndk_path, javacc_path, mvn3, verbose=False):
# Optionally, the actual app source can be in a subdirectory...
if 'subdir' in build:
if 'srclibs' in build:
for lib in build['srclibs'].split(';'):
name, _ = lib.split('@')
- srclibpaths.append((name, getsrclib(lib, extlib_dir, sdk_path)))
+ srclibpaths.append((name, getsrclib(lib, srclib_dir, sdk_path)))
basesrclib = vcs.getsrclib()
# If one was used for the main source, add that too.
if basesrclib: