In sbt, how do you add a plugin that's in the local filesystem?

前端 未结 2 402
广开言路
广开言路 2020-12-24 07:29

If I want to add a plugin that\'s in a local directory outside the project tree, what\'s the right way to do that? Say I clone something simple like https://github.com/step

2条回答
  •  悲&欢浪女
    2020-12-24 07:54

    Something like this in project/project/Build.scala should do it:

    import sbt._
    object PluginDef extends Build {
        lazy val projects = Seq(root)
        lazy val root = Project("plugins", file(".")) dependsOn( shPlugin )
        lazy val shPlugin = uri("file:///tmp/sbt-sh")
    }
    

    Note that that the doubly-nested project directories are required. I'm not aware of any way to do this from an .sbt file (there may be a way, but I don't know what it is).

    This is documented here (see "1d) Project dependency").

提交回复
热议问题