xcode - 无法从 Textmate 构建 XCode 4 项目

标签 xcode xcode4 textmate xcodebuild textmatebundles

我在 TextMate 中打开了一个新创建的 XCode 4 项目(按照手册的建议,将项目文件夹拖放到 TextMate 图标上),并尝试使用 Command-B 快捷方式构建它,并选择 2 进行 XCode 构建。我收到以下错误

xcodebuild: error: invalid option '-activebuildstyle'
Usage: xcodebuild [-project <projectname>] [[-target <targetname>]...|-alltargets] [-configuration <configurationname>] [-arch <architecture>]... [-sdk [<sdkname>|<sdkpath>]] [<buildsetting>=<value>]... [<buildaction>]...
       xcodebuild -workspace <workspacename> -scheme <schemeName> [-configuration <configurationname>] [-arch <architecture>]... [-sdk [<sdkname>|<sdkpath>]] [<buildsetting>=<value>]... [<buildaction>]...
       xcodebuild -version [-sdk [<sdkfullpath>|<sdkname>] [<infoitem>] ]
       xcodebuild -list [[-project <projectname>]|[-workspace <workspacename>]]
       xcodebuild -showsdks
Options:
    -usage                print full usage
    -verbose              provide additional status output
    -project NAME         build the project NAME
.
.
.
.

知道在哪里可以修改正在运行的指定“-activebuildstyle”选项的命令吗?

该命令似乎位于 TextMate.app/Contents/SharedSupport/Bundles/Xcode.tmbundle/Support/run_xcodebuild.sh

第 57/60 行有“-activebuildstyle”(STYLEARGNAME 变量在第 36 行设置)。

当然,这可能只是一系列 xcode 4/textmate 兼容性问题中的一个错误。

最佳答案

您想要修改/Applications/TextMate.app/Contents/SharedSupport/Bundles/Xcode.tmbundle/Support/bin/xcode_version.rb 以检测 xcode 4,请替换此行

@@xcode2dot1_or_later = (version_match != nil && ...

这样:

xcode4 = /Xcode 4\./.match(version_str)
@@xcode2dot1_or_later = xcode4 || (version_match != nil && ...

您还想修改/Applications/TextMate.app/Contents/SharedSupport/Bundles/Xcode.tmbundle/Support/bin/run_xcodebuild.sh (我注释掉的都是原文)

if [[ -n $TM_BUILDSTYLE ]]; then    
    # 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|Configurations)/ { display = "yes" }' |    grep -F "${BUILD_STYLE}" &>/dev/null; then
        BUILD_STYLE="-$STYLEARGNAME $BUILD_STYLE";
    else
        # BUILD_STYLE="-active$STYLEARGNAME"
        BUILD_STYLE=""
    fi
else
    # BUILD_STYLE="-active$STYLEARGNAME"
    BUILD_STYLE=""
fi 

关于xcode - 无法从 Textmate 构建 XCode 4 项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6313638/

相关文章:

iphone - 为什么在尝试安装 Ad-Hoc 构建时会出现 "could not be added to your itunes library because it is not a valid app"错误?

ios - 在 Main.storyboard 和 AppDelegate.h 之间建立联系

debugging - 使用 Xcode 4 在 iphone4 设备中调试时如何指定 arm6?

parsing - 文本编辑器中的语法分析

ios - 将用于 Objective-C 的 Google API 客户端库添加到 Xcode 项目

ios - 按下 TabBarItem 时执行操作

visual-studio - 如何将 Sublime Text 语法高亮文件转换为 visual studio 的 textmate 语法?

textmate - Ruby 1.9 哈希语法的 bundle ,或者修改现有匹配的方法?

ios - 带 Cocoapods 的 SocketRocket 出错

ios - 无法在 Xcode 7.2 上使用 Swift 在设备上构建(与供应配置文件无关)