chiark / gitweb /
Added 'init' to build options - as prebuild, but runs earlier
authorCiaran Gultnieks <ciaran@ciarang.com>
Sat, 4 Feb 2012 21:19:07 +0000 (21:19 +0000)
committerCiaran Gultnieks <ciaran@ciarang.com>
Sat, 4 Feb 2012 21:19:07 +0000 (21:19 +0000)
README
common.py

diff --git a/README b/README
index 33e27942e15fa166b5b0832d2946336dfb7acdf4..140b6a0d8fd166f3cc28036a8db0816c9462a125 100644 (file)
--- a/README
+++ b/README
@@ -186,6 +186,8 @@ configuration to the build. These are:
                    last character on a line to join that line with the next.
                    It has no special meaning in other contexts; in particular,
                    literal backslashes should not be escaped.
+ init=xxxx        As for 'prebuild', but runs on the source code BEFORE any
+                  other processing takes place.
  novcheck=yes      Don't check that the version name and code in the resulting
                    apk are correct by looking at the build output - assume the
                    metadata is correct. This takes away a useful level of
index 57f41ec6f2d1eca991518d81fff54b83e9d126ba..e88bf5517494086aec1d6216d854c0bb775581b7 100644 (file)
--- a/common.py
+++ b/common.py
@@ -651,6 +651,12 @@ def prepare_source(vcs, app, build, build_dir, extlib_dir, sdk_path, ndk_path, j
     if build.get('submodules', 'no')  == 'yes':
         vcs.initsubmodules()
 
+    # Run an init command if one is required...
+    if build.has_key('init'):
+        init = build['init']
+        if subprocess.call(init, cwd=root_dir, shell=True) != 0:
+            raise BuildException("Error running init command")
+
     # Generate (or update) the ant build file, build.xml...
     if (build.get('update', 'yes') == 'yes' and
         not build.has_key('maven')):