https://pantsbuild.org/ logo
#general
Title
# general
j

jolly-chef-92794

09/10/2015, 6:38 PM
So I have discovered (after a few hours of debugging) that if configure a jvm tool
pants.ini
like:
Copy code
[gen.wire]
wire_compiler: ':square-wire-compiler'
With a
BUILD.tools
like:
Copy code
target(name='square-wire-compiler',
  dependencies=[
    '3rdparty:...',
    '3rdparty:...',
  ],
)
Pants will silently use the default jvm tool classpath for Wire, but will give the synthetic target the name
:square-wire-compiler
. (In wire_gen,
self.context.resolve(':square-wire-compiler')
returns a
JarLibrary(BuildFileAddress(FilesystemBuildFile(/Users/gmalmquist/Development/java/3rdparty/BUILD.gen), com.squareup.wire.wire-compiler))
). I eventually realized that the correct thing to do is specify
Copy code
[gen.wire]
wire_compiler: //:square-wire-compiler
In which case
self.context.resolve(':square-wire-compiler')
correctly returns the
target()
I've defined in
BUILD.tools
.