sbt-unique-version

123 views
Skip to first unread message

eugene yokota

unread,
Jun 2, 2012, 4:29:53 AM6/2/12
to simple-b...@googlegroups.com
Hi guys,

I wrote an experimental plugin to emulate unique snapshots.

Using this, ppl can publish snapshots on Ivy repos without having the deletion rights.
One of the drawbacks is that the end user can only specify "latest.integration" as opposed to the multiple tracks that x.x.x-SNAPSHOT style version gives.

-eugene

Mark Harrah

unread,
Jun 2, 2012, 7:37:37 PM6/2/12
to simple-b...@googlegroups.com
Hey Eugene,
Ivy has a syntax for matching sub revisions [prefix]+, such as 1.1.+" for 1.1.0, 1.1.20, ... Have you tried x.x.x-+ ?

I don't know the performance impact of dynamic revisions, but I think they will be slower than static revisions as well as slower than -SNAPSHOTs because they don't have an associated metadata.xml file.

-Mark

> -eugene
>

eugene yokota

unread,
Jun 2, 2012, 7:46:40 PM6/2/12
to simple-b...@googlegroups.com
On Sat, Jun 2, 2012 at 7:37 PM, Mark Harrah <dmha...@gmail.com> wrote:
> Ivy has a syntax for matching sub revisions [prefix]+, such as 1.1.+" for 1.1.0, 1.1.20, ...  Have you tried x.x.x-+ ?

Nice catch! This worked like a charm.

addSbtPlugin("com.eed3si9n" % "sbt-unique-version" % "0.1.0-+")

grabbed

[info] downloading
http://scalasbt.artifactoryonline.com/scalasbt/sbt-plugin-snapshots/com.eed3si9n/sbt-unique-version/scala_2.9.1/sbt_0.11.3/0.1.0-20120602-073010/jars/sbt-unique-version.jar
...
[info] [SUCCESSFUL ]
com.eed3si9n#sbt-unique-version;0.1.0-20120602-073010!sbt-unique-version.jar
(300ms)

-eugene

Mark Harrah

unread,
Jun 2, 2012, 7:56:39 PM6/2/12
to simple-b...@googlegroups.com
Ah, good. Did it take noticeably longer than a static revision?

Also, you'll need to explicitly request updating to a more recent version. In sbt 0.12, calling 'update' explicitly will do that. For plugins:

reload plugins
update
reload return

If done often, it should probably be given an alias:

alias update-plugins=;reload plugins;update;reload return

and perhaps that can be included as standard in 0.12.1.

-Mark

> -eugene
>

eugene yokota

unread,
Jun 2, 2012, 8:05:39 PM6/2/12
to simple-b...@googlegroups.com
On Sat, Jun 2, 2012 at 7:56 PM, Mark Harrah <dmha...@gmail.com> wrote:
> Ah, good.  Did it take noticeably longer than a static revision?

I didn't observe any difference.

> Also, you'll need to explicitly request updating to a more recent version.  In sbt 0.12, calling 'update' explicitly will do that.  For plugins:
>
>  reload plugins
>  update
>  reload return

I am guessing this is because project builds are cached.
Adding global plugins also requires explicit update in my experience
(https://github.com/harrah/xsbt/issues/272).

-eugene

dave

unread,
Jun 5, 2012, 6:47:31 PM6/5/12
to simple-b...@googlegroups.com
How well does this play with repository features that automagically get rid of old snapshots?

dave

eugene yokota

unread,
Jun 5, 2012, 6:53:51 PM6/5/12
to simple-b...@googlegroups.com
Not sure but I'm hoping it would fare well since the 0.1.0- prefix is kept.

-eugene
Reply all
Reply to author
Forward
0 new messages