Since a while ago, the fine folks at Travis CI offer OS X builds.
Those machines also have Java installed, but just one version (1.7.0_45 at time of writing).
The usual jdk_switcher mechanism is unavailable.
Futhermore, Scala is not available.
Luckily, it is possible to define a cross-platform (Linux and OS X) build within these constraints.
- Include @paulp's
sbtlauncher into the root of your repository. You can obtain a copy here. Alternatively, you can add aninstallstep to your.travis.ymlwhich fetches it before the build. (See the instructions in theREADMEofsbt-extras.) - Set the
languageentry in your.travis.ymltojava. - Remove the
jdkand thescalaentries. - Instead, add a new top-level entry
envwhich contains an itemSCALA_VERSION=2.11.7for each Scala version you want to test on. - Add a new top-level entry
oswith the single itemosx. It is important that it only containsosxand notlinux. - Add a new top-level entry
matrixwith sub-entryinclude. See the example file in this Gist for an idea what it should look like.
For details on what exactly is available on the OS X boxes, see the official documentation.