woshiccm / Pecker

CodePecker is a tool to detect unused Swift code.
MIT License
1.46k stars 63 forks source link

Request: Cocoapods Support #22

Closed noahsark769 closed 4 years ago

noahsark769 commented 4 years ago

We currently install Swiftlint with Cocoapods, so it would be really nice to have Pecker support for Cocoapods as well. Currently the install process requires manually cloning the project, so it won't get installed automatically when new developers clone our repo. Another option could be to integrate the project as a Swift package - that technically might work now? I'm not sure how to integrate a Swift package for development and not build it into the app, though

woshiccm commented 4 years ago

Will support as soon as possible

woshiccm commented 4 years ago

Done, now you can install it by Cocoapods

GesanTung commented 4 years ago

Done, now you can install it by Cocoapods 你们编译可以吗 dyld: Library not loaded: @rpath/lib_InternalSwiftSyntaxParser.dylib

woshiccm commented 4 years ago

My own test was successful

woshiccm commented 4 years ago

@GesanTung Can you provide more details?Do you use version 0.0.11?

woshiccm commented 4 years ago

@GesanTung What's Swift version? Lower than 5.0?

GesanTung commented 4 years ago

@GesanTung Can you provide more details?Do you use version 0.0.11?

Pecker pod version 0.0.11,Swift 5.0

image

woshiccm commented 4 years ago

@GesanTung Thanks, I am working on this issue. It is a bug of SwiftSyntax, if you want to try it now, you can try the manual way temporarily.

woshiccm commented 4 years ago

@GesanTung https://forums.swift.org/t/swiftsyntax-with-swift-5-1/29051/13

"I think this is a bug (?) in Xcode where it's not putting one of the toolchain's library directories in the binary's rpath correctly. I don't know if there's a better way to workaround it, but I just end up putting a symlink to lib_InternalSwiftSyntaxParser.dylib in the same directory as the executable so it'll find it, and that sticks around unless I clean the build product directory."

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/lib_InternalSwiftSyntaxParser.dylib.