xarion
xarion

Reputation: 470

sbt 0.11.3: getting latest version of a git plugin

I've a multi-project structure which builds with sbt 0.11.3. I wanted to centralize my dependency versions, project versions, artifacts, shell prompt stuff and such. It would be really helpful for my plans on release management and version control. So I've created a plugin and put my global configurations there. My projects read it from github and build it as a plugin. Everything is lovely.

./project/project/Build.scala

import sbt._

object PluginDef extends Build {
    override lazy val projects = Seq(root)
    lazy val root = Project("plugins", file(".")) dependsOn(versionPlugin)
    lazy val versionPlugin = uri("git://github.com/config.git") //changed the uri here
}

So sbt fetches the plugins latest version if it haven't been already. Caches that version in ~/.sbt/staging/somehashcode. But I couldn't make it update the project when there are changes in plugin project. I manually go and update it whenever needed. Sadly, in a 20 man team its causing some problems.

How can we make it check for plugin updates?

Upvotes: 7

Views: 985

Answers (1)

Eugene Yokota
Eugene Yokota

Reputation: 95684

I haven't tried this, but the following might work.

refreshing plugin

  1. update to sbt 0.12.1, which fixes update
  2. then from sbt shell:

    > reload plugins
    > update
    > reload return
    

specifying a particular tree

It may be helpful to fix the source dependency to a particular point in time for some situations. If so you can add commit hash or tag as "git://github.com/config.git#hash".

Upvotes: 7

Related Questions