EurekaCommunity / SplitRow

A row for Eureka to put two rows side by side into the same UITableViewCell
MIT License
56 stars 27 forks source link

Cocoapod support #12

Closed kamerc closed 6 years ago

kamerc commented 6 years ago

Converted XCode project to use CocaPods, removed existing outdated Eureka framework, updated language to latest Swift version, removed PostalAddressRow framework because that appears to be a mistake that it was included.

I tested this by importing it into my own iOS app's podfile this way: pod 'SplitRow', :git => "https://github.com/kamerc/SplitRow.git", :branch => "cocoapod-support"

I was able to successful use SplitRow in my project. Note: Since this has been converted to a CocoaPods project, you will need to install CocoaPods to build & run from here on out. Also you will need to open the .xcodeworkspace file instead of .xcodeproject file to make edits/build, etc. Here is some info on installing CocoaPods: https://stackoverflow.com/questions/20755044/how-to-install-cocoapods

marbetschar commented 6 years ago

@kamerc thats awesome!!! Thank you so much for your work! Unfortunately I now get an error trying to compile your cocoa pods branch using Carthage (see below).

I'll try to give this some more love in the following days, so we can get your work merged.

*** Building scheme "SplitRow" in SplitRow.xcworkspace
Build Failed
    Task failed with exit code 65:
    /usr/bin/xcrun xcodebuild -workspace /Users/marbetschar/Development/Valletti/App/Valletti/Carthage/Checkouts/SplitRow/SplitRow.xcworkspace -scheme SplitRow -configuration Release -derivedDataPath /Users/marbetschar/Library/Caches/org.carthage.CarthageKit/DerivedData/9.2_9C40b/SplitRow/26e465913dc2de63177000a9727144c0e95d65cf -sdk iphoneos ONLY_ACTIVE_ARCH=NO BITCODE_GENERATION_MODE=bitcode CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES archive -archivePath /var/folders/ns/0h9r9v5908x4x67v5j9wvhvw0000gn/T/SplitRow SKIP_INSTALL=YES GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=NO CLANG_ENABLE_CODE_COVERAGE=NO (launched in /Users/marbetschar/Development/Valletti/App/Valletti/Carthage/Checkouts/SplitRow)

This usually indicates that project itself failed to compile. Please check the xcodebuild log for more details: /var/folders/ns/0h9r9v5908x4x67v5j9wvhvw0000gn/T/carthage-xcodebuild.oOnBbI.log
kamerc commented 6 years ago

Have you tried installing & running it with CocoaPods? the .xcworkspace is a cocoapod generated file. I personally don't know anything about Carthage. Is that what you are using to import dependencies into your project instead of CocoaPods?

daveparks23 commented 6 years ago

Thanks for your work @kamerc I tried installing the pod. Here is the error I got:

Pre-downloading: `SplitRow` from `https://github.com/kamerc/SplitRow.git`, branch `cocoapod-support`
[!] Failed to load 'SplitRow' podspec: 
[!] Invalid `SplitRow.podspec` file: undefined method `swift_version=' for #<Pod::Specification name="SplitRow">.

 #  from /var/folders/wq/s_mylfsj1_56k1gxt70n325m0000gn/T/d20180324-7391-150aar9/SplitRow.podspec:15
 #  -------------------------------------------
 #  s.dependency "Eureka", "~> 4.1.0"
 >  s.swift_version = "4.1"
 #  end
 #  -------------------------------------------

Thanks in advance for any help.

kamerc commented 6 years ago

@daveparks23 I was originally getting a warning that swift_version was not defined when I was creating the podspec which is why I added it. The recognition of the field may depend on what version of CocoaPods you have. It is not required so try removing that line from the podspec file & try again.

kamerc commented 6 years ago

@daveparks23 did you ever get it working? My co-worker also ran into this issue so I removed swift_version from the PodSpec so it is backwards compatible with prior versions of CocoaPods. It seems that swift_version was introduced in the latest CocoaPod version. I just pushed this change & also merged in the latest from the upstream.

@marbetschar any progress with looking into this? It would be great if it could be included in EurekaCommunity. Thanks.

marbetschar commented 6 years ago

@kamerc can't merge since your branch no longer compiles using Carthage. Can you please look into this? To test this, I simply created a new Xcode project and added a Cartfile with the following content:

github "kamerc/SplitRow" "cocoapod-support"

After this I executed the following cli command:

$: carthage update

Which in turn produces the following error:

$ carthage update
*** Fetching SplitRow
*** Fetching Eureka
*** Checking out Eureka at "4.1.1"
*** Checking out SplitRow at "70cb10f31805e406deac87b8dd1e9de9d42d879d"
*** xcodebuild output can be found in /var/folders/ns/0h9r9v5908x4x67v5j9wvhvw0000gn/T/carthage-xcodebuild.K1Ir5H.log
*** Building scheme "Eureka" in Eureka.xcworkspace
*** Building scheme "SplitRow" in SplitRow.xcworkspace

Build Failed
    Task failed with exit code 65:
    /usr/bin/xcrun xcodebuild -workspace SplitRowCocoapods/Carthage/Checkouts/SplitRow/SplitRow.xcworkspace -scheme SplitRow -configuration Release -derivedDataPath Library/Caches/org.carthage.CarthageKit/DerivedData/9.3_9E145/SplitRow/70cb10f31805e406deac87b8dd1e9de9d42d879d -sdk iphoneos ONLY_ACTIVE_ARCH=NO BITCODE_GENERATION_MODE=bitcode CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES archive -archivePath /var/folders/ns/0h9r9v5908x4x67v5j9wvhvw0000gn/T/SplitRow SKIP_INSTALL=YES GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=NO CLANG_ENABLE_CODE_COVERAGE=NO STRIP_INSTALLED_PRODUCT=NO (launched in SplitRowCocoapods/Carthage/Checkouts/SplitRow)

This usually indicates that project itself failed to compile. Please check the xcodebuild log for more details: /var/folders/ns/0h9r9v5908x4x67v5j9wvhvw0000gn/T/carthage-xcodebuild.K1Ir5H.log

Xcode build log shows "No such file or directory" for Podfile.lock and Manifest.lock:

SymLink Library/Caches/org.carthage.CarthageKit/DerivedData/9.3_9E145/SplitRow/70cb10f31805e406deac87b8dd1e9de9d42d879d/Build/Intermediates.noindex/ArchiveIntermediates/SplitRow/BuildProductsPath/Release-iphoneos/SplitRow.framework Library/Caches/org.carthage.CarthageKit/DerivedData/9.3_9E145/SplitRow/70cb10f31805e406deac87b8dd1e9de9d42d879d/Build/Intermediates.noindex/ArchiveIntermediates/SplitRow/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/SplitRow.framework
    cd SplitRowCocoapods/Carthage/Checkouts/SplitRow
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:.fastlane/bin:/Library/Developer/Toolchains/swift-latest.xctoolchain/usr/bin:.rbenv/shims:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/usr/local/go/bin:/opt/X11/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands"
    /bin/ln -sfh Library/Caches/org.carthage.CarthageKit/DerivedData/9.3_9E145/SplitRow/70cb10f31805e406deac87b8dd1e9de9d42d879d/Build/Intermediates.noindex/ArchiveIntermediates/SplitRow/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/SplitRow.framework Library/Caches/org.carthage.CarthageKit/DerivedData/9.3_9E145/SplitRow/70cb10f31805e406deac87b8dd1e9de9d42d879d/Build/Intermediates.noindex/ArchiveIntermediates/SplitRow/BuildProductsPath/Release-iphoneos/SplitRow.framework

PhaseScriptExecution [CP]\ Check\ Pods\ Manifest.lock Library/Caches/org.carthage.CarthageKit/DerivedData/9.3_9E145/SplitRow/70cb10f31805e406deac87b8dd1e9de9d42d879d/Build/Intermediates.noindex/ArchiveIntermediates/SplitRow/IntermediateBuildFilesPath/SplitRow.build/Release-iphoneos/SplitRow.build/Script-0BEA14AB34CD07BA3D20DFB8.sh
    cd SplitRowCocoapods/Carthage/Checkouts/SplitRow
    /bin/sh -c Library/Caches/org.carthage.CarthageKit/DerivedData/9.3_9E145/SplitRow/70cb10f31805e406deac87b8dd1e9de9d42d879d/Build/Intermediates.noindex/ArchiveIntermediates/SplitRow/IntermediateBuildFilesPath/SplitRow.build/Release-iphoneos/SplitRow.build/Script-0BEA14AB34CD07BA3D20DFB8.sh
diff: /Podfile.lock: No such file or directory
diff: /Manifest.lock: No such file or directory
error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.

** ARCHIVE FAILED **

The following build commands failed:
    PhaseScriptExecution [CP]\ Check\ Pods\ Manifest.lock Library/Caches/org.carthage.CarthageKit/DerivedData/9.3_9E145/SplitRow/70cb10f31805e406deac87b8dd1e9de9d42d879d/Build/Intermediates.noindex/ArchiveIntermediates/SplitRow/IntermediateBuildFilesPath/SplitRow.build/Release-iphoneos/SplitRow.build/Script-0BEA14AB34CD07BA3D20DFB8.sh

From what I can tell I get the very same error if I just download your branch and try to compile - without running Cocoapods.

marbetschar commented 6 years ago

@kamerc I have no clue how Cocoapods works internally, but what I know is that Carthage relies on building the shared scheme it finds within the project/workspace. That said, the solution for coexistence might be introducing two different schemes - one for Carthage and another one for Cocoapods.

bildschirmfoto 2018-04-25 um 21 18 25
kamerc commented 6 years ago

I just downloaded Carthage and did some research and I did get your error at first but then got it to build without an error. This is my Cartfile: github "xmartlabs/Eureka" ~> 4.1 github "kamerc/SplitRow"

My master is now the same as cocoapod-support so I am pointing to this instead. I decided to try this because I read a post where someone was saying pointing to a specific branch name was failing.

I then ran "carthage update --platform iOS"

This is my output. It returned without any build failed messages. Let me know if it works for you.

$ carthage update --platform iOS Fetching Eureka Fetching SplitRow Checking out Eureka at "4.1.1" Checking out SplitRow at "1.0.0" xcodebuild output can be found in /var/folders/hp/lk5vpr0j6sdkdr31vkrvjw8001hv/T/carthage-xcodebuild.3pgciR.log Building scheme "Eureka" in Eureka.xcworkspace *** Building scheme "SplitRow" in SplitRow.xcodeproj

marbetschar commented 6 years ago

@kamerc seems like this definately did the trick! Carthage now successfully compiles with the following line in the Cartfile:

github "kamerc/SplitRow"

Giving now Cocoapods a try and will merge if this is sucessfull too :tada:

marbetschar commented 6 years ago

@kamerc running again into troubles, now it seems Cocoapods is not able to handle my newly created Xcode test project. Running into the following error:

RuntimeError - [Xcodeproj] Unknown object version.
/Applications/CocoaPods.app/Contents/Resources/bundle/lib/ruby/gems/2.2.0/gems/xcodeproj-1.5.4/lib/xcodeproj/project.rb:217:in `initialize_from_file'
/Applications/CocoaPods.app/Contents/Resources/bundle/lib/ruby/gems/2.2.0/gems/xcodeproj-1.5.4/lib/xcodeproj/project.rb:102:in `open'
/Applications/CocoaPods.app/Contents/Resources/bundle/lib/ruby/gems/2.2.0/gems/cocoapods-1.4.0/lib/cocoapods/command/init.rb:41:in `validate!'
/Applications/CocoaPods.app/Contents/Resources/bundle/lib/ruby/gems/2.2.0/gems/claide-1.0.2/lib/claide/command.rb:333:in `run'
/Applications/CocoaPods.app/Contents/Resources/bundle/lib/ruby/gems/2.2.0/gems/cocoapods-1.4.0/lib/cocoapods/command.rb:52:in `run'
/Applications/CocoaPods.app/Contents/Resources/bundle/lib/ruby/gems/2.2.0/gems/cocoapods-1.4.0/bin/pod:55:in `<top (required)>'
/Applications/CocoaPods.app/Contents/Resources/bundle/bin/pod:22:in `load'
/Applications/CocoaPods.app/Contents/Resources/bundle/bin/pod:22:in `<main>'

Seen this issue here, tried to install latest & greatest Cocoapods using following command:

sudo gem install -n /usr/local/bin cocoapods --pre

which makes pod init run; but after adding the following line to Podfile:

pod 'SplitRow', :git => "https://github.com/kamerc/SplitRow.git", :branch => "master"

the command pod install fails with the following error:

pod install
Analyzing dependencies
Pre-downloading: `SplitRow` from `https://github.com/kamerc/SplitRow.git`, branch `master`

