Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switched library to use bootstrapped library formatting #1

Merged
merged 2 commits into from May 30, 2013

Conversation

orta
Copy link
Contributor

@orta orta commented May 23, 2013

I've moved your app for bootstrapping your library into another folder and given it a podfile that refers to the library behind it locally, this means you can edit the files in that app and the changes will be accurately reflected in git. Also made that fix mentioned in SO re prefix headers.

@seanoshea
Copy link
Owner

Wow - never had a SO question answered with a pull request. Thanks for taking the time to look into this.

Tried cloning the repo you forked and executed the following:

unknown98d6bb7ec333:ios-etsy-sdk osheas$ cd bootstrap/
unknown98d6bb7ec333:bootstrap osheas$ pod install
Analyzing dependencies

CocoaPods 0.20.1 is available.

Fetching podspec for `ios-etsy-sdk` from `../`
Downloading dependencies
Installing AFNetworking (1.2.1)
Installing Kiwi (2.1)
Installing ios-etsy-sdk (1.0)
Generating Pods project
Integrating client project

[!] From now on use `ios-etsy-sdk.xcworkspace`.

Opened up the .xcworkspace file and the library seems to build ok. I see the usual Pods and ios-etsy-sdk projects in the workspace. However, if I try to run the tests for ios-etsy-sdk, I just get errors saying that a .pch file is missing:

/Users/osheas/dev/github/orta/ios-etsy-sdk/bootstrap/<command line>:3:10:     '/Users/osheas/Library/Developer/Xcode/DerivedData/ios-etsy-sdk-bxzshebezqubhyfyaoovgdujbbba/Build/Intermediates/PrecompiledHeaders/ios-etsy-sdk-Prefix-cnopwgruxvkkgfchcxcsetpgzjjm/ios-etsy-sdk-Prefix.pch' file not found

Do I need to clean up the project file's reference to ios-etsy-sdk-Prefix.pch before importing the pods? Or, should the ios-etsy-sdk-Prefix.pch be still included in the project, but just have no references to the global import?

Thanks for your help again,

Sean

@orta
Copy link
Contributor Author

orta commented May 23, 2013

I didn't look at porting the tests. I removed the pch file in exchange for having it added via the podspec itself, but might have been too vigilant. You might need to look at creating a new one for the tests, or referring to the apps pch file.

@ghost ghost assigned seanoshea May 27, 2013
@seanoshea
Copy link
Owner

I tried removing the reference to the .pch file in the project and and it seems to have helped somewhat. However, the test project doesn't seem to have access to the ios-etsy-sdk library. Here's the error I'm seeing:

Ld /Users/osheas/Library/Developer/Xcode/DerivedData/ios-etsy-sdk-capcvhnomsqmifgktjmpguujtcio/Build/Products/Debug-iphonesimulator/ios-etsy-sdkTests.octest/ios-etsy-sdkTests normal i386
cd /Users/osheas/Desktop/orta/ios-etsy-sdk/bootstrap
setenv IPHONEOS_DEPLOYMENT_TARGET 6.0
setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.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 -arch i386 -bundle -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk -L/Users/osheas/Library/Developer/Xcode/DerivedData/ios-etsy-sdk-capcvhnomsqmifgktjmpguujtcio/Build/Products/Debug-iphonesimulator -F/Users/osheas/Library/Developer/Xcode/DerivedData/ios-etsy-sdk-capcvhnomsqmifgktjmpguujtcio/Build/Products/Debug-iphonesimulator -F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk/Developer/Library/Frameworks -F/Applications/Xcode.app/Contents/Developer/Library/Frameworks -filelist /Users/osheas/Library/Developer/Xcode/DerivedData/ios-etsy-sdk-capcvhnomsqmifgktjmpguujtcio/Build/Intermediates/ios-etsy-sdk.build/Debug-iphonesimulator/ios-etsy-sdkTests.build/Objects-normal/i386/ios-etsy-sdkTests.LinkFileList -Xlinker -objc_abi_version -Xlinker 2 -all_load -fobjc-arc -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min=6.0 -lios-etsy-sdk -framework UIKit -framework SenTestingKit -framework Foundation -weak-lPods-ios-etsy-sdkTests -o /Users/osheas/Library/Developer/Xcode/DerivedData/ios-etsy-sdk-capcvhnomsqmifgktjmpguujtcio/Build/Products/Debug-iphonesimulator/ios-etsy-sdkTests.octest/ios-etsy-sdkTests

ld: library not found for -lios-etsy-sdk

clang: error: linker command failed with exit code 1 (use -v to see invocation)

The ios-etsy-sdk library file seems to be available in the workspace when I try to adding it from the workspace, but the linking command never seems to work out when running the tests. Here's what my Build Phases tab looks like for my test target:

screen shot 2013-05-27 at 22 23 33

Tried finding all .a files in my DerivedData folder after running a build and this is what I see:

unknown98d6bb7ec333:Xcode osheas$ find . -name *.a
./DerivedData/ios-etsy-sdk-capcvhnomsqmifgktjmpguujtcio/Build/Products/Debug-iphonesimulator/libPods-ios-etsy-sdkTests.a
./DerivedData/ios-etsy-sdk-capcvhnomsqmifgktjmpguujtcio/Build/Products/Debug-iphonesimulator/libPods.a

unknown98d6bb7ec333:Xcode osheas$

So, it looks like the ios-etsy-sdk library isn't getting built anymore when running the build? Any ideas on why this might be the case?

Excuse my ignore on your previous comment, but I'm not 100% sure what you mean by adding a pch file for the tests or referring to the app's .pch file. There isn't any app associated with this project (it's supposed to be a static library project) & I'm not sure how I'd add a .pch file just for the tests to have it run. Therefore, I tried removing all references to the .pch file in the project and ended up going down the path I outlined above.

@orta
Copy link
Contributor Author

orta commented May 30, 2013

So it looks like I had what the xcode project did, this is the first library I've seen that just runs unit tests. So I've configured pods to only work with the unit test, I've set the reference back up for the pch file (it was still referring to a filepath that didn't exist. )

so it shouldn't build the static library anymore, that is done in the pods project your unit tests are just running off the cocoapods library instead of creating a library that refers to cocoapods that is then tested you just test your code off the main library.

screen shot 2013-05-30 at 10 28 34

seanoshea added a commit that referenced this pull request May 30, 2013
Switched library to use bootstrapped library formatting
@seanoshea seanoshea merged commit 712677b into seanoshea:master May 30, 2013
@seanoshea
Copy link
Owner

@orta Thanks for the pull request. Gonna see if I can submit this for a CocoaPod now. Cheers!

seanoshea added a commit that referenced this pull request Jul 11, 2013
Switched library to use bootstrapped library formatting
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants