wpilibsuite / native-utils

Gradle utility plugin for compiling native libraries
Other
4 stars 21 forks source link

Add a basic vendor deps dependency mechanism #163

Closed ThadHouse closed 1 year ago

ThadHouse commented 1 year ago

One of the biggest requests for vendor deps has been handling transitive dependencies. Doing this properly is a hard problem. @JCaporuscio had a suggestion for building a basic setup, to allow enabling this for many of the cases without causing a massive amount of development pain.

The basic idea of this is each dependency can have a requires and a conflictsWith block. Each of these blocks contains an array of objects, each containing 3 elements.

uuid: The uuid that is required or that is conflicting errorMessage: An error message to be displayed to the user onlineUrl: The url to search for this vendor dep during installation (This isn't used by this PR, but will be used for the dep loader)

Once all dependencies have been loaded, the entire dep tree is searched. If a dependency has a requires dependency that is not in the graph, the error message is printed. If a dependency has a conflictsWith dependency that is in the graph, the error message is printed.

Because this is done after loading, N level transitive deps would be supported, as would (although why...) circular deps.

This does nothing to ensure vendor deps are the correct year, or that versions match between transitive deps.

This new functionality is not automatically called. I want to move the automation into gradlerio to make configuration easier.