[SVN] Xcode bundle - run_xcodebuild.sh

Kelan Champagne kelan at mac.com
Sun Aug 12 03:15:55 UTC 2007


Hi-

I ran into a problem with the run_xocdebuild.sh script (in the Xcode  
bundle) where it wasn't respecting my value for $TM_BUILDSTYLE.  I  
traced it to line 54 of the script, wherethe awk command was  
hardcoded to match on "Build styles" (instead of "Build  
Configurations" that have been used since xcode 2.1).

Here is the diff of the fix I came up with (also attached as a zipped  
patch file, and here: http://pastie.textmate.org/86926):
54c54
< 	if [[ -d $PROJECT_FILE ]] && xcodebuild -project "$PROJECT_FILE" - 
list | awk 'display == "yes" { sub(/^[ \t]+/, ""); print }; /^Build  
styles/ { display = "yes" }' | grep -F "${BUILD_STYLE}" &>/dev/null;  
then
---
 > 	if [[ -d $PROJECT_FILE ]] && xcodebuild -project "$PROJECT_FILE" - 
list | awk 'display == "yes" { sub(/^[ \t]+/, ""); print }; /Build  
Configurations:/ { display = "yes" }; /^\s*$/ { display = "no" }' |  
grep -F "$TM_BUILDSTYLE" 2>/dev/null; then


A few notes:
1) I'm not sure how it was for Build Styles, but the line that says  
"Build Configurations" is indented, so I took out the ^ in that regex.
2) I changed the output redirect on the grep from &> to 2>, because  
it was redirecting all output to /dev/null
3) I put another command in the awk script because $ xcodebuild -list  
is outputting a line at the end (after the list of Build  
Configurations) that says "If no build configuration is specified  
"Release" is used.", and that was coming through and being matched by  
the grep when I set $TM_BUILDSTYLE to "Release"  (which is what I'm  
trying to do).  I'm not sure if that would actually cause a problem,  
but I figured it couldn't hurt to be more correct.
4) The $USE_CONFIGURATIONS variable could probably be used to make it  
also work for older versions of xcode.  I didn't do this because I  
thought my changes would be clearer this way, and I dont have an old  
version of xcode to test it on, so I'm not sure what $ xcodebuild - 
list outputs for it.  Also, xcodebuild will convert any project it  
opens (even to just do a -list), so I wasn't sure if it was necessary.

Let me know what you think, or if you have any questions.

Thanks,
-Kelan



-------------- next part --------------
A non-text attachment was scrubbed...
Name: run_xcodebuild.patch.zip
Type: application/zip
Size: 415 bytes
Desc: not available
URL: <http://lists.macromates.com/textmate-dev/attachments/20070811/c6f7403b/attachment.zip>


More information about the textmate-dev mailing list