chiark / gitweb /
Use build/srclib instead of build/extlib
authorDaniel Martí <mvdan@mvdan.cc>
Mon, 20 May 2013 11:34:03 +0000 (13:34 +0200)
committerDaniel Martí <mvdan@mvdan.cc>
Mon, 20 May 2013 11:34:03 +0000 (13:34 +0200)
fdroidserver/build.py
fdroidserver/common.py

index a8693aca31749b83636466454593144bca349c62..0c474179072d7c5547a7e4825044b6f6254d8710 100644 (file)
@@ -260,12 +260,12 @@ def build_server(app, thisbuild, vcs, build_dir, output_dir, sdk_path, force):
         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...
@@ -464,7 +464,7 @@ def build_local(app, thisbuild, vcs, build_dir, output_dir, extlib_dir, tmp_dir,
             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.
@@ -498,7 +498,7 @@ def trybuild(app, thisbuild, build_dir, output_dir, also_check_dir, extlib_dir,
 
         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
 
 
@@ -607,6 +607,7 @@ def main():
     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...
@@ -648,7 +649,7 @@ def main():
             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)
index a76e9e0104a69ff48c0b8e1c7ef2740fa8d6d28b..fca962a525efbceffb5924d44238ef28c0ec48b5 100644 (file)
@@ -347,8 +347,7 @@ class vcs_srclib(vcs):
 
     def gotorevisionx(self, rev):
 
-        # Yuk...
-        extlib_dir = 'build/extlib'
+        srclib_dir = 'build/srclib'
 
         if os.path.exists(self.local):
             shutil.rmtree(self.local)
@@ -358,7 +357,7 @@ class vcs_srclib(vcs):
         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)
@@ -951,7 +950,7 @@ def parse_srclib(metafile, **kw):
 # 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('@')
 
@@ -962,7 +961,8 @@ def getsrclib(spec, extlib_dir, sdk_path, basepath=False):
 
     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)
 
@@ -1002,6 +1002,8 @@ def getsrclib(spec, extlib_dir, sdk_path, basepath=False):
 #  '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
@@ -1013,7 +1015,7 @@ def getsrclib(spec, extlib_dir, sdk_path, basepath=False):
 #   '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:
@@ -1190,7 +1192,7 @@ def prepare_source(vcs, app, build, build_dir, extlib_dir, sdk_path, ndk_path, j
     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: