chiark / gitweb /
Support for submodules in build process
authorCiaran Gultnieks <ciaran@ciarang.com>
Sat, 15 Jan 2011 23:24:41 +0000 (23:24 +0000)
committerCiaran Gultnieks <ciaran@ciarang.com>
Sat, 15 Jan 2011 23:24:41 +0000 (23:24 +0000)
README
build.py

diff --git a/README b/README
index 9f72ecb5609f2b5bcc07e8ae328e3b2ded95a270..90390465634938200ef46fb50cf151aab80be49f 100644 (file)
--- a/README
+++ b/README
@@ -156,6 +156,9 @@ configuration to the build. These are:
                    build. Probably not useful for any other application.
  buildjni=yes      Enables building of native code via the ndk-build script before
                   doing the main ant build.
+ submodules=yes    Use if the project (git only) has submodules - causes git
+                  submodule init and update to be executed after the source is
+                  cloned.
 
 Another example, using extra parameters:
 
index bdb0a35a9c545c5f19be0622e2c7c240567d89b5..2710491b1f7a4934b7bbababb7281e63345a7903 100644 (file)
--- a/build.py
+++ b/build.py
@@ -176,6 +176,18 @@ for app in apps:
                         print "Invalid repo type " + app['repotype']
                         sys.exit(1)
 
+                # Initialise submodules if requred...
+                if (thisbuild.has_key('submodules') and
+                        thisbuild['submodules'] == "yes"):
+                        if subprocess.call(['git', 'submodule', 'init'],
+                                cwd=build_dir) != 0:
+                            print "Git submodule init failed"
+                            sys.exit(1)
+                        if subprocess.call(['git', 'submodule', 'update'],
+                                cwd=build_dir) != 0:
+                            print "Git submodule update failed"
+                            sys.exit(1)
+
                 # Generate (or update) the ant build file, build.xml...
                 if (not thisbuild.has_key('update')) or thisbuild['update'] == 'yes':
                     parms = ['android','update','project','-p','.']