Leverage default sources where possible.

Review Request #4358 - Created Nov. 6, 2016 and submitted

Information
John Sirois
pants
jsirois/default_sources/leverage
4033
9f2aa9e...
Reviewers
pants-reviews
benjyw
contrib/go/src/python/pants/contrib/go/subsystems/BUILD                                                                           | 1 -
 contrib/python/src/python/pants/contrib/python/checks/tasks/BUILD                                                                 | 1 -
 contrib/python/tests/python/pants_test/contrib/python/checks/tasks/checkstyle/BUILD                                               | 1 -
 contrib/scalajs/src/python/pants/contrib/scalajs/subsystems/BUILD                                                                 | 1 -
 contrib/scalajs/src/python/pants/contrib/scalajs/targets/BUILD                                                                    | 1 -
 contrib/scalajs/src/python/pants/contrib/scalajs/tasks/BUILD                                                                      | 1 -
 contrib/scalajs/tests/scala/org/pantsbuild/scalajs/example/factfinder/BUILD                                                       | 1 -
 examples/src/java/org/pantsbuild/example/3rdparty_jvm.md                                                                          | 2 +-
 examples/src/java/org/pantsbuild/example/java_sources/BUILD                                                                       | 1 -
 examples/src/python/example/README.md                                                                                             | 6 +++---
 examples/src/python/example/pants_publish_plugin/BUILD                                                                            | 1 -
 examples/src/scala/org/pantsbuild/example/fact/BUILD                                                                              | 4 +---
 examples/src/scala/org/pantsbuild/example/hello/welcome/BUILD                                                                     | 1 -
 examples/tests/java/org/pantsbuild/example/hello/greet/BUILD                                                                      | 1 -
 examples/tests/python/example_test/hello/greet/BUILD                                                                              | 1 -
 examples/tests/python/example_test/hello/greet/{greet.py => test_greet.py}                                                        | 0
 examples/tests/scala/org/pantsbuild/example/hello/welcome/BUILD                                                                   | 1 -
 examples/tests/scala/org/pantsbuild/example/hello/welcome/{Welcome.scala => WelSpec.scala}                                        | 0
 pants-plugins/tests/python/internal_backend_test/utilities/BUILD                                                                  | 1 -
 src/java/com/sun/tools/javac/api/BUILD                                                                                            | 1 -
 src/java/org/pantsbuild/args4j/BUILD                                                                                              | 1 -
 src/java/org/pantsbuild/junit/annotations/BUILD                                                                                   | 1 -
 src/java/org/pantsbuild/testing/BUILD                                                                                             | 1 +
 src/java/org/pantsbuild/tools/jar/BUILD                                                                                           | 1 -
 src/java/org/pantsbuild/tools/junit/withretry/BUILD                                                                               | 1 -
 src/java/org/pantsbuild/tools/runner/BUILD                                                                                        | 1 -
 src/python/pants/backend/docgen/targets/BUILD                                                                                     | 1 -
 src/python/pants/backend/docgen/tasks/BUILD                                                                                       | 1 -
 src/python/pants/backend/graph_info/tasks/BUILD                                                                                   | 1 -
 src/python/pants/backend/jvm/zinc/BUILD                                                                                           | 1 -
 src/python/pants/backend/python/tasks/BUILD                                                                                       | 1 -
 src/python/pants/build_graph/BUILD                                                                                                | 1 -
 src/python/pants/cache/BUILD                                                                                                      | 1 -
 src/python/pants/core_tasks/BUILD                                                                                                 | 1 -
 src/python/pants/fs/BUILD                                                                                                         | 1 -
 src/python/pants/help/BUILD                                                                                                       | 1 -
 src/python/pants/invalidation/BUILD                                                                                               | 1 -
 src/python/pants/ivy/BUILD                                                                                                        | 1 -
 src/python/pants/java/junit/BUILD                                                                                                 | 1 -
 src/python/pants/logging/BUILD                                                                                                    | 1 -
 src/python/pants/option/BUILD                                                                                                     | 1 -
 src/python/pants/process/BUILD                                                                                                    | 1 -
 src/python/pants/source/BUILD                                                                                                     | 1 -
 src/python/pants/stats/BUILD                                                                                                      | 1 -
 src/python/pants/subsystem/BUILD                                                                                                  | 1 -
 src/python/pants/task/BUILD                                                                                                       | 1 -
 src/scala/org/pantsbuild/zinc/BUILD                                                                                               | 1 -
 src/scala/org/pantsbuild/zinc/cache/BUILD                                                                                         | 1 -
 src/scala/org/pantsbuild/zinc/logging/BUILD                                                                                       | 1 -
 src/scala/sbt/compiler/javac/BUILD                                                                                                | 1 -
 src/scala/sbt/inc/BUILD                                                                                                           | 1 -
 testprojects/src/java/org/pantsbuild/testproject/annotation/processorwithdep/hellomaker/BUILD                                     | 1 -
 testprojects/src/java/org/pantsbuild/testproject/inccompile/libwithjettydep/BUILD                                                 | 1 -
 testprojects/src/java/org/pantsbuild/testproject/inccompile/libwithjettyserver/BUILD                                              | 1 -
 testprojects/src/java/org/pantsbuild/testproject/jvmprepcommand/BUILD                                                             | 4 +---
 testprojects/src/java/org/pantsbuild/testproject/publish/hello/greet/BUILD                                                        | 1 -
 testprojects/src/java/org/pantsbuild/testproject/publish/protobuf/BUILD                                                           | 1 -
 testprojects/src/java/org/pantsbuild/testproject/shadingdep/BUILD                                                                 | 4 +---
 testprojects/src/java/org/pantsbuild/testproject/shadingdep/otherpackage/BUILD                                                    | 4 +---
 testprojects/src/java/org/pantsbuild/testproject/shadingdep/subpackage/BUILD                                                      | 4 +---
 testprojects/src/java/org/pantsbuild/testproject/targetlevels/java6/BUILD                                                         | 1 -
 testprojects/src/java/org/pantsbuild/testproject/unicode/cucumber/BUILD                                                           | 1 -
 testprojects/src/python/sources/BUILD                                                                                             | 1 -
 testprojects/src/scala/org/pantsbuild/testproject/compilation_failure/BUILD                                                       | 4 +---
 testprojects/src/scala/org/pantsbuild/testproject/publish/hello/welcome/BUILD                                                     | 1 -
 testprojects/src/scala/org/pantsbuild/testproject/sharedsources/BUILD                                                             | 2 --
 testprojects/src/scala/org/pantsbuild/testproject/unicode/shapeless/BUILD                                                         | 1 -
 testprojects/src/scala/org/pantsbuild/testproject/unicode/unicodedep/consumer/BUILD                                               | 1 -
 testprojects/src/scala/org/pantsbuild/testproject/unicode/unicodedep/provider/BUILD                                               | 4 +---
 testprojects/tests/java/org/pantsbuild/testproject/empty/BUILD                                                                    | 4 +---
 testprojects/tests/java/org/pantsbuild/testproject/timeout/BUILD                                                                  | 1 -
 testprojects/tests/java/org/pantsbuild/testproject/timeout/{SleeperTestLong.java => LongSleeperTest.java}                         | 2 +-
 testprojects/tests/java/org/pantsbuild/testproject/timeout/{SleeperTestShort.java => ShortSleeperTest.java}                       | 2 +-
 testprojects/tests/java/org/pantsbuild/testproject/unicode/cucumber/BUILD                                                         | 1 -
 testprojects/tests/java/org/pantsbuild/testproject/workdirs/onedir/BUILD                                                          | 1 -
 testprojects/tests/scala/org/pantsbuild/testproject/cp-directories/{ClasspathDirectories.scala => ClasspathDirectoriesSpec.scala} | 4 ++--
 tests/java/org/pantsbuild/args4j/BUILD                                                                                            | 1 -
 tests/java/org/pantsbuild/testing/BUILD                                                                                           | 1 -
 tests/java/org/pantsbuild/tools/jar/BUILD                                                                                         | 1 -
 tests/java/org/pantsbuild/tools/junit/lib/BUILD                                                                                   | 4 +++-
 tests/java/org/pantsbuild/tools/runner/BUILD                                                                                      | 1 -
 tests/python/pants_test/backend/jvm/tasks/test_junit_run_integration.py                                                           | 4 ++--
 tests/python/pants_test/backend/jvm/zinc/BUILD                                                                                    | 1 -
 tests/python/pants_test/engine/legacy/test_changed_integration.py                                                                 | 4 ++--
 tests/python/pants_test/fs/BUILD                                                                                                  | 1 -
 tests/python/pants_test/java/junit/BUILD                                                                                          | 1 -
 tests/python/pants_test/logging/BUILD                                                                                             | 1 -
 tests/python/pants_test/net/http/BUILD                                                                                            | 1 -
 tests/python/pants_test/option/util/BUILD                                                                                         | 1 -
 tests/python/pants_test/process/BUILD                                                                                             | 1 -
 tests/python/pants_test/stats/BUILD                                                                                               | 1 -
 tests/scala/org/pantsbuild/zinc/BUILD                                                                                             | 1 -
 tests/scala/org/pantsbuild/zinc/logging/BUILD                                                                                     | 1 -
 93 files changed, 24 insertions(+), 112 deletions(-)

Used the following (on a modern linux distro) to ~autoconvert:

for t in java_library scala_library junit_tests python_library python_tests
do
  ./pants filter --type=$t :: \
  | cut -d: -f1 | sort -u | sed -e '/^$/d' -e 's|$|/BUILD|' \
  | while read f; do ls $f* || echo $f >2; done \
  | xargs sed -r -i "/\bsources\s*=\s*globs\(['\"]\*\.[a-z]+['\"]\)\s*,?/d"
done

And then fixed up some failing tests by comparing the results of the
following when run on master and this branch - then fixing targets that
owned no files in the branch only:

./pants list {examples,testprojects}:: | {
  while read t; do
    [ -z "$(./pants filemap $t)" ] && echo "No files owned by $t"
  done
}

CI went green here:
https://travis-ci.org/pantsbuild/pants/builds/173760812

Benjy Weinberger
Benjy Weinberger
John Sirois
Review request changed

Status: Closed (submitted)

Change Summary:

Now on master:

git log -1 origin/master
commit 5813a2d3637db9ebf7537bad09114b3c14ec1641
Author: John Sirois <john.sirois@gmail.com>
Date:   Mon Nov 7 08:22:11 2016 -0700

    Leverage default sources where possible.
    
    Testing Done:
    Used the following (on a modern linux distro) to ~autoconvert:
    ```
    for t in java_library scala_library junit_tests python_library python_tests
    do
      ./pants filter --type=$t :: \
      | cut -d: -f1 | sort -u | sed -e '/^$/d' -e 's|$|/BUILD|' \
      | while read f; do ls $f* || echo $f >2; done \
      | xargs sed -r -i "/\bsources\s*=\s*globs(['\"]*.[a-z]+['\"])\s*,?/d"
    done
    ```
    
    And then fixed up some failing tests by comparing the results of the
    following when run on master and this branch - then fixing targets that
    owned no files in the branch only:
    ```
    ./pants list {examples,testprojects}:: | {
      while read t; do
        [ -z "$(./pants filemap $t)" ] && echo "No files owned by $t"
      done
    }
    ```
    
    CI went green here:
      https://travis-ci.org/pantsbuild/pants/builds/173760812
    
    Bugs closed: 4033
    
    Reviewed at https://rbcommons.com/s/twitter/r/4358/
Loading...