Xcode 可以在构建时将版本号插入到库的文件名中吗? [英] Can Xcode insert the version number into a library's filename when building?

查看:32
本文介绍了Xcode 可以在构建时将版本号插入到库的文件名中吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我正在构建一个名为 Awesome 的动态库,Xcode 会将构建的产品输出为 libAwesome.dylib.有没有办法让 Xcode 插入文件名,以便将其构建为 libAwesome.1.0.0.dylib?

If I am building a dynamic library called Awesome, Xcode outputs the built product as libAwesome.dylib. Is there a way to have Xcode insert the filename, so it gets built as libAwesome.1.0.0.dylib?

推荐答案

将您的 Product Name 设置为 Awesome.${DYLIB_CURRENT_VERSION}.

DYLIB_CURRENT_VERSION 由构建设置中的 Current Library Version 设置.

DYLIB_CURRENT_VERSION is set by Current Library Version in the build settings.

哦,要查看所有这些环境变量的列表,只需创建一个新的Run Script Build Phase,将其留空,但选中在构建日志中显示环境变量"框,然后然后构建.如果您显示该构建阶段的日志,它将显示所有环境变量及其值.然后你就可以像上面一样使用它们了.

Oh, and to see a list of all such environment variables, just make a new Run Script Build Phase, leave it empty, but check the "Show environment variables in build log" box, and then build. If you show the log for that build phase, it'll show all the environment variables along with their values. And then you can use them in the same way as above.

这篇关于Xcode 可以在构建时将版本号插入到库的文件名中吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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