I made some changes to the zinc Main class, I want...
# general
e
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
basically you need to run
./pants binary zinc:compiler
, and then add a jar lib to BUILD.tools
which looks like
e
ah okay.
right so zinc isn’t there (in build.tools) right now presumably because its fetched from some maven repo
a
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
yep.
a
there’s some docs on this somewhere
e
okay. in the zinc subsystem zinc comes from some jar like
JarDependency('org.pantsbuild', 'zinc-compiler_2.12', _ZINC_COMPILER_VERSION)
a
yes, that’s the default
e
does that mean that I need to call it
zinc-compiler_2.12
a
if you don’t override it in BUILD.tools
oh
e
in the override
w
there is https://www.pantsbuild.org/publish.html#test-with-a-fake-local-publish , but it doesn't describe using a binary.
a
use
scala_jar
instead of
jar
that adds the appropriate suffix
w
if you need to pair on this, let us know. i probably have time today.
e
would be helpful yes!
but I can give it a try first
a
i probably do too after 2pm or so but stu sounds like he’s there too
e
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
dist
✔️ 1
one sec: i'll be over shortly.
e
sounds good
a
the output file name in
dist/
is the same as the target name, hence
./pants binary zinc:compiler
producing
compiler.jar