最新消息:20210816 当前crifan.com域名已被污染,为防止失联,请关注(页面右下角的)公众号

[记录]用Carthage添加第三方库

Carthage crifan 2959浏览 0评论

折腾:

[记录]折腾iOS的第三方包管理工具:Carthage

之后,需要再去添加一个,之前用Cocoapods去管理的库

[记录]使用Cocoapods管理iOS项目的第三方库

即:

danielgindi/Charts: Beautiful charts for iOS/tvOS/OSX! The Apple side of the crossplatform MPAndroidChart.

然后本以为:

Carthage可以自动的去,像pod一样支持search有哪些库呢

结果失败了:

licrifandeMacBook-Pro:QorosSales crifan$ carthage search Charts

Unrecognized command: ‘search’. See `carthage help`.

去看help:

licrifandeMacBook-Pro:QorosSales crifan$ carthage –help

Unrecognized command: ‘–help’. See `carthage help`.

licrifandeMacBook-Pro:QorosSales crifan$ carthage help

Available commands:

   archive           Archives built frameworks into a zip that Carthage can use

   bootstrap         Check out and build the project’s dependencies

   build             Build the project’s dependencies

   checkout          Check out the project’s dependencies

   copy-frameworks   In a Run Script build phase, copies each framework specified by a SCRIPT_INPUT_FILE environment variable into the built app bundle

   fetch             Clones or fetches a Git repository ahead of time

   help              Display general or command-specific help

   outdated          Check for compatible updates to the project’s dependencies

   update            Update and rebuild the project’s dependencies

   version           Display the current version of Carthage

licrifandeMacBook-Pro:QorosSales crifan$

看看只能自己去github或git上找库了。

幸好已经知道地址:

https://github.com/danielgindi/Charts

对应的就是:

danielgindi/Charts

参考其中说明,给Cartfile加上声明,变成:

github "robb/Cartography"

github "danielgindi/Charts" ~> 2.2.4

然后再去运行:

carthage update

时间太长了,放弃了:

licrifandeMacBook-Pro:QorosSales crifan$ carthage update

*** Cloning Charts

^C

重新去试试,且专门只更新Charts:

carthage update Charts

但是一直还是没有进度,取消了。

重新手动去下载:

carthage fetch https://github.com/danielgindi/Charts

最后的最后,去update,但是没有出现build的动作:

licrifandeMacBook-Pro:QorosSales crifan$ carthage update

*** Fetching Charts

*** Fetching Cartography

*** Checking out Cartography at "0.6.0"

*** Downloading Charts.framework binary at "New features, Swift 2.2/3.0, and bugfixes"

*** xcodebuild output can be found in /var/folders/46/2hjxz38n22n3ypp_5f6_p__00000gn/T/carthage-xcodebuild.XKfdRl.log

*** Building scheme "Cartography-Mac" in Cartography.xcodeproj

2016-05-14 18:55:48.985 xcodebuild[28800:2372724] [MT] PluginLoading: Required plug-in compatibility UUID ACA8656B-FEA8-4B6D-8E4A-93F4C95C362C for plug-in at path ‘~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/WCGitTagsPlugin.xcplugin’ not present in DVTPlugInCompatibilityUUIDs

*** Building scheme "Cartography-iOS" in Cartography.xcodeproj

2016-05-14 18:55:57.453 xcodebuild[28867:2372949] [MT] PluginLoading: Required plug-in compatibility UUID ACA8656B-FEA8-4B6D-8E4A-93F4C95C362C for plug-in at path ‘~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/WCGitTagsPlugin.xcplugin’ not present in DVTPlugInCompatibilityUUIDs

2016-05-14 18:56:07.461 xcodebuild[28997:2373201] [MT] PluginLoading: Required plug-in compatibility UUID ACA8656B-FEA8-4B6D-8E4A-93F4C95C362C for plug-in at path ‘~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/WCGitTagsPlugin.xcplugin’ not present in DVTPlugInCompatibilityUUIDs

/Users/crifan/dev/dev_root/daryun/Projects/Qoros/QorosSales/Sourcecode/QorosSales/Carthage/Checkouts/Cartography/Cartography/ViewUtils.swift:40:16: warning: ‘anyGenerator’ is deprecated: renamed to ‘AnyGenerator’

/Users/crifan/dev/dev_root/daryun/Projects/Qoros/QorosSales/Sourcecode/QorosSales/Carthage/Checkouts/Cartography/Cartography/ViewUtils.swift:40:16: warning: ‘anyGenerator’ is deprecated: renamed to ‘AnyGenerator’

/Users/crifan/dev/dev_root/daryun/Projects/Qoros/QorosSales/Sourcecode/QorosSales/Carthage/Checkouts/Cartography/Cartography/ViewUtils.swift:40:16: warning: ‘anyGenerator’ is deprecated: renamed to ‘AnyGenerator’

