harrah/xsbt — pull request #600 by eed3si9n (2012-11-18 12:21:09+00:00)
Title: use CrossVersion.full for unstable Scala by default

This is partially roll back of harrah/xsbt@13e62fd6452974a77eb9b9ac9a60a613316b1d14: Use binary version for cross-version even for snapshots and milestones.

### sbt 0.12.1 behavior

```
> ++ 2.10.0-RC2
Setting version to 2.10.0-RC2
[info] Set current project to helloworld (in build file:/Users/foo/bar/)
> cross-version
[info] Binary
```

The cross version is `Binary` by default. This publishes the application with `_2.10` suffix.

### what this changes

```
> ++ 2.10.0-RC2
Setting version to 2.10.0-RC2
[info] Set current project to default-c60480 (in build file:/Users/foo/bar/)
> cross-version
[info] Full
```

The cross version is `Full` when built against non-final Scala versions.

### historical notes

As noted above the originating commit for this behavior is harrah/xsbt@13e62fd6452974a77eb9b9ac9a60a613316b1d14 Use binary version for cross-version even for snapshots and milestones, and it is behaving as designed. The commit message reads:

> Rely instead on users not publishing the same stable version against both stable Scala or sbt releases and snapshots/milestones.

The change was applied both to the binary versions of sbt and Scala, and was first introduced in sbt [0.12.0-RC1](https://groups.google.com/d/topic/simple-build-tool/eAGOACDH59E/discussion), which allowed sbt 0.12 plugins to be published ahead of sbt 0.12.0 release.

Unlike sbt that's been keeping the compatibility, however, there's no such guarantee for Scala milestones and RCs. Here are related thread on ML:

- [Scala version suffix in published artifact names](https://groups.google.com/forum/#!topic/simple-build-tool/miiQwiuxuIY/discussion)
- [the price of the wrong defaults](https://groups.google.com/d/topic/simple-build-tool/d_Kd6H_QMmM/discussion)

In the former thread it was suggested:

> I would use a snapshot, a version bump, or append the full version.

There are pressures on library authors to cross publish against 2.10.0 RCs driven by user demands and curiosity for new features added in 2.10, and most authors I think are opting for full version instead of snapshot or version bump. See [community projects published for RC2](https://groups.google.com/forum/#!topic/scala-language/rbUwCwFEiIE/discussion).

This is a matter of setting `crossVersion`, so each project can work around this by knowing about this issue and writing logic around `scalaVersion`. For example the following would replicate the sbt 0.12.0 beta behavior, which I assume many are using:

```scala
crossVersion <<= scalaVersion { sv => if (sv contains "-") CrossVersion.full else CrossVersion.binary }
```

### opinion

Since not every sbt user is an sbt geek, the default behavior should be safer.