-
Notifications
You must be signed in to change notification settings - Fork 309
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add CocoaPods dependency manager #3994
Conversation
15c58f6
to
0d2c197
Compare
Thanks for the contribution! Unfortunately, at least I'd need a few more days before I could start looking at this. |
Hi @pietbrauer , thanks for your contribution! I'm picking up this review now - mind helping me with the below initial questions?
|
@pietbrauer In order move a bit faster, I've setup a branch [1] in this repository and pushed your changes (rebased onto master). I'll make some modifications to the code there (force push) and as soon as done we may create a new PR from that branch replacing this PR. Fine with you? [1] https://github.com/oss-review-toolkit/ort/tree/cocoa-pods-support |
@fviernau I'm currently on parental leave and won't work on it until August. We have it in use at Porsche so we don't have time pressure. I don't get the working on a different branch but if that's how you want to review it so be it. |
8fb9464
to
e22946e
Compare
@pietbrauer @sschuberth @mnonnenmacher I refactored or re-wrote a couple of things mainly for simplification / clarity.
I'd see Point 1 not as an issue anymore and I'd prefer to add the documentation in a follow up PR. edit: I'm still working on the CI issues, so only the Kotlin bits are ready. |
0b631da
to
bc2174d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please also update the list of supported package managers in the README.
b96ba35
to
77646be
Compare
40ddc86
to
95fb5da
Compare
fc03f6f
to
bb746b4
Compare
Constructing the dependency tree for any given `Podfile` solely from the output of the `pod` sub-commands requires running `pod` sub-commands which only run on macOS. This implementation avoids all macOS-only commands by constructing the dependency tree from the lockfile and therefore the analysis of any `Podfile` requires the precence of the corresponding `Podfile.lock`. In order to obtain the meta-data for a dependency, the corresponding `.podspec` file is determined via the command `pod spec which`. These paths always point under `~/cocoapods/repos` which is where CocoaPods sets up its so called Specs repositories. Which repositories are to be used is defined by the respective `Podfile` via the `source` property, which defaults to [1]. This implementation disregards the specified repositories and always assumes that default. That default specs repository is however not used via GitHub, but via CDN as this is much faster [2]. Cloning [1] takes 10-30 minutes and takes a bit more than 5GB while the CDN approach initializes in no time and fetches only required data. Even with that CDN based approach the implementation can and should be extended to adhere to the specified repositories in the future. The CocoaPods repository cannot be checked out on Windows due to special characters in a path. So, installation is not possible on Windows which is why the tests are disabled on Windows for now. [1] https://github.com/CocoaPods/Specs [2] CocoaPods/CocoaPods#7046 Co-authored-by: Frank Viernau <[email protected]> Signed-off-by: Piet Brauer-Kallenberg <[email protected]> Signed-off-by: Frank Viernau <[email protected]>
Signed-off-by: Frank Viernau <[email protected]>
analyzer: Add initial support for the CocoaPods dependency manager
Constructing the dependency tree for any given
Podfile
solely from theoutput of the
pod
sub-commands requires runningpod
sub-commandswhich only run on macOS. This implementation avoids all macOS-only
commands by constructing the dependency tree from the lockfile and
therefore the analysis of any
Podfile
requires the precence of thecorresponding
Podfile.lock
.In order to obtain the meta-data for a dependency, the corresponding
.podspec
file is determined via the commandpod spec which
. Thesepaths always point under
~/cocoapods/repos
which is where CocoaPodssets up its so called Specs repositories. Which repositories are to be
used is defined by the respective
Podfile
via thesource
property,which defaults to [1]. This implementation disregards the specified
repositories and always assumes that default. That default specs
repository is however not used via GitHub, but via CDN as this is much
faster [2]. Cloning [1] takes 10-30 minutes and takes a bit more than
5GB while the CDN approach initializes in no time and fetches only
required data.
Even with that CDN based approach the implementation can
and should be extended to adhere to the specified repositories in the
future, see #4188.
[1] https://github.com/CocoaPods/Specs
[2] CocoaPods/CocoaPods#7046
------------------------------------- Original description from Piet below -----------------------------------
This PR adds CocoaPods as a dependency manager.
I tested it on macOS and inside the docker container. The Gem runs fine on Linux, the only thing that doesn't work is
pod install
because Xcode is missing. As far as I am concernedpod install
is not needed, if thePodfile.lock
is present.Things I am unsatisfied with/didn't know better:
Command
invocations to test the actual flowAlamofire/Something (~> 1.0)
into aPackageReference
Any pointers are welcome.