Skip to content

Commit

Permalink
Moved build command to source bundle. Not sure which scope it should …
Browse files Browse the repository at this point in the history
…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
sorbits committed May 23, 2005
1 parent ccfd0ec commit 4f04f89
Show file tree
Hide file tree
Showing 3 changed files with 741 additions and 0 deletions.
74 changes: 74 additions & 0 deletions Commands/Build.plist
@@ -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&gt;/dev/null`
if [[ -n $Projects ]]; then
# Make sure we only got one project
if ! echo -n $Projects | grep [[:space:]] &amp;&gt;/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 ]] &amp;&amp; xcodebuild -project "$PROJECT_FILE" -list | awk 'display == "yes" { sub(/^[ \t]+/, ""); print }; /^Build styles/ { display = "yes" }' | grep -F "${BUILD_STYLE}" &amp;&gt;/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&gt;&amp;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>

0 comments on commit 4f04f89

Please sign in to comment.