RocketChat / Rocket.Chat.iOS

Legacy mobile Rocket.Chat client in Swift for iOS
https://rocket.chat
MIT License
1.03k stars 439 forks source link

[Question] Pod File Problems #2766

Open TannerJuby1 opened 5 years ago

TannerJuby1 commented 5 years ago

I have built an app that embeds Rocket.Chat into my own app. In order to make this work I've had to base my Podfile off of your Podfile. I recently went to update our app and ran into a bunch of build errors in regards to these pods. When I pulled down this repo, the app built fine, but the pod resources were different from mine even though my Podfile is set up exactly the same in terms of the pods you use. Here is my Podfile:

workspace 'YTP'
platform :ios, '11.0'

use_frameworks!
inhibit_all_warnings!

#
# Rocket Chat
#

def database_pods
    pod 'RealmSwift'
    pod 'SwiftyJSON'
end

def ui_pods
    pod 'MBProgressHUD', '~> 1.1.0'
end

def diff_pods
    pod 'DifferenceKit/Core', '~> 1.0'
end

def shared_pods
    # Analytics
    pod 'Firebase/Core'

    # Crash Report
    pod 'Fabric'
    pod 'Crashlytics'

    # Code utilities
    pod 'semver'

    # UI
    pod 'RocketChatViewController', :git => 'https://github.com/RocketChat/RocketChatViewController'
    pod 'MobilePlayer', :git => 'https://github.com/RocketChat/RCiOSMobilePlayer'
    pod 'SimpleImageViewer', :git => 'https://github.com/cardoso/SimpleImageViewer.git'
    pod 'SwipeCellKit'
    ui_pods

    # Text Processing
    pod 'RCMarkdownParser', :git => 'https://github.com/RocketChat/RCMarkdownParser.git'

    # Database 
    database_pods

    # Network
    pod 'Nuke', '~> 7.6'
    pod 'Nuke-FLAnimatedImage-Plugin'
    pod 'Starscream', '~> 3'
    pod 'ReachabilitySwift'

    # Authentication SDKs
    pod 'OAuthSwift'
    pod '1PasswordExtension'

    # Authentication SDKs
    pod 'OAuthSwift'
    pod '1PasswordExtension'

    # Debugging
#    pod 'SwiftLint', :configurations => ['Debug']
    pod 'FLEX', '~> 2.0', :configurations => ['Debug']

    # Diffing
    diff_pods
end

#target 'Rocket.Chat.ShareExtension' do
#    pod 'Nuke-FLAnimatedImage-Plugin'
#    database_pods
#   ui_pods
#   diff_pods
#end

#target 'Rocket.Chat' do
#  shared_pods
#end

#target 'Rocket.ChatTests' do
#  shared_pods
#end

#
# YTP
#
target 'YTP' do
    shared_pods

    # Networking
    pod 'Alamofire', '~> 4.0'
    pod 'AlamofireImage', '~> 3.3'

    # Native Helpers
    pod 'SwiftyJSON'
    pod 'IQKeyboardManagerSwift'
    pod 'KeychainSwift'
    pod 'UIImageViewAlignedSwift'

    # Google
    pod 'GoogleTagManager', '~> 6.0'
    pod 'Firebase/Core', '~> 4.13'

    target 'YTPTests' do
        inherit! :search_paths
        pod 'Firebase'
    end

    project 'YTP/YTP.xcodeproj'
end

post_install do |installer|
    swift42Targets = ['RCMarkdownParser', 'MobilePlayer']

    installer.pods_project.targets.each do |target|
        target.build_configurations.each do |config|
            config.build_settings['SWIFT_VERSION'] = '4.1'
            config.build_settings['ENABLE_BITCODE'] = 'NO'

            if config.name == 'Debug'
                config.build_settings['SWIFT_OPTIMIZATION_LEVEL'] = '-Onone'
            else
                config.build_settings['SWIFT_OPTIMIZATION_LEVEL'] = '-Owholemodule'
            end
        end

        if swift42Targets.include? target.name
            target.build_configurations.each do |config|
                config.build_settings['SWIFT_VERSION'] = '4.2'
            end
        end
    end
end

When I run pod install for my project, it downloads a different set of pods than when I run it for the Rocket.Chat project. For example, the version I get for SwipeCellKit is 2.7.1 whereas the version in Rocket.Chat's pods is 2.6.0 even though both of our Podfiles just have pod 'SwipeCellKit'

Now if I run pod update for both of our projects, then Rocket.Chat's project gets the same pod files I get and the app doesn't build...

How do I go about getting the same Podfile resources that is in this repo when the Podfile doesn't explicitly state versions for pods such as SwipeCellKit? Moreover, how do you manage your Pods to where they don't update? Do you just never update your pods?

TannerJuby1 commented 5 years ago

I have also discovered that this repo uses the RocketChatViewController pod, but it's version is 1.0.0 whereas the version that gets downloaded from the RocketChatViewController repo is 1.0.1 and doesn't compile with swift 4.2