Remove deprecated `from_target` usage in examples.

Review Request #4262 - Created Sept. 26, 2016 and submitted

Information
Kris Wilson
pants
3900, 3901
Reviewers
pants-reviews
gmalmquist, mateor, yujiec, zundel

This eliminates a deprecation warning that happens during full graph parse:

[illuminati pants (master)]$ ./pants dependees
WARN] While parsing BuildFile(examples/src/protobuf/org/pantsbuild/example/unpacked_jars/BUILD, FileSystemProjectTree(/Users/kwilson/dev/pants)):
    3: 
    4: java_protobuf_library(name='unpacked_jars',
    5:   # This uses the legacy deferred sources mechanism.
*   6:   sources=from_target(':external-source'),
        DeprecationWarning: DEPRECATED: pants.build_graph.from_target.__call__ will be removed in version 1.3.0.
  Using sources = from_target() has been deprecated. Try using remote_sources() instead.

For example, instead of this:

  java_protobuf_library(name='proto',
    sources=from_target(':other-target'),
    platform='java7',
  )

Try this:

  remote_sources(name='proto',
    dest=java_protobuf_library,
    sources_target=':other-target',
    args=dict(
      platform='java7',
    )
  )

    7: )
    8: 
    9: remote_sources(name='better-unpacked-jars',
   10:   # This uses the new deferred sources mechanism.

CI is green here: https://travis-ci.org/pantsbuild/pants/builds/162339404

Yujie Chen
Stu Hood
Kris Wilson
Review request changed

Status: Closed (submitted)

Change Summary:

thanks Yujie and Stu! this is in @ https://github.com/pantsbuild/pants/commit/8f70d148ef440f13a92429c450168ccf473aaaf8

Loading...