【问题标题】:How to run Grunt tasks during Xcode build phase?如何在 Xcode 构建阶段运行 Grunt 任务?
【发布时间】:2012-12-28 05:56:53
【问题描述】:

我正在开发一个 Web 应用程序,其中包括 GruntJS 构建任务。我在 Xcode IDE 中使用 Phonegap/Cordova 部署它。

我想将 grunt 构建过程集成到我的 Xcode 项目中以简化项目的运行。理想情况下,Xcode 应该预先运行我使用 Grunt CLI 手动调用的所有进程。

我的 Gruntfile.js 位于 Xcode 项目的根目录中。我在 node_modules 中有一个本地 grunt 安装(0.4.0rc4),并且全局安装了 grunt-cli。

project
- multiple project dirs ...
- node_modules
- www-src
- www
  project.xcodeproj
  Gruntfile.js

我尝试使用一个像“grunt”这样简单的命令向我的 Xcode 项目添加自定义运行脚本 - 构建阶段,该命令在构建过程中返回“grunt: command not found”。显然需要更多的努力来引用 grunt 和/或正确的目标目录。

【问题讨论】:

标签: xcode cordova build gruntjs


【解决方案1】:

很好的设置 Gregor :-) 我之前的项目有完全相同的设置。以下是我在 Xcode Build Phases 中设置自定义脚本的方式:

cd "${PROJECT_DIR}"
PATH=${PATH}:/usr/local/bin
grunt

希望这对你有帮助:-)

【讨论】:

    猜你喜欢
    • 2020-09-04
    • 1970-01-01
    • 2015-10-18
    • 2010-11-24
    • 2013-02-23
    • 2010-11-23
    • 2015-01-18
    • 2014-04-18
    • 1970-01-01
    相关资源
    最近更新 更多