1

我正在使用 Jenkins 进行持续合规,但我的 iOS 项目无法运行。我的应用程序以交互方式构建和运行得很好。RestKit 是我项目中的一个 git 子模块。

这项工作失败了:

CompileC build/testApp.build/Release-iphoneos/testApp.build/Objects-normal/armv7/main.o testApp/main.m normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler
cd /Users/bob/.jenkins/jobs/appNameOut-iOS/workspace/testApp
setenv LANG en_US.US-ASCII
setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x objective-c -arch armv7 -fmessage-length=0 -std=gnu99 -fobjc-arc -Wno-trigraphs -fpascal-strings -Os -Wno-missing-field-initializers -Wno-missing-prototypes -Wreturn-type -Wno-implicit-atomic-properties -Wno-receiver-is-weak -Wformat -Wno-missing-braces -Wparentheses -Wswitch -Wno-unused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wuninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wno-sign-compare -Wno-shorten-64-to-32 -Wpointer-sign -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wno-undeclared-selector -Wno-deprecated-implementations -DCONFIGURATION_Release -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk -Wprotocol -Wdeprecated-declarations -g -fvisibility=hidden -Wno-sign-conversion "-DIBOutlet=__attribute__((iboutlet))" "-DIBOutletCollection(ClassName)=__attribute__((iboutletcollection(ClassName)))" "-DIBAction=void)__attribute__((ibaction)" -miphoneos-version-min=5.0 -iquote /Users/bob/.jenkins/jobs/appNameOut-iOS/workspace/testApp/build/testApp.build/Release-iphoneos/testApp.build/testApp-generated-files.hmap -I/Users/bob/.jenkins/jobs/appNameOut-iOS/workspace/testApp/build/testApp.build/Release-iphoneos/testApp.build/testApp-own-target-headers.hmap -I/Users/bob/.jenkins/jobs/appNameOut-iOS/workspace/testApp/build/testApp.build/Release-iphoneos/testApp.build/testApp-all-target-headers.hmap -iquote /Users/bob/.jenkins/jobs/appNameOut-iOS/workspace/testApp/build/testApp.build/Release-iphoneos/testApp.build/testApp-project-headers.hmap -iquote../GMGridView/GMGridView -iquote/Users/bob/.jenkins/jobs/appNameOut-iOS/workspace/testApp/build/Release-iphoneos/../../Headers "-iquote”/Users/bob/.jenkins/jobs/appNameOut-iOS/workspace/testApp/build/Release-iphoneos/usr/local/lib/include”" "-iquote”/Users/bob/.jenkins/jobs/appNameOut-iOS/workspace/testApp/build/UninstalledProducts/include”" -I/Users/bob/.jenkins/jobs/appNameOut-iOS/workspace/testApp/build/Release-iphoneos/include -I../GMGridView/GMGridView -I/Users/bob/.jenkins/jobs/appNameOut-iOS/workspace/testApp/build/Release-iphoneos/../../Headers -I/Users/bob/.jenkins/jobs/appNameOut-iOS/workspace/testApp/build/testApp.build/../UninstalledProducts/include "-I”/Users/bob/.jenkins/jobs/appNameOut-iOS/workspace/testApp/build/UninstalledProducts/include”" "-I”/Users/bob/.jenkins/jobs/appNameOut-iOS/workspace/testApp/build/Release-iphoneos/usr/local/lib/include”" -I/Users/bob/.jenkins/jobs/appNameOut-iOS/workspace/testApp/build/testApp.build/Release-iphoneos/testApp.build/DerivedSources/armv7 -I/Users/bob/.jenkins/jobs/appNameOut-iOS/workspace/testApp/build/testApp.build/Release-iphoneos/testApp.build/DerivedSources -F/Users/bob/.jenkins/jobs/appNameOut-iOS/workspace/testApp/build/Release-iphoneos -F/Users/bob/.jenkins/jobs/appNameOut-iOS/workspace/testApp/QuincyKit -DNS_BLOCK_ASSERTIONS=1 -include /var/folders/zn/81z3gcmj00xg6rn2mg7qzgvh0000gn/C/com.apple.Xcode.501/SharedPrecompiledHeaders/testApp-Prefix-glmuagpwjeknolcbkgvqhsdakvok/testApp-Prefix.pch -MMD -MT dependencies -MF /Users/bob/.jenkins/jobs/appNameOut-iOS/workspace/testApp/build/testApp.build/Release-iphoneos/testApp.build/Objects-normal/armv7/main.d --serialize-diagnostics /Users/bob/.jenkins/jobs/appNameOut-iOS/workspace/testApp/build/testApp.build/Release-iphoneos/testApp.build/Objects-normal/armv7/main.dia -c /Users/bob/.jenkins/jobs/appNameOut-iOS/workspace/testApp/testApp/main.m -o /Users/bob/.jenkins/jobs/appNameOut-iOS/workspace/testApp/build/testApp.build/Release-iphoneos/testApp.build/Objects-normal/armv7/main.o
In file included from /Users/bob/.jenkins/jobs/appNameOut-iOS/workspace/testApp/testApp/main.m:11:
/Users/bob/.jenkins/jobs/appNameOut-iOS/workspace/testApp/testApp/AppDelegate.h:14:9: fatal error: 'RestKit/RestKit.h' file not found
#import <RestKit/RestKit.h>
    ^
1 error generated.
4

2 回答 2

1

事实证明,RestKit 子模块被正确拉出,并且 RestKit 正在正确构建,但是当通过命令行构建时,标题包含路径没有找到 RestKit 文件,而它确实通过 GUI 工作。我编辑了 pbxproj 文件,每当我找到此类内容的输入时添加所需的标头搜索路径。

于 2012-08-10T13:59:01.387 回答
0

在 xcode 构建步骤之前为 shell 命令添加一个新的构建步骤。把它贴进去:

git 子模块更新 --init --recursive

这个想法是这样的:假设“以交互方式运行得很好”意味着“当我在我的机器上使用 Xcode 构建它时它构建得很好,它在本地克隆了项目的 git 存储库”;看来您的本地 git clone 已检查了 restkit git 子模块。你的詹金斯工作没有。它在 git pull 之后永远不会更新子模块。为了在 Jenkins 中构建工作,它需要这样做。

于 2012-08-04T14:51:11.673 回答