chiark / gitweb /
Added ability to run ndk build script if the ant build doesn't do it
authorCiaran Gultnieks <ciaran@ciarang.com>
Mon, 10 Jan 2011 08:31:35 +0000 (08:31 +0000)
committerCiaran Gultnieks <ciaran@ciarang.com>
Mon, 10 Jan 2011 08:31:35 +0000 (08:31 +0000)
README
build.py

diff --git a/README b/README
index 48ef06f13f0ceb820337ef59794b020c60d174d2..ea618ea1ce6ea4509598a6441497453eb6172705 100644 (file)
--- a/README
+++ b/README
@@ -147,6 +147,8 @@ configuration to the build. These are:
                   that.
  initfun=yes      Enables a selection of mad hacks to make com.funambol.android
                    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.
 
 Another example, using extra parameters:
 
index 27b667bb5f1ea031d07ae16f09029f3471d3a3c7..2813041da529d8f6884df8a526b0028065079b1c 100644 (file)
--- a/build.py
+++ b/build.py
@@ -326,6 +326,17 @@ for app in apps:
                 tarball.add(build_dir, tarname)
                 tarball.close()
 
+                # Build native stuff if required...
+                if thisbuild.has_key('buildjni') and thisbuild['buildjni'] == 'yes':
+                    ndkbuild = os.path.join(ndk_path, "ndk-build")
+                    p = subprocess.Popen([ndkbuild], cwd=root_dir,
+                            stdout=subprocess.PIPE)
+                    output = p.communicate()[0]
+                    if p.returncode != 0:
+                        print output
+                        print "NDK build failed"
+                        sys.exit(1)
+
                 # Build the release...
                 if thisbuild.has_key('antcommand'):
                     antcommand = thisbuild['antcommand']
@@ -338,6 +349,7 @@ for app in apps:
                     print output
                     print "Build failed"
                     sys.exit(1)
+                print "Build successful"
 
                 # Find the apk name in the output...
                 if thisbuild.has_key('bindir'):