chiark / gitweb /
Handle split path srclibs properly on buildserver
authorCiaran Gultnieks <ciaran@ciarang.com>
Thu, 20 Sep 2012 13:16:08 +0000 (14:16 +0100)
committerCiaran Gultnieks <ciaran@ciarang.com>
Thu, 20 Sep 2012 13:16:08 +0000 (14:16 +0100)
fdroidserver/build.py
fdroidserver/common.py

index 7c9e70a5a662d0ebd43c3d5a5afdc3e5fd2f84d6..f18b308c694da672a94d1a5d7cb8832e1c7e75eb 100644 (file)
@@ -179,14 +179,16 @@ def build_server(app, thisbuild, vcs, build_dir, output_dir, sdk_path):
         if thisbuild.has_key('srclibs'):
             for lib in thisbuild['srclibs'].split(';'):
                 name, _ = lib.split('@')
-                srclibpaths.append((name, common.getsrclib(lib, 'build/extlib', sdk_path)))
+                srclibpaths.append((name, common.getsrclib(lib, 'build/extlib', sdk_path, basepath=True)))
         # If one was used for the main source, add that too.
         basesrclib = vcs.getsrclib()
         if basesrclib:
             srclibpaths.append(basesrclib)
-        print "Sending srclibs:"
         for _, lib in srclibpaths:
+            print "Sending srclib '" + lib + "'"
             ftp.chdir('/home/vagrant/build/extlib')
+            if not os.path.exists(lib):
+                raise BuildException("Missing srclib directory '" + lib + "'")
             send_dir(lib)
 
         # Execute the build script...
index e7b62c9d81069251882e68d8d012021dc9befcd2..58d05bb8bfdda397244b0b9797e44ad455d87430 100644 (file)
@@ -843,10 +843,12 @@ class MetaDataException(Exception):
 
 
 # Get the specified source library.
-# Returns the path to it.
+# 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'.
 # TODO: These are currently just hard-coded in this method. It will be a
 # metadata-driven system eventually, but not yet.
-def getsrclib(spec, extlib_dir, sdk_path):
+def getsrclib(spec, extlib_dir, sdk_path, basepath=False):
     name, ref = spec.split('@')
 
     if name == 'GreenDroid':
@@ -866,6 +868,8 @@ def getsrclib(spec, extlib_dir, sdk_path):
             'update', 'project', '-p',
             libdir]) != 0:
             raise BuildException('Error updating ActionBarSherlock project')
+        if basepath:
+            return sdir
         return libdir
 
     if name == 'Amazing-ListView':
@@ -878,6 +882,8 @@ def getsrclib(spec, extlib_dir, sdk_path):
             'update', 'project', '-p',
             libdir]) != 0:
             raise BuildException('Error updating Amazing-ListView project')
+        if basepath:
+            return sdir
         return libdir
 
     if name == 'ViewPagerIndicator':
@@ -890,6 +896,8 @@ def getsrclib(spec, extlib_dir, sdk_path):
             'update', 'project', '-p',
             libdir]) != 0:
             raise BuildException('Error updating Android-ViewPagerIndicator project')
+        if basepath:
+            return sdir
         return libdir
 
     if name == 'UITableView':
@@ -902,6 +910,8 @@ def getsrclib(spec, extlib_dir, sdk_path):
             'update', 'project', '-p',
             libdir]) != 0:
             raise BuildException('Error updating UITableView project')
+        if basepath:
+            return sdir
         return libdir
 
     if name == 'ViewPagerTabs':
@@ -929,6 +939,8 @@ def getsrclib(spec, extlib_dir, sdk_path):
             'update', 'project', '-p',
             libdir]) != 0:
             raise BuildException('Error updating ActionBar project')
+        if basepath:
+            return sdir
         return libdir
 
     if name == 'ActionBarNW':
@@ -941,6 +953,8 @@ def getsrclib(spec, extlib_dir, sdk_path):
             'update', 'project', '-p',
             libdir]) != 0:
             raise BuildException('Error updating ActionBarNW project')
+        if basepath:
+            return sdir
         return libdir
 
     if name == 'FacebookSDK':
@@ -953,6 +967,8 @@ def getsrclib(spec, extlib_dir, sdk_path):
             'update', 'project', '-p',
             libdir]) != 0:
             raise BuildException('Error updating FacebookSDK project')
+        if basepath:
+            return sdir
         return libdir
 
     if name == 'OI':