dep-usage: output aliases information

Review Request #3984 - Created June 7, 2016 and submitted

Information
Peiyu Wang
pants
3569
Reviewers
pants-reviews
nhoward_tw, stuhood, zundel

Output alias information to declared dependencies allows offline
script to determine which those aliases can be further cleaned up:

1) aliases without any dependency being used can be removed.
2) aliases with some dependencies' products uesd can be replaced by
those depedencies.
3) aliases with all their dependencies used won't change.

It outputs information in json like this:

  "a/b/c":
    "cost": 30862, 
    "cost_transitive": 4095740906, 
    "dependencies": [
      {
        "aliases": [
          "finagle/finagle-http:finagle-http"
        ],       
        "dependency_type": "declared", 
        "products_used": 0, 
        "products_used_ratio": 0.0, 
        "target": "finagle/finagle-http/src/main/java:java"
      },   
      {
        "aliases": [
          "finagle/finagle-http:finagle-http"
        ],       
        "dependency_type": "declared", 
        "products_used": 14, 
        "products_used_ratio": 0.024013722126929673, 
        "target": "finagle/finagle-http/src/main/scala:scala"
      },
      {
        "aliases": [
          "finagle/finagle-stats:finagle-stats"
        ], 
        "dependency_type": "declared", 
        "products_used": 0, 
        "products_used_ratio": 0.0, 
        "target": "finagle/finagle-stats/src/main/scala:scala"
      },
     ...

In this example, we know
1) we can completely get rid of finagle/finagle-stats:finagle-stats because its resolved aliases do not provide any products
2) finagle/finagle-http:finagle-http is partially used, we can replace it with finagle/finagle-http/src/main/scala:scala, essentially removed the unused finagle/finagle-http/src/main/java:java

https://travis-ci.org/peiyuwang/pants/builds/135994166 passed
https://travis-ci.org/peiyuwang/pants/builds/137144212 passed

Issues

  • 0
  • 3
  • 0
  • 3
Description From Last Updated
Nick Howard (Twitter)
Stu Hood
Peiyu Wang
Peiyu Wang
Peiyu Wang
Stu Hood
Peiyu Wang
Peiyu Wang
Review request changed

Status: Closed (submitted)

Change Summary:

Merged as 36cb5752b12289ceefa4312673f813ca9892d5b3

Loading...