woshiccm / Pecker

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

Document BUILD_ROOT when running from command line #23

Open noahsark769 opened 4 years ago

noahsark769 commented 4 years ago

Pecker currently requires the BUILD_ROOT environment variable to be set, if an index store path is not passed. Without a BUILD_ROOT, it fails silently. It would be good to document that this is required as an env var.

In an ideal world, we could also provide the user a commend line option to specify the name of the target - then we could infer a default DerivedData path to use for the IndexDB

woshiccm commented 4 years ago

Thanks, will improve it

ivanglushko commented 4 years ago

i got confused why it;s not working from command line. Thank you!

woshiccm commented 4 years ago

ProcessInfo().environment["BUILD_ROOT"] get buildRoot, then get the index path in DerivedData

woshiccm commented 4 years ago

屏幕快照 2019-12-16 上午11.07.32.png

woshiccm commented 4 years ago

For example, if I have two same name projects, can't determine exactly which is correct in DerivedData, means can't get the correct index of project.

noahsark769 commented 4 years ago

Hm interesting - I guess specifying the name of the target isn't an option then. It would still be nice to have better error messaging for this, and another option would be to allow input of the directory via a command line argument

woshiccm commented 4 years ago

Yeah, will improve as soon as possible