/Users/crifan/dev/dev_root/daryun/Projects/Qoros/QorosSales/Sourcecode/QorosSales/Carthage/Checkouts/Cartography/Cartography/ViewUtils.swift:40:16: warning: ‘anyGenerator’ is deprecated: renamed to ‘AnyGenerator’

/Users/crifan/dev/dev_root/daryun/Projects/Qoros/QorosSales/Sourcecode/QorosSales/Carthage/Checkouts/Cartography/Cartography/ViewUtils.swift:40:16: warning: ‘anyGenerator’ is deprecated: renamed to ‘AnyGenerator’

/Users/crifan/dev/dev_root/daryun/Projects/Qoros/QorosSales/Sourcecode/QorosSales/Carthage/Checkouts/Cartography/Cartography/ViewUtils.swift:40:16: warning: ‘anyGenerator’ is deprecated: renamed to ‘AnyGenerator’

/Users/crifan/dev/dev_root/daryun/Projects/Qoros/QorosSales/Sourcecode/QorosSales/Carthage/Checkouts/Cartography/Cartography/ViewUtils.swift:40:16: warning: ‘anyGenerator’ is deprecated: renamed to ‘AnyGenerator’

/Users/crifan/dev/dev_root/daryun/Projects/Qoros/QorosSales/Sourcecode/QorosSales/Carthage/Checkouts/Cartography/Cartography/ViewUtils.swift:40:16: warning: ‘anyGenerator’ is deprecated: renamed to ‘AnyGenerator’

/Users/crifan/dev/dev_root/daryun/Projects/Qoros/QorosSales/Sourcecode/QorosSales/Carthage/Checkouts/Cartography/Cartography/ViewUtils.swift:40:16: warning: ‘anyGenerator’ is deprecated: renamed to ‘AnyGenerator’

/Users/crifan/dev/dev_root/daryun/Projects/Qoros/QorosSales/Sourcecode/QorosSales/Carthage/Checkouts/Cartography/Cartography/ViewUtils.swift:40:16: warning: ‘anyGenerator’ is deprecated: renamed to ‘AnyGenerator’

licrifandeMacBook-Pro:QorosSales crifan$

仔细看才发现,输出的log中已经说了:

Downloading Charts.framework binary at "New features, Swift 2.2/3.0, and bugfixes"

并且,对应的目录中,已经看到Charts.framework了:

Carthage/Build/iOS/Charts.framework

Carthage/Build/Mac/Charts.framework

Carthage/Build/tvOS/Charts.framework

对应的也有了Mac和tvOS的:

然后也注意到了网站:

danielgindi/Charts: Beautiful charts for iOS/tvOS/OSX! The Apple side of the crossplatform MPAndroidChart.

上说的:

Charts now include Carthage prebuilt binaries.

github "danielgindi/Charts" == 2.2.4

github "danielgindi/Charts" ~> 2.2.4

In order to build the binaries for a new release, use carthage build –no-skip-current && carthage archive Charts && carthage archive ChartsRealm.

-》所以此处Carthage可以不用编译,直接下载到,人家已经编译好的库文件即可

-》但是导致此处项目中,没了对应的源码

-》导致我后续不方便调试期间,就跳转到对应的Charts的源码中

-》而之前用Pod管理Charts的话,是可以跳转到源码的

-》所以还是希望此处Carthage去管理,并且希望可以看到源码

-》好像可以通过上面说的,编辑最新的,去试试:

licrifandeMacBook-Pro:QorosSales crifan$ carthage build –no-skip-current && carthage archive Charts && carthage archive ChartsRealm

*** xcodebuild output can be found in /var/folders/46/2hjxz38n22n3ypp_5f6_p__00000gn/T/carthage-xcodebuild.YmuLJD.log

*** Building scheme "Cartography-Mac" in Cartography.xcodeproj

2016-05-14 23:08:12.520 xcodebuild[29352:2456108] [MT] PluginLoading: Required plug-in compatibility UUID ACA8656B-FEA8-4B6D-8E4A-93F4C95C362C for plug-in at path ‘~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/WCGitTagsPlugin.xcplugin’ not present in DVTPlugInCompatibilityUUIDs

*** Skipped building QorosSales due to the error:

Dependency "QorosSales" has no shared framework schemes

*** Building scheme "Cartography-iOS" in Cartography.xcodeproj

2016-05-14 23:08:22.675 xcodebuild[29506:2456511] [MT] PluginLoading: Required plug-in compatibility UUID ACA8656B-FEA8-4B6D-8E4A-93F4C95C362C for plug-in at path ‘~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/WCGitTagsPlugin.xcplugin’ not present in DVTPlugInCompatibilityUUIDs

2016-05-14 23:08:32.387 xcodebuild[29636:2456756] [MT] PluginLoading: Required plug-in compatibility UUID ACA8656B-FEA8-4B6D-8E4A-93F4C95C362C for plug-in at path ‘~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/WCGitTagsPlugin.xcplugin’ not present in DVTPlugInCompatibilityUUIDs

