Conversation
c41b9f0 to
6e884e7
Compare
|
@MaJuRG This PR is not completed yet. |
6e884e7 to
a309eb3
Compare
ac689e2 to
4db59fe
Compare
steven-esser
left a comment
There was a problem hiding this comment.
Does the gemfileparser library work on podspec files?
@MaJuRG No that library does not work with podspec files. |
|
What exactly is different about them, from a technical side? would the parser work if you changed the filename? Just trying to understand more to give proper advice :) |
@MaJuRG |
96cfb83 to
ae40e74
Compare
ae40e74 to
cbb501d
Compare
|
@MaJuRG @pombredanne @JonoYang I have made all the changes. Please review this again and merge this if everything looks good :) |
pombredanne
left a comment
There was a problem hiding this comment.
Thank you for the progress!
I have a more extra comments provided inline for your consideration
| return column_list | ||
|
|
||
|
|
||
| def parse_podspec(location): |
There was a problem hiding this comment.
Is this not just a variation on the .gemspec?
There was a problem hiding this comment.
Yes, .gemspec and .podspec files are very similar to each other but not exactly same so I have made changes according to it :)
There was a problem hiding this comment.
You should have a shared utility module and not duplicate things then.
| # the lib prefix of their name. | ||
| # | ||
|
|
||
| # spec.framework = "SomeFramework" |
There was a problem hiding this comment.
No sure, but do we want to track these as deps?
There was a problem hiding this comment.
frameworks are a list of system frameworks that the user’s target needs to link against. I don't think this comes under dependencies. What do you say??
cbb501d to
8fa310a
Compare
|
@MaJuRG @pombredanne @JonoYang I have done all the necessary changes. Please review this again :) |
steven-esser
left a comment
There was a problem hiding this comment.
The url parsing is not correct at this time. See comments.
8fa310a to
b1e6da1
Compare
pombredanne
left a comment
There was a problem hiding this comment.
Thank you for the progress and updates. 👍
I am picky so please see my comments inline!
|
|
||
|
|
||
| """ | ||
| Handle Podspec Package Manager |
There was a problem hiding this comment.
What about instead:
"""
Handle cocoapods packages manifests for macOS and iOS
including .podspec, Podfile and Podfile.lock files.
See https://cocoapods.org
"""
Also this may mean you want to rename the file from podspec.py to cocoapods.py which is a bit more generic?
|
|
||
| def parse_line(line): | ||
| """ | ||
| Parses each line and creates dependency objects accordingly |
There was a problem hiding this comment.
What does a "line" arg looks like here?
Also please use the imperative style for docstring, e.g. something along the lines of:
Return a Dependency by parsing a line` string`
... but then, this is misleading: this function does not return a dependency?
Also add an example of what a "line" looks like.
| stripped_column = stripped_column.replace('[', "") | ||
| stripped_column = stripped_column.strip() | ||
| column_list.append(stripped_column) | ||
| return column_list |
There was a problem hiding this comment.
It looks to me like you are parsing/cleaning up something that may be Ruby code here. This is also something that I saw in the rubygems code. You should have shared utility functions to handle this for both cocoapods an rubygems and not duplicate the code.
| check_json_scan(expected_file, result_file, regen=False) | ||
|
|
||
| def test_package_command_scan_podspec(self): | ||
| test_dir = self.get_test_loc('podspec/package') |
There was a problem hiding this comment.
Try to avoid reusing the same test files in a different test as this creates unnecessary coupling between tests that will bite us in the future.
Here you want to have a dedicated directory for this test f=data files and its expected file.
| @@ -0,0 +1,140 @@ | |||
| # | |||
There was a problem hiding this comment.
Is this SwiftLib.podspec the example from their doc? It feels a little contrived. Can you find a better set of data files?
| "code_view_url": null, | ||
| "vcs_url": "https://github.com/nanopb/nanopb.git", | ||
| "copyright": null, | ||
| "license_expression": "unknown", |
There was a problem hiding this comment.
We definitely need to override the license detection in order to detect correctly these declared_license
Also is there a way to collect ALL the license values of ALL the podspecs? Ask around for help for this or check in https://github.com/CocoaPods/Specs ... this will be useful to properly create mapping of they license conventions to our keys (in addition to applying proper detection to their license field structure)
That should be in its own ticket though, so create one
| ], | ||
| "purl": "pkg:pods/nanopb@1.30905.0", | ||
| "repository_homepage_url": "https://cocoapods.org/pods/nanopb", | ||
| "repository_download_url": "https://github.com/nanopb/nanopb/archive/1.30905.0.zip", |
There was a problem hiding this comment.
Would this be also the download URL?
There was a problem hiding this comment.
pods source code can be download by this url. :)
| "purl": "pkg:pods/nanopb@1.30905.0", | ||
| "repository_homepage_url": "https://cocoapods.org/pods/nanopb", | ||
| "repository_download_url": "https://github.com/nanopb/nanopb/archive/1.30905.0.zip", | ||
| "api_data_url": "https://github.com/nanopb/nanopb" |
There was a problem hiding this comment.
Is this instead something from from https://github.com/CocoaPods/Specs ? you should check in the pod Ruby code to understand how things work.
cddcff3 to
66cc58f
Compare
Signed-off-by: rpotter12 <rohitpotter12@gmail.com>
Signed-off-by: rpotter12 <rohitpotter12@gmail.com>
steven-esser
left a comment
There was a problem hiding this comment.
Some small nitpicks.
|
|
||
| def is_podspec(location): | ||
| """ | ||
| Checks is the file is a podspec file or not. |
There was a problem hiding this comment.
This should be: Checks if the file is actually a podspec file (nitpick)
|
|
||
| def build_package(podspec_data): | ||
| """ | ||
| Return a Pacakge object from a package data mapping or None. |
There was a problem hiding this comment.
Pacakge should be Package
|
#2075 is the merged which is the extended version of this PR. |
Fixes #2036
Implementation to handle
.podspecfiles..podspecand.gemspecfiles and return dictionary with data.Tasks
Run tests locally to check for errors.