sbt-updates icon indicating copy to clipboard operation
sbt-updates copied to clipboard

getting updates for sbt plugins

Open mheese opened this issue 10 years ago • 31 comments

This is not really an issue, but a feature request: it would be extremely awesome if one could check sbt plugin updates with this sbt plugin as well.

mheese avatar Nov 14 '13 15:11 mheese

You can easily do it by adding plugin to the "meta"-project so to say. For example, to add it globally, put in ~/.sbt/0.13/plugins/project/plugins.sbt the line

addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.1.2")

Now in any project you can do (in sbt):

> reload plugins
> dependencyUpdates

then use reload return to return to the project.

Moreover, you can make an alias for that. Add to your ~/.sbt/0.13/global.sbt:

addCommandAlias("pluginUpdates", "; reload plugins; dependencyUpdates; reload return")

laughedelic avatar Nov 16 '13 02:11 laughedelic

Awesome! Works like a charm! In my opinion this hint deserves a place in the README.md of this project.

mheese avatar Nov 17 '13 08:11 mheese

Nice trick, @laughedelic, thanks. I'm reopening the issue because it was in my plans to add a native task for plugin updates.

rtimush avatar Nov 18 '13 06:11 rtimush

:+1:

pjean avatar Feb 03 '14 20:02 pjean

:+1:

jkleckner avatar Feb 10 '14 21:02 jkleckner

+1

analytically avatar Feb 10 '14 21:02 analytically

+1 for easier native method, e.g. pluginDependencyUpdates

fommil avatar Jun 27 '14 20:06 fommil

+1 for pluginUpdates

erikkaplun avatar Sep 14 '14 12:09 erikkaplun

:+1:

wookietreiber avatar Sep 14 '14 21:09 wookietreiber

+1 for native pluginUpdates

jedesah avatar Nov 05 '14 16:11 jedesah

+1

He-Pin avatar Jan 27 '15 11:01 He-Pin

+1 for native pluginUpdates

antonini avatar Feb 18 '15 10:02 antonini

:+1: The above trick works so there is no hurry, but I think it would still be valuable addition

Ciantic avatar Sep 22 '15 16:09 Ciantic

@rtimush I tried the above trick, but can't get it to work:

$ reload plugins
[info] Loading global plugins from /Users/XXX/dotfiles/scala/.sbt/0.13/plugins/project
[info] Loading global plugins from /Users/XXX/dotfiles/scala/.sbt/0.13/plugins
[info] Loading project definition from /Users/XXX/Developer/YYY/project
> dependencyUpdates
[info] Found 5 dependency updates for project
[info]   org.scala-lang:scala-compiler:ensime-internal : 2.10.6 -> 2.11.8
[info]   org.scala-lang:scala-library:ensime-internal  : 2.10.6 -> 2.11.8
[info]   org.scala-lang:scala-library:provided         : 2.10.6 -> 2.11.8
[info]   org.scala-lang:scala-reflect:ensime-internal  : 2.10.6 -> 2.11.8
[info]   org.scala-lang:scalap:ensime-internal         : 2.10.6 -> 2.11.8

dependencyUpdates includes updates for the Scala version, but not about outdated plugins, even though I deliberately downgraded a couple of plugins, both in my global plugins.sbt and in the plugins.sbt of the project.

swsnr avatar Mar 24 '16 09:03 swsnr

Same:

> reload plugins
[info] Loading global plugins from /home/aromanov/.sbt/0.13/plugins
[info] Updating {file:/home/aromanov/.sbt/0.13/plugins/}global-plugins...
[info] Resolving org.fusesource.jansi#jansi;1.4 ...
[info] Done updating.
[info] Loading project definition from /home/aromanov/IdeaProjects/scalan-lite-1/project
> show libraryDependencies
[info] List(org.scala-lang:scala-library:2.10.5:provided, com.eed3si9n:sbt-assembly:0.13.0 (e:sbtVersion=0.13, e:scalaVersion=2.10), com.github.gseitz:sbt-release:1.0.0 (e:sbtVersion=0.13, e:scalaVersion=2.10))
> dependencyUpdates
[info] Found 1 dependency update for project
[info]   org.scala-lang:scala-library:provided : 2.10.5 -> 2.10.6 -> 2.11.8

But current sbt-assembly version is 0.14.3 and sbt-release is 1.0.3.

alexeyr avatar Apr 18 '16 10:04 alexeyr

I'm seeing the same issue as @lunaryorn and @alexeyr.

milessabin avatar May 17 '16 07:05 milessabin

The issue persists and @laughedelic's workaround doesn't work anymore, as people are saying. Is there another workaround that works? If not, is this feature scheduled for anytime soon?

ruippeixotog avatar Feb 08 '17 11:02 ruippeixotog

