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

early-needle-54791

11/22/2019, 7:35 PM
I made some changes to the zinc Main class, I want to test them, but that zinc isn’t getting recompiled or used if I run pants. Any tips on how to get it working would be appreciated
a

aloof-angle-91616

11/22/2019, 7:36 PM
basically you need to run
./pants binary zinc:compiler
, and then add a jar lib to BUILD.tools
which looks like
e

early-needle-54791

11/22/2019, 7:36 PM
ah okay.
right so zinc isn’t there (in build.tools) right now presumably because its fetched from some maven repo
a

aloof-angle-91616

11/22/2019, 7:37 PM
Copy code
jar_library(
  name='zinc',
  jars=[jar(org=..., name=..., rev='???', url='file:///path/to/pants/dist/compiler.jar', mutable=True)],
)
and the org should be org.pantsbuild and the name should be zinc-compiler
the rev being some nonsense is important
because if the
url
is misspelled, it will mysteriously still try to resolve it
w

witty-crayon-22786

11/22/2019, 7:39 PM
yep.
a

aloof-angle-91616

11/22/2019, 7:39 PM
there’s some docs on this somewhere
e

early-needle-54791

11/22/2019, 7:40 PM
okay. in the zinc subsystem zinc comes from some jar like
JarDependency('org.pantsbuild', 'zinc-compiler_2.12', _ZINC_COMPILER_VERSION)
a

aloof-angle-91616

11/22/2019, 7:40 PM
yes, that’s the default
e

early-needle-54791

11/22/2019, 7:40 PM
does that mean that I need to call it
zinc-compiler_2.12
a

aloof-angle-91616

11/22/2019, 7:40 PM
if you don’t override it in BUILD.tools
oh
e

early-needle-54791

11/22/2019, 7:40 PM
in the override
w

witty-crayon-22786

11/22/2019, 7:40 PM
there is https://www.pantsbuild.org/publish.html#test-with-a-fake-local-publish , but it doesn't describe using a binary.
a

aloof-angle-91616

11/22/2019, 7:40 PM
use
scala_jar
instead of
jar
that adds the appropriate suffix
w

witty-crayon-22786

11/22/2019, 7:42 PM
if you need to pair on this, let us know. i probably have time today.
e

early-needle-54791

11/22/2019, 7:42 PM
would be helpful yes!
but I can give it a try first
a

aloof-angle-91616

11/22/2019, 7:42 PM
i probably do too after 2pm or so but stu sounds like he’s there too
e

early-needle-54791

11/22/2019, 7:43 PM
he’s here 🙂
Where does the .jar get put?
I found the z.jar for the compile, but that doesn’t seem complete. actually maybe the composite jar gets produced after
w

witty-crayon-22786

11/22/2019, 7:55 PM
dist
✔️ 1
one sec: i'll be over shortly.
e

early-needle-54791

11/22/2019, 7:59 PM
sounds good
a

aloof-angle-91616

11/22/2019, 8:00 PM
the output file name in
dist/
is the same as the target name, hence
./pants binary zinc:compiler
producing
compiler.jar
5 Views