chiark / gitweb /
Added ability to build from svn without checking out the entire repo
authorCiaran Gultnieks <ciaran@ciarang.com>
Sun, 2 Jan 2011 11:27:50 +0000 (11:27 +0000)
committerCiaran Gultnieks <ciaran@ciarang.com>
Sun, 2 Jan 2011 11:27:50 +0000 (11:27 +0000)
README
build.py

diff --git a/README b/README
index 213f8faeb0f4629893eff5871528040d6b1df454..5e3f485ed204c689d7f4872e648c2b3de4484472 100644 (file)
--- a/README
+++ b/README
@@ -74,6 +74,13 @@ values are:
 
 The repository location. Usually a git: or svn: URL.
 
+Normally the repository is checked out once for the application, then moved
+to a particular revision/commit/tag for each build version. For an SVN
+repository though, this behaviour can be changed by appending a * to the
+repository URL - in this case the repository is checked out once per build
+version, with the subdir parameter in place of the *. This can be beneficial
+when dealing with very large SVN repositories.
+
 ==Build Version==
 
 Any number of these fields can be present, each specifying a version to
@@ -90,10 +97,13 @@ In addition to the three, always required, parameters described above,
 further parameters can be added (in name=value format) to apply further
 configuration to the build. These are:
 
- subdir=<path>   - specifies to build from a subdirectory of the checked out
-                   source code
- oldsdkloc=yes   - the sdk location in the repo is in an old format
- target=<target> - specifies a particular SDK target, when the source doesn't
+ subdir=<path>   - Specifies to build from a subdirectory of the checked out
+                   source code. Normally this directory is changed to before
+                  building, but there is a special case for SVN repositories
+                  where the URL is specified with a * at the end. See the
+                  documentation for the Repo field for more information.
+ oldsdkloc=yes   - The sdk location in the repo is in an old format
+ target=<target> - Specifies a particular SDK target, when the source doesn't
 
 Another example, using extra parameters:
 
index 55c719195b70a8eece332a3a9d149858cf829109..38cdb4a7c2dee57ef8f2117a619247a3be258985 100644 (file)
--- a/build.py
+++ b/build.py
@@ -68,9 +68,10 @@ for app in apps:
                 print "Git clone failed"
                 sys.exit(1)
         elif app['repotype'] == 'svn':
-            if subprocess.call(['svn', 'checkout', app['repo'], build_dir]) != 0:
-                print "Svn checkout failed"
-                sys.exit(1)
+            if not app['repo'].endswith("*"):
+                if subprocess.call(['svn', 'checkout', app['repo'], build_dir]) != 0:
+                    print "Svn checkout failed"
+                    sys.exit(1)
         else:
             print "Invalid repo type " + app['repotype'] + " in " + app['id']
             sys.exit(1)
@@ -81,7 +82,15 @@ for app in apps:
 
             # Optionally, the actual app source can be in a subdirectory...
             if thisbuild.has_key('subdir'):
-                root_dir = os.path.join(build_dir, thisbuild['subdir'])
+                if app['repotype'] == 'svn' and app['repo'].endswith("*"):
+                    root_dir = build_dir
+                    if subprocess.call(['svn', 'checkout',
+                            app['repo'][:-1] + thisbuild['subdir'],
+                            build_dir]) != 0:
+                        print "Svn checkout failed"
+                        sys.exit(1)
+                else:
+                    root_dir = os.path.join(build_dir, thisbuild['subdir'])
             else:
                 root_dir = build_dir