Please review: Allow cross-building of plugins

57 views
Skip to first unread message

Johannes Rudolph

unread,
Feb 22, 2012, 7:15:45 AM2/22/12
to simple-b...@googlegroups.com
I've created a plugin which allows cross-building of sbt plugins (I've got a strong feeling of some recursive irony here) [1]. You specify the sbt version to build against with "sbtVersion in sbtPlugin" and then go on as usual. This of course works only for plugins which are basically compatible with the corr. sbt version.

I think it is highly necessary to decouple the plugin sbt version from the plugin _build_ sbt version so that you can easily release versions of your sbt plugin without having to move the complete plugin _build_ to an older version. Part of this may or may not become less necessary when we have binary compatible versions but we are not there yet. Even then it would be nice if we could build 0.12 plugins with a 0.11 plugin build so that you are not completely dependent on all the plugins you use in the plugin build itself to upgrade to 0.12.

Basically, the idea is to introduce a "sbtVersion in sbtPlugin" setting which specifies which sbt version you want to build against. I've done the change against sbt 0.11.2 itself here [2] and then extracted the same changes into a plugin.

What do you think?

Johannes

[1] https://github.com/jrudolph/sbt-cross-building

Jason Zaugg

unread,
Feb 22, 2012, 9:52:25 AM2/22/12
to simple-b...@googlegroups.com
Handy!

How does it interact with the scripted SBT test plugin?

-jason

Johannes Rudolph

unread,
Feb 22, 2012, 10:12:02 AM2/22/12
to simple-b...@googlegroups.com
On Wed, Feb 22, 2012 at 3:52 PM, Jason Zaugg <jza...@gmail.com> wrote:
> How does it interact with the scripted SBT test plugin?

Honestly, I have no clue. Despite producing sbt plugins now in a
seemingly weekly fashion I never bothered with "real" testing. I heard
the rumor about scripted tests but never got behind their obscurity.
Is this a real plugin? Where can I find it?

Johannes

>
> -jason
>
> --
> 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/-/UUAmQRWMyh8J.
>
> 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.

--
Johannes

-----------------------------------------------
Johannes Rudolph
http://virtual-void.net

Johannes Rudolph

unread,
Feb 22, 2012, 10:16:20 AM2/22/12
to simple-b...@googlegroups.com
On Wed, Feb 22, 2012 at 4:12 PM, Johannes Rudolph
<johannes...@googlemail.com> wrote:
> On Wed, Feb 22, 2012 at 3:52 PM, Jason Zaugg <jza...@gmail.com> wrote:
>> How does it interact with the scripted SBT test plugin?
>
> I heard
> the rumor about scripted tests but never got behind their obscurity.
> Is this a real plugin? Where can I find it?

Ha, found it, had just to look into my sbt sources. Having no
experience with it what are the possible expected interactions /
issues?

Jason Zaugg

unread,
Feb 22, 2012, 10:23:00 AM2/22/12
to simple-b...@googlegroups.com
On Wednesday, February 22, 2012 4:12:02 PM UTC+1, Johannes Rudolph wrote:
On Wed, Feb 22, 2012 at 3:52 PM, Jason Zaugg <jza...@gmail.com> wrote:
> How does it interact with the scripted SBT test plugin?

Honestly, I have no clue. Despite producing sbt plugins now in a
seemingly weekly fashion I never bothered with "real" testing. I heard
the rumor about scripted tests but never got behind their obscurity.
Is this a real plugin? Where can I find it?

It's pretty straight forward to use. Take a look at xsbt-web-plugin from a real-world example.

Plugin dependency: 


Test case:


-jason

Johannes Rudolph

unread,
Feb 22, 2012, 10:48:14 AM2/22/12
to simple-b...@googlegroups.com
Thanks Jason.

It seems the scripted plugin didn't work before 0.11.2 at all [1]. And
even I fix the bug in the 0.11.1 package it doesn't work correctly
because it doesn't correctly start the correct version of sbt. It just
uses the same launcher the main build was started with and doesn't
supply the correct version of sbt to use (if you use the 0.11.2
launcher and provide a build.properties to use sbt 0.11.1 for
example).

So one would have to fix that first.

Johannes

[1] https://github.com/harrah/xsbt/pull/256

> --
> 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/-/cTKAzHAaEvwJ.

Mark Harrah

unread,
Feb 22, 2012, 6:56:10 PM2/22/12
to simple-b...@googlegroups.com
On Wed, 22 Feb 2012 16:48:14 +0100
Johannes Rudolph <johannes...@googlemail.com> wrote:

> Thanks Jason.
>
> It seems the scripted plugin didn't work before 0.11.2 at all [1]. And
> even I fix the bug in the 0.11.1 package it doesn't work correctly
> because it doesn't correctly start the correct version of sbt. It just
> uses the same launcher the main build was started with and doesn't
> supply the correct version of sbt to use (if you use the 0.11.2
> launcher and provide a build.properties to use sbt 0.11.1 for
> example).

That should be possible at least in theory. The problem is not using the same launcher, but that build.properties is ignored. It is probably best not to work with a build.properties, but to pass the version directly to the launcher.

-Mark

Johannes Rudolph

unread,
May 8, 2012, 8:11:13 AM5/8/12
to simple-b...@googlegroups.com
I published version 0.5.1 of the cross-building plugin for all 0.11.x sbt versions. It now supports cross-building for sbt 0.11.3 as well. With the sbt-cross-building plugin you don't have to update your plugin *build* to another sbt version just to build against a new sbt version. This, of course, works only if you plugin *code* is actually compatible with the sbt versions you are building against.

Johannes
Reply all
Reply to author
Forward
0 new messages