如何限制“运行脚本"?构建阶段到我的发布配置? [英] How can I limit a "Run Script" build phase to my release configuration?

查看:82
本文介绍了如何限制“运行脚本"?构建阶段到我的发布配置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个shell脚本,我想在目标的构建阶段结束时运行它.但是,我希望仅在使用 release 配置进行构建时才运行此脚本.如何才能做到这一点?谢谢!

I have a shell script that I would like to run at the end of my target's build phase. However, I would like this script to only run when I build with the release configuration. How can this be done? Thanks!

推荐答案

if [ "${CONFIGURATION}" = "Release" ]; then
  echo Do something really release-like
fi

该脚本将在每个配置的末尾运行,但是在这种情况下,除非配置为Release(假设它所做的一切都包含在测试块中),否则它将不会执行任何操作.

The script will run at the end of every configuration, but it won't do anything in this case unless the configuration is Release (assuming everything it does is contained within the test block).

这篇关于如何限制“运行脚本"?构建阶段到我的发布配置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