• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

pantsbuild / pants / 6747
0%
main: 93%

Build:
Build:
LAST BUILD BRANCH: shell-completion-fs
DEFAULT BRANCH: main
Ran 08 Sep 2015 10:16PM UTC
Jobs 10
Files 386
Run time 9min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
6747

push

travis-ci

gmalmquist
Made shading rules accessible and configurable for jvm_binary.

jvm_binary() targets may now specify a shading_rules argument,
which accepts a list of shading rules, which can be any of:

    shading_relocate()
    shading_exclude()
    shading_relocate_package()
    shading_exclude_package()

The order of rules in the list matters, as typical of shading
logic in general.

These rules are powerful enough to take advantage of jarjar's more
advanced syntax, like using wildcards in the middle of package
names. E.g., this syntax will now work:

    # Destination pattern will be inferred to be
    # `__shaded_by_pants__.com.@1.foo.bar.@2`
    shading_relocate('com.*.foo.bar.**')

Which can also be done by:

   shading_relocate_package('com.*.foo.bar')

I also added the ability to change the default
`__shaded_by_pants__` prefix.

    # `__my_prefix__.com.foo.bar.@1`
    shading_relocate_package('com.foo.bar', shade_prefix='__my_prefix__.')

The rules are implemented by `Shading.Relocate`, `Shading.Exclude`,
`Shading.RelocatePackage`, and `Shading.ExcludePackage`.

`Relocate` is the most generic, and acts as the base-class. It is
essentially a factory for the Rule nametuple that previously
existed in `Shader`.

Rather than build off of the pre-existing `shade_class`,
`shade_package`, `exclude_class`, and `exclude_package`, I made
`Relocate` and friends more powerful, extensible and (I hope)
intuitive concepts, and refactored the existing functions to use
the new classes instead.

They are wrapped in a Shading object rather than in the previous
Shader object to keep the objects that make it into BUILD file
aliases separate from those that do not. I also wistfully imagine
a day when we can register BUILD file aliases recursively,
which would let us use syntax like `Shading.Relocate` instead of
shading_relocate, which would both be more consistent with things
like `Duplicate` and `Skip` today, without polluting the global
namespace. Today this is not possible, because while you *can*
register `Shading`, and then access `Shading.*` in BUILD files,
they don't make it into the BUILD dictionary when we generate docs.

Testing Done:
Added tests to tests/python/pants_test/java/jar:shader and tests/python/pants_test/java/jar:shader-integration
Test project under testprojects/src/java/org/pantsbuild/testproject/shading and testprojects/src/java/org/pantsbuild/testproject/shadingdep.

CI went green: https://travis-ci.org/gmalmquist/pants/builds/78593423
CI went green: https://travis-ci.org/gmalmquist/pants/builds/78809269
CI went green: https://travis-ci.org/gmalmquist/pants/builds/79349294
CI went green: https://travis-ci.org/gmalmquist/pants/builds/79354035
CI went green: https://travis-ci.org/gmalmquist/pants/builds/79369976

Bugs closed: 2121

Reviewed at https://rbcommons.com/s/twitter/r/2754/

17429 of 23140 relevant lines covered (75.32%)

1.42 hits per line

Jobs
ID Job ID Ran Files Coverage
1 6747.1 (CI_FLAGS="-cjlpn 'Various pants self checks'") 08 Sep 2015 10:16PM UTC 0
Travis Job 6747.1
2 6747.2 (CI_FLAGS="-fkmsrcn -u 0/2 'Unit tests for pants and pants-plugins - shard 1'") 08 Sep 2015 10:16PM UTC 0
71.14
Travis Job 6747.2
3 6747.3 (CI_FLAGS="-fkmsrcn -u 1/2 'Unit tests for pants and pants-plugins - shard 2'") 08 Sep 2015 10:19PM UTC 0
71.12
Travis Job 6747.3
4 6747.4 (CI_FLAGS="-fkmsrcjlp 'Python contrib tests'") 08 Sep 2015 10:18PM UTC 0
Travis Job 6747.4
5 6747.5 (CI_FLAGS="-fkmsrjlpn -i 0/6 'Python integration tests for pants - shard 1'") 08 Sep 2015 10:17PM UTC 0
Travis Job 6747.5
6 6747.6 (CI_FLAGS="-fkmsrjlpn -i 1/6 'Python integration tests for pants - shard 2'") 08 Sep 2015 10:23PM UTC 0
Travis Job 6747.6
7 6747.7 (CI_FLAGS="-fkmsrjlpn -i 2/6 'Python integration tests for pants - shard 3'") 08 Sep 2015 10:24PM UTC 0
Travis Job 6747.7
8 6747.8 (CI_FLAGS="-fkmsrjlpn -i 3/6 'Python integration tests for pants - shard 4'") 08 Sep 2015 10:24PM UTC 0
Travis Job 6747.8
9 6747.9 (CI_FLAGS="-fkmsrjlpn -i 4/6 'Python integration tests for pants - shard 5'") 08 Sep 2015 10:24PM UTC 0
Travis Job 6747.9
10 6747.10 (CI_FLAGS="-fkmsrjlpn -i 5/6 'Python integration tests for pants - shard 6'") 08 Sep 2015 10:26PM UTC 0
Travis Job 6747.10
Source Files on build 6747
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #6747
  • c40fd43b on github
  • Prev Build on master (#6745)
  • Next Build on master (#6750)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc