Review Request 4394: classmap: a jvm console task that outputs mapping from class products to their targets

0 views
Skip to first unread message

Peiyu Wang

unread,
Nov 18, 2016, 7:06:54 PM11/18/16
to Stu Hood, Nick Howard (Twitter), Benjy Weinberger, Eric Ayers, Mateo Rodriguez, Peiyu Wang, pants-reviews
This is an automatically generated e-mail. To reply, visit: https://rbcommons.com/s/twitter/r/4394/

Review request for pants-reviews, Benjy Weinberger, Mateo Rodriguez, Nick Howard (Twitter), Stu Hood, and Eric Ayers.
By Peiyu Wang.
Bugs: 4081
Repository: pants

Description

The task is straightforward similar to filemap that prints out target-file mapings, this outputs target-class mappings.

This is useful when fixing compilation errors. One use case we encounter recently is to enable strict_deps for performance, there are transitive dependencies need to be added.

This can be achieved by first running classmap to get the transitive target-class mapping, then if after enabling strict_deps, we get error class X not found, we'll add X's mapping target to the dependencies.

Testing

https://travis-ci.org/pantsbuild/pants/builds/177179488

A sample run

tw-mbp-peiyu:pants peiyu$ ./pants classmap testprojects//tests/java/org/pantsbuild/testproject/cucumber:lib |head
org.pantsbuild.testproject.cucumber.BadnamesSteps testprojects/tests/java/org/pantsbuild/testproject/cucumber:lib
org.pantsbuild.testproject.cucumber.DemoSteps testprojects/tests/java/org/pantsbuild/testproject/cucumber:lib
org.junit.ClassRule 3rdparty:junit
org.junit.Assert 3rdparty:junit
org.junit.After 3rdparty:junit
org.junit.rules.Stopwatch$Clock 3rdparty:junit
org.junit.rules.DisableOnDebug 3rdparty:junit
org.junit.rules.ExternalResource 3rdparty:junit
org.junit.rules.TestWatcher$1 3rdparty:junit
org.junit.rules.TemporaryFolder 3rdparty:junit
...

Diffs

  • src/python/pants/backend/jvm/register.py (0650b01fd0242401b539fbb501012e2a06a57ae0)
  • src/python/pants/backend/jvm/tasks/BUILD (3ad608dfb345f07a90e24e4e428727da7e3faf9c)
  • src/python/pants/backend/jvm/tasks/classmap.py (92cfd4f06fc986aa37333a90088896bda1dfd8ae)
  • src/python/pants/backend/jvm/tasks/jvm_compile/jvm_compile.py (ca153ea613b89a3b169a54d6797957b020fe0875)
  • tests/python/pants_test/backend/jvm/tasks/BUILD (b6526d9fa7778110e8e195f5a0c4f470eb3e2397)
  • tests/python/pants_test/backend/jvm/tasks/test_classmap.py (f3e910c2d3e14e81e08cb0c0bccd26f66e718281)
  • tests/python/pants_test/backend/jvm/tasks/test_classmap_integration.py (5a5f9c322604a9a8f7a147aabfc0a1aa5dbc71fb)

View Diff

Reply all
Reply to author
Forward
0 new messages