hi super dumb question but how can i view a list o...
# android
s
hi super dumb question but how can i view a list of versions for a given gradle dependency? i am aware of android studio’s built in support but it only works for some dependencies and not others. is there some command line like
gradle info com.googlecode.libphonenumber:libphonenumber
?
v
Not that I'm aware of. Google is your friend, or search.maven.org for just Maven Central or mvnrepository.com for multiple different maven repositories
What is actually your use-case to list versions of a dependency?
s
@Vampire we are upgrading to gradle 7 and it’s having trouble with some dependencies using deprecated stuff, so it falls back to 6.7
so it would be nice to evaluate each dependency and make sure it is up to date, but with other package managers it’s really easy to do this
v
"it"?
s
yes, “it” is our android project
v
There are 2 or 3 plugins for that which check all your dependencies and tell you which are outdated
Then you have a task that you can run and the tells you the outdated dependencies
I usually use version plugin of ben manes, but there are also 2 or so other similar plugins
s
i was trying to avoid plugins because im on a new apple silicon macbook and the perf of android studio is really bad
v
Gradle plugin, not Android Studio plugin
s
right now i copy the dependency and google, i.e. “com.googlecode.libphonenumber:libphonenumber” and hope to find a list of versions, but i don’t even know where the definitive website to look
sometimes github releases will have the latest but also sometimes not
v
There is no "definitive" website, as each project can decide to which maven repository or ivy repository or releases page or whatever it publishes
So the "definitive" truth for each dependency is the project webpage
But usually one project always publishes to the same repository which is why those Gradle plugins can do a great job
s
coming from carthage/homebrew/swift package manager/npm/elixir+hex this seems.. ridiculous 😛
v
Why?
Gradle is not a package manager
It is a build tool
And NPM is exactly the same
You can define a definite version, or you can define ranges and not have reproducible builds but always just get the latest
And you can have various npm repositories
npm is from principle exactly the same
homebrew is not comparable as it is a package manager, not a build tool
No idea about the others
s
i just listed nearly half a dozen package manager/build systems, and it’s really easy to understand the versioning of dependencies in all of them
v
As is in Gradle / Maven repositories
As I said, it is nearly identical in principle to NPM
So if you understood NPM it is strange you have problems 😉
s
`
Copy code
npm view webpack versions
`
run that and you can view all the published versions of a package
v
Which is totally useless, what do you need that for?
☝️ 1
s
does maven have the same thing?
v
I don't know I'm not a Maven user, but this information is totally useless imho
s
yarn info webpack versions
v
Doesn't make it any more useful
s
if it’s useless why am i asking for it and why is it build into every other package manager
v
Again, Gradle is not a package manager
It is a build tool
s
looking at version history tells you alot about where a project is, if there are any upcoming (beta) versions, etc etc
so what is the package manager? maven?
v
And you didn't ask for it, you asked "what outdated dependencies do I have" and I told you how to find out easily
s
who is doing package resolution
gradle? maven? the ide?
v
Maven is a repository of libraries, it is not a package manager. A package manager is something that manages packages and installs them for you to use them.
s
so why did you say gradle is analogous to npm?
npm is well, a package manager
v
npm is a mixture of build tool and package manager
And I didn't say they are analogous
I said their versioning things are analogous
You can in both say give me version X, you can in both say give me version X or newer
And again, what you asked for is "what outdated dependencies do I have" and I told you how to do that easily, so what is your problem?
I mean, there is for sure some plugin that can also list you versions of dependencies, but I don't know it because imho it is totally useless information and if I want it I can easily look at it in a browser
with additional context like release notes which then makes it useful
s
you keep saying it is useless, but that is definitely your opinion
v
Of course, that's why I said imho
s
and if it were useless, then half a dozen other systems wouldn’t offer the functionality
v
That is not a good reasoning. Many tools have useless functionality and many tools copy useless functionality from competitors for a check-mark in comparisons.
s
it is useful because we live on the bleeding edge, and it’s helpful to see the total view of development on a dependency
you are saying it is useless, i am saying it’s not
i respect your opinion
v
If you want to know what is going on with a dependency look at its project page and you get useful information. I still don't get what you get out of a pure listing of available versions except for "there is something newer than I use".
1
s
but you are not me or my team
v
Yeah, well, I told you how to see which dependencies are outdated and what their latest version is. And that I don't know a plugin that lets you list available versions of a dependency, so I'm out. I'm sure you can find some plugin that can list dependency versions by asking Google. 🙂
s
“there is something newer than I use or there is a beta/rc track that supports other parts of our project that are bleeding edge”
v
As bleeding edge snapshot builds are usually not published to the same repositories as production releases, you are back to looking at the project homepage for finding their snapshot repository. If someone publishes betas or rcs they are most often published to the same repositories as production releases so those plugins could also answer you that, they just filter them out by default as 95% of the users do not want anything unstable in their builds.
☝️ 1
s
our android app is on jetpack compose (which is alpha08), using android studio arctic fox (canary) so maybe we are a different breed
👌 1
💪 1
😃 1
c
@Sam you can use dependabot in github and it will make PRs with up to date deps. If you really need to know what deps are out of date, there's nothing really built into the build system (gradle) afaik. What my teams have used in the past is https://github.com/ben-manes/gradle-versions-plugin 2.6k stars. I would say its almost the defacto thing to add to your build script and it will tell you whats outdated. I've noticed that after running it, the IDE will also give me little hitns that "Hey this thing is outdated"
v
@Colton Idle I already told him that. But he is not satisfied with this or similar plugins, he wants a way to list the versions of a dependency, do you know a plugin for that?
c
nah
l
You can simply look at the maven-metadata.xml in the repo hosting the library.