JitPack just added support for multiple Scala versions. This quick how-to describes the changes I made to one of my little projects to make everything work.
If you want to release for multiple Scala versions, you need to test it. Therefore, you need to add the versions you want to test against in project/Build.scala, adding:
...
crossScalaVersions := Seq("2.10.6", "2.11.7"),
...
to your Build object. When this is done,
sbt "+ test"
will build and test against both 2.10 and 2.11. So far so good for local development.
== Travis changes
You also want to double check (and you will forget the "+ test" invocation before pushing to Github) in Travis that both versions work. Your .travis.yml should look like:
language: scala
scala:
- 2.10.6
- 2.11.7
and Travis will do its magic.
When Travis is green and you want to release, just do a github release with a regular version number (so no more adding "_2.10" or something like that). Your users can use the regular way of referencing sbt-built dependencies:
...
"com.github.cdegroot" %% "hardcoded" % "1.1.1",
...
and JitPack will automagically provide them with a version-specific artifact.
Nice!