什么是一些很好的Xcode脚本来加速开发?

什么是一些很好的Xcode脚本来加速开发?,第1张

概述Xcode允许您创建自动化脚本来执行重复任务.你写了什么脚本来加快发展? 我为我的 JSON.Framework for Cocoa and the iPhone创建了三个.它们处理以下内容: >使用动态嵌入式框架,自定义iPhone SDK,API文档和一些文档文件创建一个版本的磁盘映像. >在源代码上运行Doxygen以创建一个兼容Xcode的文档集并进行安装.这意味着当您在Xcode的文档搜 Xcode允许您创建自动化脚本来执行重复任务.你写了什么脚本来加快发展?解决方法 我为我的 JSON.Framework for Cocoa and the iPhone创建了三个.它们处理以下内容:

>使用动态嵌入式框架,自定义iPhone SDK,api文档和一些文档文件创建一个版本的磁盘映像.
>在源代码上运行Doxygen以创建一个兼容Xcode的文档集并进行安装.这意味着当您在Xcode的文档搜索中搜索文档时,您的文档也可以找到.
>在源代码上运行Doxygen以更新源代码树本身的api文档的签入版本.如果您使用Subversion(它假定),那么文档总是最新的,那么这是非常简单的.如果您在Google代码中托管,那么这很棒.

请注意以下一些硬编码的项目特定值.我不想通过编辑这些脚本来破坏脚本.这些是从Xcode中的自定义脚本阶段启动的.您可以看到如何将它们集成到上面链接的项目的Xcode项目中.

Creatediskimage.sh:

#!/bin/shset -x# Determine the project name and versionVERS=$(agvtool mvers -terse1)# Derived namesVolname=${PROJECT}_${VERS}disK_IMAGE=$BUILD_DIR/$VolnamedisK_IMAGE_file=$INSTALL_DIR/$Volname.dmg# Remove old targetsrm -f $disK_IMAGE_filetest -d $disK_IMAGE && chmod -R +w $disK_IMAGE && rm -rf $disK_IMAGEmkdir -p $disK_IMAGE# Create the Embedded framework and copy it to the disk image.xcodebuild -target JsON -configuration Release install || exit 1cp -p -R $INSTALL_DIR/../Frameworks/$PROJECT.framework $disK_IMAGEIPHONE_SDK=2.2.1# Create the iPhone SDK directly in the disk image folder.xcodebuild -target libJson -configuration Release -sdk iphoneos$IPHONE_SDK install \    ARCHS=armv6 \    DSTROOT=$disK_IMAGE/SDKs/JsON/iphoneos.sdk || exit 1sed -e "s/%PROJECT%/$PROJECT/g" \    -e "s/%VERS%/$VERS/g" \    -e "s/%IPHONE_SDK%/$IPHONE_SDK/g" \    $SOURCE_ROOT/Resources/iphoneos.sdk/SDKSettings.pList > $disK_IMAGE/SDKs/JsON/iphoneos.sdk/SDKSettings.pList || exit 1xcodebuild -target libJson -configuration Release -sdk iphonesimulator$IPHONE_SDK install \    ARCHS=i386 \    DSTROOT=$disK_IMAGE/SDKs/JsON/iphonesimulator.sdk || exit 1sed -e "s/%PROJECT%/$PROJECT/g" \    -e "s/%VERS%/$VERS/g" \    -e "s/%IPHONE_SDK%/$IPHONE_SDK/g" \    $SOURCE_ROOT/Resources/iphonesimulator.sdk/SDKSettings.pList > $disK_IMAGE/SDKs/JsON/iphonesimulator.sdk/SDKSettings.pList || exit 1    # Allow linking statically into normal OS X appsxcodebuild -target libJson -configuration Release -sdk macosx10.5 install \    DSTROOT=$disK_IMAGE/SDKs/JsON/macosx.sdk || exit 1# copy the source verbatim into the disk image.cp -p -R $SOURCE_ROOT/Source $disK_IMAGE/$PROJECTrm -rf $disK_IMAGE/$PROJECT/.svn# Create the documentationxcodebuild -target documentation -configuration Release install || exit 1cp -p -R $INSTALL_DIR/documentation/HTML $disK_IMAGE/documentationrm -rf $disK_IMAGE/documentation/.svncat <<HTML > $disK_IMAGE/documentation.HTML<!DOCTYPE HTML PUBliC "-//W3C//DTD HTML 4.01 Transitional//EN"><HTML><head><Meta http-equiv="Content-Type" content="text/HTML;charset=UTF-8"><script type="text/JavaScript"><!--window.location = "documentation/index.HTML"//--></script></head><body><p>Aw,shucks! I trIEd to redirect you to the <a href="documentaton/index.HTML">API documentation</a> but obvIoUsly Failed. Please find it yourself. </p></body></HTML>HTMLcp -p $SOURCE_ROOT/README $disK_IMAGEcp -p $SOURCE_ROOT/Credits.rtf $disK_IMAGEcp -p $SOURCE_ROOT/Install.rtf $disK_IMAGEcp -p $SOURCE_ROOT/Changes.rtf $disK_IMAGEhdiutil create -fs HFS+ -volname $Volname -srcfolder $disK_IMAGE $disK_IMAGE_file

