添加脚本文件到X code存档 [英] Adding script files to an Xcode archive

查看:244
本文介绍了添加脚本文件到X code存档的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有我的目标是运行脚本阶段呈现一个PDF手册。我想包括本手册中的产品我的X code归档。

我如何知道从脚本哪些文件在归档阶段添加到其档案X code吗?

目前,该脚本在BUILT_PRODUCTS_DIR的PDF的地方,但是这似乎没有足够了。

  xsltproc的-o>(FOP -fo  -  -pdf$ BUILT_PRODUCTS_DIR / DOC / $ TARGET_NAME.pdf)\\
    --stringparam use.extensions 0 \\
    --stringparam fop1.extensions 1 \\
    --stringparam draft.mode没有\\
    --stringparam admon.graphics 1 \\
    --stringparam admon.graphics.extension .SVG \\
    /opt/local/share/xsl/docbook-xsl/fo/docbook.xsl \\
    $ TARGET_NAME / manual.xml


解决方案

您可以添加后生成脚本存档操作,使用ARCHIVE_PRODUCTS_PATH环境变量。


  1. 选择产品菜单>编辑方案

  2. 展开存档动作

  3. 添加一个动作后运行脚本:

      CP/路径/要/一些/文件$ {} ARCHIVE_PRODUCTS_PATH / somefile


您的文件将被列入档案,可以通过显示归档包内容,或共享档案的建立产品的看到它。

您可以看到所有可用的环境变量中加入一个运行run脚本 printenv 然后选中在SYSTEM.LOG控制台应用程序的输出。

I have a "Run Script" phase on my target that renders a PDF manual. I want to include this manual in my Xcode archive of the product.

How do I tell Xcode from a script what files to add to its archive during the Archive phase?

Currently, the script places the PDF in BUILT_PRODUCTS_DIR, but this appears not to suffice.

xsltproc -o >(fop -fo - -pdf "$BUILT_PRODUCTS_DIR/doc/$TARGET_NAME.pdf") \                                                                                                                                                       
    --stringparam use.extensions 0 \ 
    --stringparam fop1.extensions 1 \ 
    --stringparam draft.mode no \
    --stringparam admon.graphics 1 \ 
    --stringparam admon.graphics.extension .svg \
    /opt/local/share/xsl/docbook-xsl/fo/docbook.xsl \
    "$TARGET_NAME/manual.xml"

解决方案

You can add a post build script to the Archive action, using the ARCHIVE_PRODUCTS_PATH environment variable.

  1. Select the Product menu > Edit Scheme
  2. Expand the Archive action
  3. Add a post action run script:

    cp "/path/to/some/file" "${ARCHIVE_PRODUCTS_PATH}/somefile"
    

Your file will be included in the archive, you can see it by showing the package contents of the archive, or sharing the built products of the archive.

You can see all the environment variables available by adding a run script that runs printenv then checking the output in the Console application in system.log.

这篇关于添加脚本文件到X code存档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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