[!] Automatically assigning platform `ios` with version `11.3` on target `SplitRowCocoapods` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.
/Users/marbetschar/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/cocoapods-core-1.5.0/lib/cocoapods-core/yaml_helper.rb:62:in `rescue in load_string': [!] ERROR: Parsing unable to continue due to parsing error: (Pod::Informative)
contained in the file located at /Users/marbetschar/.cocoapods/repos/master/CocoaPods-version.yml
---
min: 1.0.0
last: 1.4.0.beta.2
prefix_lengths:
- 1
- 1
- 1

    from /Users/marbetschar/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/cocoapods-core-1.5.0/lib/cocoapods-core/yaml_helper.rb:57:in `load_string'
    from /Users/marbetschar/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/cocoapods-core-1.5.0/lib/cocoapods-core/yaml_helper.rb:75:in `load_file'
    from /Users/marbetschar/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/cocoapods-core-1.5.0/lib/cocoapods-core/source/metadata.rb:27:in `from_file'
    from /Users/marbetschar/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/cocoapods-core-1.5.0/lib/cocoapods-core/source.rb:423:in `refresh_metadata'
    from /Users/marbetschar/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/cocoapods-core-1.5.0/lib/cocoapods-core/source.rb:28:in `initialize'
    from /Users/marbetschar/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/cocoapods-core-1.5.0/lib/cocoapods-core/source/manager.rb:287:in `new'
    from /Users/marbetschar/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/cocoapods-core-1.5.0/lib/cocoapods-core/source/manager.rb:287:in `block in source_from_path'
    from /Users/marbetschar/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/cocoapods-core-1.5.0/lib/cocoapods-core/source/manager.rb:292:in `yield'
    from /Users/marbetschar/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/cocoapods-core-1.5.0/lib/cocoapods-core/source/manager.rb:292:in `source_from_path'
    from /Users/marbetschar/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/cocoapods-core-1.5.0/lib/cocoapods-core/source/manager.rb:301:in `block in aggregate_with_repos'
    from /Users/marbetschar/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/cocoapods-core-1.5.0/lib/cocoapods-core/source/manager.rb:301:in `map'
    from /Users/marbetschar/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/cocoapods-core-1.5.0/lib/cocoapods-core/source/manager.rb:301:in `aggregate_with_repos'
    from /Users/marbetschar/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/cocoapods-core-1.5.0/lib/cocoapods-core/source/manager.rb:24:in `aggregate'
    from /Users/marbetschar/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/cocoapods-core-1.5.0/lib/cocoapods-core/source/manager.rb:61:in `all'
    from /Users/marbetschar/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/cocoapods-1.5.0/lib/cocoapods/user_interface/error_report.rb:170:in `repo_information'
    from /Users/marbetschar/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/cocoapods-1.5.0/lib/cocoapods/user_interface/error_report.rb:77:in `stack'
    from /Users/marbetschar/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/cocoapods-1.5.0/lib/cocoapods/user_interface/error_report.rb:24:in `report'
    from /Users/marbetschar/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/cocoapods-1.5.0/lib/cocoapods/command.rb:66:in `report_error'
    from /Users/marbetschar/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/claide-1.0.2/lib/claide/command.rb:396:in `handle_exception'
    from /Users/marbetschar/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/claide-1.0.2/lib/claide/command.rb:337:in `rescue in run'
    from /Users/marbetschar/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/claide-1.0.2/lib/claide/command.rb:325:in `run'
    from /Users/marbetschar/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/cocoapods-1.5.0/lib/cocoapods/command.rb:52:in `run'
    from /Users/marbetschar/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/cocoapods-1.5.0/bin/pod:55:in `<top (required)>'
    from /usr/local/bin/pod:23:in `load'
    from /usr/local/bin/pod:23:in `<main>'

