reibitto / sbt-welcome

An SBT plugin for displaying a welcome message and commonly used tasks.
Apache License 2.0
81 stars 4 forks source link

Aliases are not working after upgrading to 0.3.0 #8

Closed kpodsiad closed 1 year ago

kpodsiad commented 1 year ago

Hey, first of all, thank you for wonderful plugin, good looking project name in ascii art is usually the first thing which I'm adding to a serious projects I'm working in!

After recent 0.3.0 upgrade our custom aliases stopped working, I have small repo with reproduction https://github.com/kpodsiad/package-type.

For such declared aliases

def tasks: Vector[UsefulTask] = Vector(
  UsefulTask(
    "compile",
    "compile files"
  ),
  UsefulTask(
    "test",
    "run tests in project"
  ),
  UsefulTask(
    "clean; compile;",
    "clean compile"
  ).alias("cc")
)

I'm seeing following in terminal:

[info] a. compile - compile files
[info] b. test - run tests in project
[info] cc. clean; compile; - clean compile

a is compiling, b is testing but when I type cc I got error Not a valid command: cc. I was surprised to discover that c is invoking clean compile, it seems like different alias is being shown and different one is being registered to the sbt.

I double checked example in readme.md - https://github.com/reibitto/sbt-welcome#defining-a-custom-alias and this is exactly how I'm defining alias - UsefulTask("all root/scalafmtSbt root/scalafmtAll", "formats all Scala files in project").alias("fmt").

Am I missing something or some regression has slipped thorugh 0.3.0 refactor?