How to alias a sequence of tasks?

前端 未结 3 505
梦谈多话
梦谈多话 2021-02-04 03:16

I have custom tasks in my SBT (0.12.2) project. Let\'s call them a, b and c. So when I\'m in the interactive mode of SBT I can just type <

相关标签:
3条回答
  • 2021-02-04 03:36

    I've been looking for the same thing and found this request for an easy way of aliasing and the commit that provides one: addCommandAlias.

    In my build.sbt I now have:

    addCommandAlias("go", ";container:start;~copy-resources")
    

    As you might guess, writing go in the console will now run the longer command sequence for me.

    0 讨论(0)
  • 2021-02-04 03:40

    I've figured it out:

    lazy val taskSettings = Seq(
        all <<= c dependsOn (b dependsOn a)
    )
    
    0 讨论(0)
  • 2021-02-04 03:43

    another way to achieve this is to define an alias in your .sbtrc file which will be in the root of your project directory.

    alias all=;a;b;c
    

    you have an additional option of defining these .sbtrc file in your home directory in which case this alias will be available to all your projects.

    0 讨论(0)
提交回复
热议问题