Suggestion: exit with non-zero code when Android build fails
I tried to automate the titanium_mobile build process to automatically extract the generated zip file in my preferred location on a successful build, but the build was returning success regardless. I modified the code as follows:
diff --git a/site_scons/ant.py b/site_scons/ant.py
index ee4f69f..29b918b 100644
--- a/site_scons/ant.py
+++ b/site_scons/ant.py
@@ -38,4 +38,6 @@ def build(script='build.xml', target='', properties={}):
ant_cmd.append(target)
print " ".join(ant_cmd)
- subprocess.Popen(ant_cmd, shell=False).wait()
+ ret = subprocess.Popen(ant_cmd, shell=False).wait()
+ if ret:
+ sys.exit(ret)
1 Answer
-
Accepted Answer
Added Ticket 865
Just a note. On *nix systems. I put a symlink from the mobilesdk folder width a name like
dev-1.3.0
to thetitanium_mobile/dist
location so that all I have to do is unzip it in place. It also prevents the version number from conflicting with a true release build. If Developer already thinks you have 1.3.0 it would give you the update notice for the official one.Odin01:osx dthorp$ pwd /Users/dthorp/Library/Application Support/Titanium/mobilesdk/osx Odin01:osx dthorp$ ls -l dev-1.3.0 lrwxr-xr-x 1 dthorp staff 76 May 2 22:20 dev-1.3.0 -> /Users/dthorp/projects/appcelerator/titanium_mobile/dist/mobilesdk/osx/1.3.0