Nevermind what I said, I updated sbt-updates to version 0.3.0 and the workaround seems to have started working again :)

ruippeixotog avatar Feb 08 '17 11:02 ruippeixotog

workaround doesn't work for me:

> reload plugins
[info] Loading project definition from /Users/dmitry/Projects/events/project
> show libraryDependencies
[info] * org.scala-lang:scala-library:2.10.6:provided
[info] * io.get-coursier:sbt-coursier:1.0.0-M15-1 (e:sbtVersion=0.13, e:scalaVersion=2.10)
[info] * org.ensime:sbt-ensime:1.12.6 (e:sbtVersion=0.13, e:scalaVersion=2.10)
[info] * io.spray:sbt-revolver:0.8.0 (e:sbtVersion=0.13, e:scalaVersion=2.10)
[info] * com.geirsson:sbt-scalafmt:0.5.6 (e:sbtVersion=0.13, e:scalaVersion=2.10)
[info] * org.scalastyle:scalastyle-sbt-plugin:0.8.0 (e:sbtVersion=0.13, e:scalaVersion=2.10)
[info] * com.timushev.sbt:sbt-updates:0.3.0 (e:sbtVersion=0.13, e:scalaVersion=2.10)
> dependencyUpdates
[error] Not a valid command: dependencyUpdates
[error] Not a valid key: dependencyUpdates (similar: dependencyClasspath, dependencyOverrides, dependency-overrides)
[error] dependencyUpdates
[error]                  ^
>

Am I missing something in sbt-updates setup?

slothspot avatar Feb 18 '17 12:02 slothspot

@slothspot did you setup sbt-updates just for the project or in the global sbt configuration file? In order to get dependency updates for sbt plugins you need to have sbt-updates configured globally.

rtimush avatar Feb 18 '17 12:02 rtimush

Oh, thanks for explanation. I prefer per-project plugins setup. May be it would be reasonable to add note about this in README?

slothspot avatar Feb 18 '17 12:02 slothspot

Yes, it is worth mentioning in the README. Regarding a per-project setup — I suppose if you add sbt-updates as a plugin to your build project (addSbtPlugin in project/project/sbt-updates.sbt) then it will work for plugin updates.

rtimush avatar Feb 18 '17 12:02 rtimush

In case of putting sbt-updates.sbt into project/project dependencyUpdates is not available for project itself, and placing sbt-updates.sbt twice inside of the project is not very convenient.

slothspot avatar Feb 18 '17 12:02 slothspot

This is why it's called a workaround, not a solution. Again... Problem: include updates for plugins. Workaround: plugins are just dependencies of the meta build, so use sbt-updates on the meta build.

Regardless, I would recommend setting it up globally. After all, you don't want CI or other machines to have to download it, but you do want to use it for any project on your machine (there's nothing about one project that makes sbt-native-packager updates more useful than the next project). Hence its usefulness is per machine (well, user...) not project.

On Sat, Feb 18, 2017, 7:39 AM Dmitry Melnichenko [email protected] wrote:

In case of putting sbt-updates.sbt into project/project dependencyUpdates is not available for project itself, and placing sbt-updates.sbt twice inside of the project is not very convenient.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/rtimush/sbt-updates/issues/10#issuecomment-280843080, or mute the thread https://github.com/notifications/unsubscribe-auth/AAGAUFGxH1gC_LKzCBe5x4w9eXuujeL1ks5rduZlgaJpZM4BNUYg .

nafg avatar Feb 19 '17 01:02 nafg

@nafg, idea is clear and understandable. But since I use custom tasks which depend on plugins, I prefer when projects don't depend on per-user defined plugins.

slothspot avatar Feb 19 '17 10:02 slothspot

@slothspot have you read this? Do you actually define any tasks depending on this plugin in the meta-project? I doubt it. So adding this plugin to your global scope meta-project is actually what you want:

projects don't depend on per-user defined plugins

laughedelic avatar Feb 19 '17 15:02 laughedelic

@laughedelic I've got main point already, and don't have any tasks depend on this plugin. But in general I prefer per-project plugins configuration and it was not clear for me after reading sbt-updates documentation that I need to define this plugin globally to make plugins update check work.

slothspot avatar Feb 20 '17 06:02 slothspot

Anyone tried the workaround with sbt-updates 0.3.4 and sbt 1.1.1? I can't get it to work.

It works for some plugins (e.g. lagom) but not others (e.g. dependency-check).

steinybot avatar Apr 03 '18 00:04 steinybot

Could probably look at https://github.com/scalacenter/load-plugin, which is able to load a plugin into the meta-build.

dwijnand avatar May 03 '18 10:05 dwijnand

Any idea if/when this would be implemented? :)

DaimonPl avatar Oct 02 '18 07:10 DaimonPl