https://pantsbuild.org/ logo
r

refined-hydrogen-47967

05/01/2023, 9:36 AM
Hi, is there anything equivalent to the alias target from Pants v1 in Pants v2?
c

curved-television-6568

05/01/2023, 11:29 AM
yes, that would be the
target
target: https://www.pantsbuild.org/docs/reference-target
e

enough-analyst-54434

05/01/2023, 12:40 PM
That is not actually the same. The alias target was inlined and so you could trick a rule into thinking an alias is what it points to. In v2 a target is basically not digestible by any rule in that way: https://v1.pantsbuild.org/build_dictionary.html
You can't
pants run
a
target
for example.
c

curved-television-6568

05/01/2023, 2:18 PM
ok, so the “closest” thing, then.. depending on what you want to achieve. Thanks for the clarification John. 🙂
e

enough-analyst-54434

05/01/2023, 4:13 PM
Yeah. V1 also has
target
though; so I'm guessing that's no dice.
😅 1
f

fast-nail-55400

05/01/2023, 4:34 PM
@refined-hydrogen-47967: What is the envisioned use case?
r

refined-hydrogen-47967

05/01/2023, 11:57 PM
I was hoping to be able to run
pants package
on an alias for a
deploy_jar
target. With Pants v1 we've set up a directory with aliases for the
jvm_binary
targets for each service we deploy to try and simplify our ci/cd pipeline. Without alias though I think we could probably just move the
deploy_jar
targets to where the aliases are currently.
c

curved-television-6568

05/02/2023, 12:09 AM
Ah, in v2 there’s a
[cli.alias]
config section you may use: https://www.pantsbuild.org/docs/reference-cli#alias
or, there’s also an option to use tags and filtering to select what your goal should operate on.
👍 1
r

refined-hydrogen-47967

05/02/2023, 12:52 AM
Nice, I think tagging each
deploy_jar
target will achieve what I'm looking for. Thank you!
👌 1
3 Views