/Users/crifan/dev/dev_root/daryun/Projects/Qoros/QorosSales/Sourcecode/QorosSales/Carthage/Checkouts/Cartography/Cartography/ViewUtils.swift:40:16: warning: ‘anyGenerator’ is deprecated: renamed to ‘AnyGenerator’

/Users/crifan/dev/dev_root/daryun/Projects/Qoros/QorosSales/Sourcecode/QorosSales/Carthage/Checkouts/Cartography/Cartography/ViewUtils.swift:40:16: warning: ‘anyGenerator’ is deprecated: renamed to ‘AnyGenerator’

/Users/crifan/dev/dev_root/daryun/Projects/Qoros/QorosSales/Sourcecode/QorosSales/Carthage/Checkouts/Cartography/Cartography/ViewUtils.swift:40:16: warning: ‘anyGenerator’ is deprecated: renamed to ‘AnyGenerator’

/Users/crifan/dev/dev_root/daryun/Projects/Qoros/QorosSales/Sourcecode/QorosSales/Carthage/Checkouts/Cartography/Cartography/ViewUtils.swift:40:16: warning: ‘anyGenerator’ is deprecated: renamed to ‘AnyGenerator’

/Users/crifan/dev/dev_root/daryun/Projects/Qoros/QorosSales/Sourcecode/QorosSales/Carthage/Checkouts/Cartography/Cartography/ViewUtils.swift:40:16: warning: ‘anyGenerator’ is deprecated: renamed to ‘AnyGenerator’

/Users/crifan/dev/dev_root/daryun/Projects/Qoros/QorosSales/Sourcecode/QorosSales/Carthage/Checkouts/Cartography/Cartography/ViewUtils.swift:40:16: warning: ‘anyGenerator’ is deprecated: renamed to ‘AnyGenerator’

/Users/crifan/dev/dev_root/daryun/Projects/Qoros/QorosSales/Sourcecode/QorosSales/Carthage/Checkouts/Cartography/Cartography/ViewUtils.swift:40:16: warning: ‘anyGenerator’ is deprecated: renamed to ‘AnyGenerator’

/Users/crifan/dev/dev_root/daryun/Projects/Qoros/QorosSales/Sourcecode/QorosSales/Carthage/Checkouts/Cartography/Cartography/ViewUtils.swift:40:16: warning: ‘anyGenerator’ is deprecated: renamed to ‘AnyGenerator’

/Users/crifan/dev/dev_root/daryun/Projects/Qoros/QorosSales/Sourcecode/QorosSales/Carthage/Checkouts/Cartography/Cartography/ViewUtils.swift:40:16: warning: ‘anyGenerator’ is deprecated: renamed to ‘AnyGenerator’

/Users/crifan/dev/dev_root/daryun/Projects/Qoros/QorosSales/Sourcecode/QorosSales/Carthage/Checkouts/Cartography/Cartography/ViewUtils.swift:40:16: warning: ‘anyGenerator’ is deprecated: renamed to ‘AnyGenerator’

*** Found Carthage/Build/Mac/Charts.framework

*** Found Carthage/Build/Mac/Charts.framework.dSYM

*** Found Carthage/Build/iOS/Charts.framework

*** Found Carthage/Build/iOS/Charts.framework.dSYM

*** Found Carthage/Build/tvOS/Charts.framework

*** Found Carthage/Build/tvOS/Charts.framework.dSYM

*** Found Carthage/Build/tvOS/6BA77729-D5F9-3426-B82B-72A81CD42F7D.bcsymbolmap

*** Found Carthage/Build/iOS/C24D51A9-E40A-3445-BB69-D177767A8F73.bcsymbolmap

*** Found Carthage/Build/iOS/544C6552-FE98-3966-9ADF-8FF04DED9A93.bcsymbolmap

*** Created Charts.framework.zip

Could not find any copies of ChartsRealm.framework. Make sure you’re in the project’s root and that the frameworks have already been built using ‘carthage build –no-skip-current’.

没有去build最新的charts

去更新配置为:

github "robb/Cartography"

github "danielgindi/Charts"

再去试试:

现象和上面一样。

重新去:

carthage update

希望可以下载最新版本的charts的源码,然后去编译出最新版本的库

-》这样就既可用Carthage去管理charts库,又可以有源码方便开发调试了

结果没有效果。。。

还是之前的输出:

算了,暂时就不用Carthage去管理Charts了

而还是保留之前的CocodPods去管理Charts吧

-》这样就可以方便调试期间看到Charts源码了。

然后再去:

carthage update

结果没有像我想的一样:

会自动删除没有引用的Charts的framework文件

之前已经下载的库,还是保留了:

暂时不去手动删除,万一以后用得着,就可以直接用了。

转载请注明:在路上 » [记录]用Carthage添加第三方库

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
89 queries in 0.212 seconds, using 22.13MB memory