Upstream a simple helper for suffixing the scala platform version on libraries.

Review Request #2891 — Created Sept. 25, 2015 and submitted

stuhood
pants
ddc7c51...
pants-reviews
benjyw, ity, jsirois, nhoward_tw, patricklaw

Add helpers for suffixing the scala platform version on libraries. We've been using this internally to ease scala upgrades by centralizing the platform version. We could of course do much, much more with this, so consider this revision a strawman.

  • Add scala_jar for use with remote dependencies
  • Add scala_artifact for use in provides clauses

Most likely what this should do instead would be to define classpaths for each platform, with the major version as a key.

https://github.com/pantsbuild/pants/pull/2273

JS
  1. Yay - I can use this to kill the last BUILD.tools entries!
    Thank you for upstreaming.
  2. This is complex to reason about since Artifact has a bare name member variable with no getter/setter encapsulation.  Can you clean up the relationship in this RB to make what happens here be crystal clear?
  3. This is currently not provably ok since ScalaPlatform is not ensured exposed, if you add a `def global_subsystems()` to jvm/register.py then this is become clearly OK.
  4. Both runtime and scalac should follow from version - please add a TODO
  5. 2.11 please, it seems to me pants should always default to the latest stable version of a thing even if our userbase has not caught up.
  6. Perhaps s/name/artifact name/ since this is targeted narrowly at artifact names.
  7. 
      
MO
  1. Ship It!
  2. 
      
ST
BE
  1. We do something similar in our 3rdparty/BUILD:

    ```scala_version = '2.10.4'

    def sjar(org, name, kwargs):
    scala_jar_version = '2.10'
    return jar(org = org, name = '%s_%s' % (name, scala_jar_version),
    kwargs)
    ```

    So this is great and will enable us to get rid of that hack.

  2. Add a TODO to derive the default scala-library/compiler jar references from the version.

  3. 
      
ST
ST
JS
  1. 
      
  2. Kill trailing ws
  3. Locally self._name makes more sense, ditto for JarDependency.

  4. 
      
ST
ST
Review request changed

Status: Closed (submitted)

Change Summary:

Merged as 43f4b2df81e1aff6b75477db4da33a84965d3b93

Loading...