Running Xcode v9.3. Do you have any idea how to fix this?

marbetschar commented 6 years ago

did some gem uninstall, gem cleanup, gem install juggling ... Cocoapods seems back up & running now - waiting for pod install to complete 🤞

kamerc commented 6 years ago

One additional step that can be done is pushing it to be published on cocoapods.org for others to search for easily. I started to follow the steps but got this error: [!] You (kate.mercer@sas.com) are not allowed to push new versions for this pod. The owners of this pod are marco@mandelkind.swiss.

So either we can change the pod owner to me in the podspec or you @marbetschar can do the following steps https://guides.cocoapods.org/making/getting-setup-with-trunk.html https://www.appcoda.com/cocoapods-making-guide/

here are the specific commands I used: pod lib lint --swift-version=4.1 --allow-warnings pod trunk push SplitRow.podspec --swift-version=4.1 --allow-warnings

marbetschar commented 6 years ago

@kamerc did this already. Is the pod not public available...? :(

marbetschar commented 6 years ago

Thought if it appears here everything is fine? https://cocoapods.org/pods/SplitRow

kamerc commented 6 years ago

oh cool, didn't realize you had already published it. Thanks!

marbetschar commented 6 years ago

You’re very welcome, thank you very much for your contribution!! 🙏🏼

daveparks23 commented 6 years ago

I did get it working! Thanks so much! Sorry for the late reply.

On Tue, Apr 24, 2018 at 10:44 AM Kate Mercer notifications@github.com wrote:

@daveparks23 https://github.com/daveparks23 did you ever get it working? My co-worker also ran into this issue so I removed swift_version from the PodSpec so it is backwards compatible with prior versions of CocoaPods. It seems that swift_version was introduced in the latest CocoaPod version. I just pushed this change & also merged in the latest from the upstream.

@marbetschar https://github.com/marbetschar any progress with looking into this? It would be great if it could be included in EurekaCommunity. Thanks.

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/EurekaCommunity/SplitRow/pull/12#issuecomment-383981022, or mute the thread https://github.com/notifications/unsubscribe-auth/AJ5L8Wos78kEAQuIV5vYAPBBZ0AH3SUFks5tr0higaJpZM4SuYVR .

-- Dave Parks 615 957 4280