Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moved build command to source bundle. Not sure which scope it should …
…have? Maybe just “source”, which makes it default for sources, but allow language overides. git-svn-id: http://svn.textmate.org/trunk/Bundles/Source.tmbundle@1059 dfb7d73b-c2ec-0310-8fea-fb051d288c6d
- Loading branch information
Showing
3 changed files
with
741 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>beforeRunningCommand</key> | ||
<string>saveModifiedFiles</string> | ||
<key>command</key> | ||
<string># this command calls xcodebuild giving the name of the project | ||
# directory as the project to build and parses the output for | ||
# file/line information then plays a succes/failure sample | ||
# based on the final outcome | ||
# if there is no TM project, scan up the parent directories looking for an Xcode project | ||
if [[ -n $TM_XCODE_PROJECT ]]; then | ||
cd "$TM_DIRECTORY" | ||
PROJECT_FILE="$TM_XCODE_PROJECT" | ||
elif [[ -z $TM_PROJECT_FILEPATH ]]; then | ||
if [[ -d $TM_PROJECT_DIRECTORY ]]; then | ||
cd "$TM_PROJECT_DIRECTORY" | ||
else | ||
cd "$TM_DIRECTORY" | ||
fi | ||
PROJECT_FILE="" | ||
until [[ `pwd` == "/" ]]; | ||
do | ||
Projects=`ls -d *.{xcode,pbproj} 2>/dev/null` | ||
if [[ -n $Projects ]]; then | ||
# Make sure we only got one project | ||
if ! echo -n $Projects | grep [[:space:]] &>/dev/null; then | ||
PROJECT_FILE=$Projects | ||
fi | ||
break | ||
fi | ||
cd .. | ||
done | ||
else | ||
cd "$TM_PROJECT_DIRECTORY" | ||
PROJECT_FILE=$(basename ${TM_PROJECT_FILEPATH%.tmproj}) | ||
if [[ -d "${PROJECT_FILE}.xcode" ]]; then | ||
PROJECT_FILE=${PROJECT_FILE}.xcode | ||
elif [[ -d "${PROJECT_FILE}.pbproj" ]]; then | ||
PROJECT_FILE=${PROJECT_FILE}.pbproj | ||
fi | ||
fi | ||
BUILD_STYLE="${TM_BUILDSTYLE:-Deployment}" | ||
# If we have an Xcode project, and it doesn't contain the build style we're looking for, | ||
# accept the active build style in the project. | ||
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 | ||
BUILD_STYLE="-buildstyle $BUILD_STYLE"; | ||
else | ||
BUILD_STYLE="-activebuildstyle" | ||
fi | ||
export PROJECT_FILE | ||
xcodebuild ${PROJECT_FILE:+-project "$PROJECT_FILE"} $BUILD_STYLE 2>&1| ruby -- "${TM_BUNDLE_PATH}/bin/format_build.rb" | ||
</string> | ||
<key>input</key> | ||
<string>none</string> | ||
<key>keyEquivalent</key> | ||
<string>@b</string> | ||
<key>name</key> | ||
<string>Build (using xcodebuild)</string> | ||
<key>output</key> | ||
<string>showAsHTML</string> | ||
<key>scope</key> | ||
<string>source.c, source.objc</string> | ||
<key>uuid</key> | ||
<string>9656317E-73EB-11D9-9848-000D93589AF6</string> | ||
</dict> | ||
</plist> |
Oops, something went wrong.