-
Notifications
You must be signed in to change notification settings - Fork 44
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
Display non-pub dependencies #1427
Comments
https://stackoverflow.com/questions/57527328/parse-build-gradle-programmatically might be a way to handle the gradle files. But it would mean we have to go java... |
@jonasfj I'm trying to work on this, would parsing the file as String and find the next word after minSdk and dependencies be good? or should we implement some kind of custom parser to parse Gradle files? |
@Sameerkash, hmm, if we can find some part of the android toolchain that can parse a Perhaps just parsing the string with regexes is a good start. Or maybe use something like petitparser to create a tree-structure by just interpreting keywords, identifiers, strings, comments, parenthesis and brackets.. we might not have to understand the full gradle DSL grammar (or the groovy / kotlin stuff), but we might get a better heuristic if we're able to see that in: It should certainly be possible to parse it to the extent that we strip comments and understand strings. Imagine a gradle files like:
Just being able to see that Note. you can get all package names from:
So given a package name it's easy to fetch the gradle file, if there one, just do:
This will print to stdout, I'm guess since gradle files are small and most packages aren't plugins, it's actually feasible to download all The code for detecting this might be better off living in: https://github.com/dart-lang/pana |
did some digging and found this lib gradle-to-js can we use this through JS interop? If not for this, cc @jonasfj |
Using js interop is possible, but it'll probably be more work, and more work to maintain in the long run.. Deploying it will be harder to use.. I would suggest just porting it to dart using |
After all it's less than 700 lines of code... :D ps. I'm on |
Sure! I'll ping you there with updates. |
if we are ever doing this, note that we should focus on SwiftPM instead of cocoapods, as flutter is slowly making that transition. |
Flutter plugins can have non-pub dependencies through
build.gradle
and*.podspec
files.Maybe we could detect that and display such dependencies on
pub.dev
.TODO:
build.gradle
,*podspec
files,The text was updated successfully, but these errors were encountered: