Add Pants Target Type to depmap so that intellij plugin can use this to identify scala target VS java target

Review Request #1366 — Created Nov. 19, 2014 and submitted

tejal
pants
655
e464b0d...
pants-reviews
benjyw, fkorotkov, ity, zundel

Add Pants Target Type to depmap so that intellij plugin can use this to identify scala target VS java target

Manually ran
1. ./pants goal test tests/python/pants_test/tasks:depmap
2. ./pants goal test tests/python/pants_test/tasks:depmap_integration

Ci here https://travis-ci.org/pantsbuild/pants/builds/41554780

  • 0
  • 0
  • 0
  • 1
  • 1
Description From Last Updated
ZU
  1. 
      
  2. Note, there can be multiple aliases pointed at the same classname, as in src/python/pants/backend/jvm/register.py:

    'java_tests': JavaTests,
    'junit_tests': JavaTests,
    

    I guess the last one wins? Maybe you somehow want to prefer some aliases? If this isn't important, just add a comment.

    1. At twitter we usages for both junit_tests and java_tests. It is not important which one is returned.

  3. nit, use .format() for string formatting

  4. nit: use .format() for string formatting.

  5. 
      
TE
IT
  1. 
      
  2. use .format

    1. I was under the notion .format is an overkill when you just one value to be substitued. I was confused when to use .format vs %s. and have been following the above rule.
      I just realized its going to be standard in pyhton 3.x.

    2. FWIW, you can shorten it a bit with the numerical syntax "{0}".format(foo)

  3. why not return a list so you dont just return the last one? so this becomes _get_pants_target_aliases ? unless there is a use case I am not thinking of here.

    1. Plugin as a consumer for depmap goal does not need to know all aliases to determine the target type.
      The alias:TargetType mapping is 1:1.

      On the consumer side have logic in place for all target aliases and we treat java_tests and junit_tests as 1.

      After being said that, why do we dont use TargetclassName instead?
      - answer to that question is in plugin, we have builtin a functionality like the TargetDefinitionHelper based on aliases.
      - aliases are user exposed objects and hence we want to stick to aliases.

    2. ah, makes sense as long as you need only one alias to determine the type this should suffice. thanks for the explanation!

  4. 
      
TE
ZU
  1. Ship It!

  2. 
      
IT
  1. Ship It!

  2. 
      
TE
TE
TE
TE
TE
Review request changed

Status: Closed (submitted)

Loading...