-
Notifications
You must be signed in to change notification settings - Fork 985
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
Create a custom Gradle task to list all dependencies #15447
Comments
It is worth noting that Gradle often picks a newer version of a package over an older one when resolving dependencies:
In this case we see that It would be good to support this, as it would allow us to keep the Gradle dependencies derivation on the smaller side. Now, this is not absolutely necessary, if it turns out to be difficult, but it would be good to have. |
I tried multiple different approaches, not very successfully, but here are some results:
It seems to show everything we need but in a tree-like structure which means parsing it with the same script again, and that's something we want to avoid. We can try to utilize some code from All the current results can be found here: #15539 |
I'm currently checking if something can be extracted from DependencyReportTask or some code from it can be used separately in another task to generate a plain list of dependencies (see |
Going to temporarily pause all the work to focus on more urgent UI issues for 0.23.0. Current results: |
Thanks for looking into it. |
Hey! @alwx : I'm assigning this to myself to give it a shot. |
I believe the key to finding the missing dependencies are these files:
They appear to be loaded somewhere to provide required versions of packages:
|
Apparently Gradle can load additional catalogs of dependencies: dependencyResolutionManagement {
versionCatalogs {
// declares an additional catalog, named 'testLibs', from the 'test-libs.versions.toml' file
testLibs {
from(files('gradle/test-libs.versions.toml'))
}
}
} https://docs.gradle.org/current/userguide/platforms.html#ex-declaring-additional-catalogs But I cannot find a reference to such a line. |
Something is loading the
Which is then loaded in our Gradle config: status-mobile/android/settings.gradle Line 21 in ac186e2
But why is it not evaluated together with other deps? |
related issue : #15447 This PR makes use of https://github.com/gradle/github-dependency-graph-gradle-plugin to generate deps so that we may get rid of the AWK script that parses `gradle` output to figure out `gradle` dependencies. credits to @mendelskiv93 for doing initial research on this dependency generator plugin. We still miss a few dependencies and are not completely able to get rid of the hack list step just yet. I also moved `react-native-share` out of `pluginManagement ` block in `android/settings.gradle` because it does not belong there.
related issue : #15447 This PR makes use of https://github.com/gradle/github-dependency-graph-gradle-plugin to generate deps so that we may get rid of the AWK script that parses `gradle` output to figure out `gradle` dependencies. credits to @mendelskiv93 for doing initial research on this dependency generator plugin. We still miss a few dependencies and are not completely able to get rid of the hack list step just yet. I also moved `react-native-share` out of `pluginManagement ` block in `android/settings.gradle` because it does not belong there.
related issue : #15447 This PR makes use of https://github.com/gradle/github-dependency-graph-gradle-plugin to generate deps so that we may get rid of the AWK script that parses `gradle` output to figure out `gradle` dependencies. credits to @mendelskiv93 for doing initial research on this dependency generator plugin. We still miss a few dependencies and are not completely able to get rid of the hack list step just yet. I also moved `react-native-share` out of `pluginManagement ` block in `android/settings.gradle` because it does not belong there.
related issue : #15447 This PR makes use of https://github.com/gradle/github-dependency-graph-gradle-plugin to generate deps so that we may get rid of the AWK script that parses `gradle` output to figure out `gradle` dependencies. credits to @mendelskiv93 for doing initial research on this dependency generator plugin. We still miss a few dependencies and are not completely able to get rid of the hack list step just yet. I also moved `react-native-share` out of `pluginManagement ` block in `android/settings.gradle` because it does not belong there.
related issue : #15447 This PR makes use of https://github.com/gradle/github-dependency-graph-gradle-plugin to generate deps so that we may get rid of the AWK script that parses `gradle` output to figure out `gradle` dependencies. credits to @mendelskiv93 for doing initial research on this dependency generator plugin. We still miss a few dependencies and are not completely able to get rid of the hack list step just yet. I also moved `react-native-share` out of `pluginManagement ` block in `android/settings.gradle` because it does not belong there.
related issue : #15447 This PR makes use of https://github.com/gradle/github-dependency-graph-gradle-plugin to generate deps so that we may get rid of the AWK script that parses `gradle` output to figure out `gradle` dependencies. credits to @mendelskiv93 for doing initial research on this dependency generator plugin. We still miss a few dependencies and are not completely able to get rid of the hack list step just yet. I also moved `react-native-share` out of `pluginManagement ` block in `android/settings.gradle` because it does not belong there.
related issue : #15447 This commit makes use of https://github.com/gradle/github-dependency-graph-gradle-plugin to generate deps so that we may get rid of the AWK script that parses `gradle` output to figure out `gradle` dependencies. credits to Vedran for doing initial research on this dependency generator plugin. We still miss a few dependencies and are not completely able to get rid of the hack list step just yet. I also moved `react-native-share` out of `pluginManagement ` block in `android/settings.gradle` because it does not belong there.
related issue : #15447 This commit makes use of https://github.com/gradle/github-dependency-graph-gradle-plugin to generate deps so that we may get rid of the AWK script that parses `gradle` output to figure out `gradle` dependencies. credits to Vedran for doing initial research on this dependency generator plugin. We still miss a few dependencies and are not completely able to get rid of the hack list step just yet. I also moved `react-native-share` out of `pluginManagement ` block in `android/settings.gradle` because it does not belong there.
related issue : #15447 This commit makes use of https://github.com/gradle/github-dependency-graph-gradle-plugin to generate deps so that we may get rid of the AWK script that parses `gradle` output to figure out `gradle` dependencies. credits to Vedran for doing initial research on this dependency generator plugin. We still miss a few dependencies and are not completely able to get rid of the hack list step just yet. I also moved `react-native-share` out of `pluginManagement ` block in `android/settings.gradle` because it does not belong there.
related issue : #15447 This commit makes use of https://github.com/gradle/github-dependency-graph-gradle-plugin to generate deps so that we may get rid of the AWK script that parses `gradle` output to figure out `gradle` dependencies. credits to Vedran for doing initial research on this dependency generator plugin. We still miss a few dependencies and are not completely able to get rid of the hack list step just yet. I also moved `react-native-share` out of `pluginManagement ` block in `android/settings.gradle` because it does not belong there.
There is a terrible hack hidden in how we generate the
nix/deps/gradle/deps.json
which is consumed by the Gradle dependencies derivation which is responsible for providing Gradle with all necessary dependencies for builds. This hack is this AWK script:status-mobile/nix/deps/gradle/gradle_parser.awk
Lines 17 to 46 in 8c358d4
Which parses the output of a Gradle call that prints tree of dependencies which looks like this:
The result of parsing this file is
nix/deps/gradle/deps.list
which is then turned intonix/deps/gradle/deps.urls
which in turn is used to createnix/deps/gradle/deps.json
.This is not a good way of generating this list of dependencies. And is possibly the cause of some dependencies being missed in the React Native upgrade PR, specifically:
org.jetbrains.kotlin.jvm:org.jetbrains.kotlin.jvm.gradle.plugin:1.6.10
com.android.tools.lint:lint-gradle:30.3.0
Which is why we need a more proper solution, in the form of a custom Gradle task that can print out the list of dependencies as it is without the need for parsing disgusting trees with AWK. Such a solution would most probably be close to a task like this:
Which was found in some StackOverflow by @siddarthkay .
The text was updated successfully, but these errors were encountered: