Re: [sbt] sbt-updates-plugin

93 views
Skip to first unread message

Paul Phillips

unread,
Oct 7, 2012, 6:47:26 PM10/7/12
to simple-b...@googlegroups.com


On Sun, Oct 7, 2012 at 11:26 AM, Roman Timushev <rti...@gmail.com> wrote:
> dependency-updates
[info] Found 3 dependency updates for test-project
[info]   org.scala-lang:scala-library   : 2.9.2 -> 2.10.0-M7
[info]   ch.qos.logback:logback-classic : 1.0.6 -> 1.0.7
[info]   org.slf4j:slf4j-api            : 1.6.6 -> 1.7.1

Excellent.  The feature I would dearly love to see added to this is

> dependency-updates commit
[info] Updating project files...
[info] Updated versions for: scala-library, logback-classic, slf4j-api in build.sbt
% git diff
diff --git i/build.sbt w/build.sbt
-libraryDependencies += "ch.qos.logback" % "logback-classic" % "1.0.6"
+libraryDependencies += "ch.qos.logback" % "logback-classic" % "1.0.7"
[etc, you get the drift]

Obviously if one's build is solving differential equations to figure out the versions this is going to be a tall order; however in almost every case they are hardcoded string literals in build.sbt or project/*.scala in which case it's more of a short order.

Roman Timushev

unread,
Oct 7, 2012, 7:35:55 PM10/7/12
to simple-b...@googlegroups.com
Thanks, Paul. Yes, it would be a good addition. Maven plugin does this.
Need to think how to limit the scope of such replacement though — not everyone is ready to move to 2.10.0-M7 as the plugin suggests.

Paul Phillips

unread,
Oct 7, 2012, 9:12:11 PM10/7/12
to simple-b...@googlegroups.com


On Sun, Oct 7, 2012 at 4:35 PM, Roman Timushev <rti...@gmail.com> wrote:
Need to think how to limit the scope of such replacement though — not everyone is ready to move to 2.10.0-M7 as the plugin suggests.

It would be super useful even if it just blindly made the changes.  We're all running under version control (let's hope) we can pick and choose what changes to keep.  Compare it to the existing alternative; it can't be worse.

Mark Harrah

unread,
Oct 8, 2012, 6:40:19 PM10/8/12
to simple-b...@googlegroups.com
If you don't mind users working with a different setting, you could define a setting `autoDependencies` that gets added to `libraryDependencies` and only operate on that. You can call the code that implements 'session save' to write it to the .sbt. It will automatically replace existing settings in a .sbt file if the new setting is definitive (it doesn't use the previous version, like += does).

-Mark

On Sun, 7 Oct 2012 16:35:55 -0700 (PDT)
Roman Timushev <rti...@gmail.com> wrote:

> Thanks, Paul. Yes, it would be a good addition. Maven plugin does this.
> Need to think how to limit the scope of such replacement though — not
> everyone is ready to move to 2.10.0-M7 as the plugin suggests.
>
> On Monday, October 8, 2012 2:47:28 AM UTC+4, Paul Phillips wrote:
> >
> >
> >
> > On Sun, Oct 7, 2012 at 11:26 AM, Roman Timushev <rti...@gmail.com<javascript:>
> > > wrote:
> >
> >> > dependency-updates
> >> [info] Found 3 dependency updates for test-project
> >> [info] org.scala-lang:scala-library : 2.9.2 -> 2.10.0-M7
> >> [info] ch.qos.logback:logback-classic : 1.0.6 -> 1.0.7
> >> [info] org.slf4j:slf4j-api : 1.6.6 -> 1.7.1
> >>
> >>
> > Excellent. The feature I would dearly love to see added to this is
> >
> > > dependency-updates commit
> > [info] Updating project files...
> > [info] Updated versions for: scala-library, logback-classic, slf4j-api in
> > build.sbt
> > % git diff
> > diff --git i/build.sbt w/build.sbt
> > -libraryDependencies += "ch.qos.logback" % "logback-classic" % "1.0.6"
> > +libraryDependencies += "ch.qos.logback" % "logback-classic" % "1.0.7"
> > [etc, you get the drift]
> >
> > Obviously if one's build is solving differential equations to figure out
> > the versions this is going to be a tall order; however in almost every case
> > they are hardcoded string literals in build.sbt or project/*.scala in which
> > case it's more of a short order.
> >
> >
>
> --
> You received this message because you are subscribed to the Google Groups "simple-build-tool" group.
> To view this discussion on the web visit https://groups.google.com/d/msg/simple-build-tool/-/POsKgM5isBsJ.
> To post to this group, send email to simple-b...@googlegroups.com.
> To unsubscribe from this group, send email to simple-build-t...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/simple-build-tool?hl=en.
>

Roman Timushev

unread,
Oct 9, 2012, 2:30:27 PM10/9/12
to simple-b...@googlegroups.com
An interesting idea, probably this is the safest way to auto-increment dependency versions. However, in my opinion the plugin will be more useful with standard settings, even if updates are not so reliable.

Doug Tangren

unread,
Oct 9, 2012, 2:42:31 PM10/9/12
to simple-b...@googlegroups.com
Nice use of semverfi Roman. Awesome. User count + 1!

To view this discussion on the web visit https://groups.google.com/d/msg/simple-build-tool/-/ke8Bqg1nKEgJ.

Roman Timushev

unread,
Oct 9, 2012, 3:20:12 PM10/9/12
to simple-b...@googlegroups.com
Thank you for semverfi, Doug, it made plugin implementation much easier :)
Not all artifacts follow semver conventions though, I will have to implement some workarounds for them.

nafg

unread,
Oct 11, 2012, 11:47:10 PM10/11/12
to simple-b...@googlegroups.com
Why not prompt one by one? While you're at it, maybe display all the versions they can choose from, between the current and the latest?

Found newer versions for x.y:z, enter k to keep or select a version [2.3]: k / 2.1 / 2.2 / 2.3? 
Reply all
Reply to author
Forward
0 new messages