Installdocumentation.sh:

#!/bin/sh# See also http://developer.apple.com/tools/creatingdocsetswithdoxygen.HTML set -xVERSION=$(agvtool mvers -terse1)DOXYfile=$DERIVED_fileS_DIR/doxygen.configDOXYGEN=/Applications/Doxygen.app/Contents/Resources/doxygenDOCSET=$INSTALL_DIR/Docsetrm -rf $DOCSETmkdir -p $DOCSET || exit 1mkdir -p $DERIVED_fileS_DIR || exit 1if ! test -x $DOXYGEN ; then    echo "*** Install Doxygen to get documentation generated for you automatically ***"    exit 1fi# Create a doxygen configuration file with only the settings we care about$DOXYGEN -g - > $DOXYfilecat <<EOF >> $DOXYfilePROJECT_name           = $FulL_PRODUCT_namePROJECT_NUMBER         = $VERSIONOUTPUT_DIRECTORY       = $DOCSETinput                  = $SOURCE_ROOT/Sourcefile_PATTERNS          = *.h *.mHIDE_UNDOC_MEMBERS     = YESHIDE_UNDOC_CLASSES     = YESHIDE_UNDOC_RELATIONS   = YESREPEAT_BRIEF           = NOCASE_SENSE_nameS       = YESINliNE_@R_502_5107@ED_MEMB  = YESSHOW_fileS             = NOSHOW_INCLUDE_fileS     = NOGENERATE_LATEX         = NOGENERATE_HTML          = YESGENERATE_DOCSET        = YESDOCSET_Feedname        = "$PROJECT.framework API documentation"DOCSET_BUNDLE_ID       = org.brautaset.$PROJECTEOF#  Run doxygen on the updated config file.#  doxygen creates a Makefile that does most of the heavy lifting.$DOXYGEN $DOXYfile#  make will invoke docsetutil. Take a look at the Makefile to see how this is done.make -C $DOCSET/HTML install#  Construct a temporary applescript file to tell Xcode to load a docset.rm -f $TEMP_DIR/loadDocSet.scptcat <<EOF > $TEMP_DIR/loadDocSet.scpttell application "Xcode"    load documentation set with path "/Users/$USER/library/Developer/Shared/documentation/DocSets/org.brautaset.${PROJECT}.docset/"end tellEOF# Run the load-docset applescript command.osascript $TEMP_DIR/loadDocSet.scpt

Regeneratedocumentation.sh:

#!/bin/sh# See also http://developer.apple.com/tools/creatingdocsetswithdoxygen.HTML set -xVERSION=$(agvtool mvers -terse1)DOXYfile=$DERIVED_fileS_DIR/doxygen.configDOXYGEN=/Applications/Doxygen.app/Contents/Resources/doxygenDOCSET=$INSTALL_DIR/documentationAPIDOCDIR=$SOURCE_ROOT/documentationrm -rf $DOCSETmkdir -p $DOCSET || exit 1mkdir -p $DERIVED_fileS_DIR || exit 1if ! test -x $DOXYGEN ; then    echo "*** Install Doxygen to get documentation generated for you automatically ***"    exit 1fi# Create a doxygen configuration file with only the settings we care about$DOXYGEN -g - > $DOXYfilecat <<EOF >> $DOXYfilePROJECT_name           = $FulL_PRODUCT_namePROJECT_NUMBER         = $VERSIONOUTPUT_DIRECTORY       = $DOCSETinput                  = $SOURCE_ROOT/Sourcefile_PATTERNS          = *.h *.mHIDE_UNDOC_MEMBERS     = YESHIDE_UNDOC_CLASSES     = YESHIDE_UNDOC_RELATIONS   = YESREPEAT_BRIEF           = NOCASE_SENSE_nameS       = YESINliNE_@R_502_5107@ED_MEMB  = YESSHOW_fileS             = NOSHOW_INCLUDE_fileS     = NOGENERATE_LATEX         = NOGENERATE_HTML          = YESGENERATE_DOCSET        = NOEOF#  Run doxygen on the updated config file.$DOXYGEN $DOXYfile# Replace the old dir with the newly generated one.rm -f $APIDOCDIR/*cp -p $DOCSET/HTML/* $APIDOCDIRcd $APIDOCDIR# Revert files that differ only in the timestamp.svn diff *.HTML | diffstat | awk ' == 2 { print  }' | xargs svn revert# Add/remove files from subversion.svn st | awk '     == "?" { print "svn add", }     == "!" { print "svn delete", }' | sh -svn propset svn:mime-type text/HTML *.HTMLsvn propset svn:mime-type text/CSS *.CSSsvn propset svn:mime-type image/png *.pngsvn propset svn:mime-type image/gif *.gif
总结

以上是内存溢出为你收集整理的什么是一些很好的Xcode脚本来加速开发?全部内容,希望文章能够帮你解决什么是一些很好的Xcode脚本来加速开发?所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/web/1057000.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-25
下一篇 2022-05-25

发表评论

登录后才能评论

评论列表(0条)

保存