rtimush / sbt-updates

sbt plugin that can check Maven and Ivy repositories for dependency updates
BSD 3-Clause "New" or "Revised" License
758 stars 55 forks source link

getting updates for sbt plugins #10

Open mheese opened 10 years ago

mheese commented 10 years ago

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.

laughedelic commented 10 years ago

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")
mheese commented 10 years ago

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

rtimush commented 10 years ago

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

pjean commented 10 years ago

:+1:

jkleckner commented 10 years ago

:+1:

analytically commented 10 years ago

+1

fommil commented 10 years ago

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

erikkaplun commented 9 years ago

+1 for pluginUpdates

wookietreiber commented 9 years ago

:+1:

jedesah commented 9 years ago

+1 for native pluginUpdates

He-Pin commented 9 years ago

+1

antonini commented 9 years ago

+1 for native pluginUpdates

Ciantic commented 8 years ago

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

swsnr commented 8 years ago

@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.

alexeyr commented 8 years ago

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.

milessabin commented 8 years ago

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

ruippeixotog commented 7 years ago

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 commented 7 years ago

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

slothspot commented 7 years ago

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?

rtimush commented 7 years ago

@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.

slothspot commented 7 years ago

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

rtimush commented 7 years ago

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.

slothspot commented 7 years ago

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.

nafg commented 7 years ago

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 notifications@github.com 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 .

slothspot commented 7 years ago

@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.

laughedelic commented 7 years ago

@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

slothspot commented 7 years ago

@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.

steinybot commented 6 years ago

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).

dwijnand commented 6 years ago

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

DaimonPl commented 5 years ago

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

anilkumarmyla commented 5 years ago

110 documents on how to use sbt-updates as a project plugin. Rest catch all issues reported here might be fixed in the latest version, probably better to close this one and raise specific issues as new ones