Skip to content

Commit

Permalink
Merge pull request #24 from dwijnand/sbt1
Browse files Browse the repository at this point in the history
Cross-build to sbt 1
  • Loading branch information
dwijnand authored Aug 2, 2017
2 parents effcbee + d7ce57b commit ef34cd8
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 10 deletions.
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
language: scala
jdk: oraclejdk8
scala: 2.10.6
script: project/travis.sh

# Build only master and version tags - http://stackoverflow.com/a/31882307/463761
Expand All @@ -13,6 +12,9 @@ env:
global:
- COURSIER_PROGRESS=0
- secure: cYOvryJrFOuYazRt6YQFIIQW0bPpKAK7IYGZeLQ7PDq0nm4RrjfivXebdGSthS9vJpmpIIEQYKD5uQlWokTnFeq2nzW4+5+2d0cQh6qbw8RfhZNFjB+p1e8oOg6xwPUoFoaGat/SrtGjE2CL3ySfVN4A8LamS/voSA8BFAGE+zMC1oJtSBfPRK5Ubfn+2SvyXdYdggPRqvceSotHnhf5X/NHtynxwrJBnZm58/KBqzFTIQ+nJLmfKAx/zc6Cdv260VVtLW1JIyig3zJ1gWoXi4oAfRxm/pzt3LG5gPjSrH0bTzF+bI9z5w/UbDrY+JIc/5JjysW9MM23hl+7qXmwDemQBKeVhAbNrmlphB8mz6goWpzrVjvhaKwUIrrz58GDsZRvYWgK/2hLeAo5yxFvtBI2vT9I7oYM99T2lhuNoc9Wd76oKPV3l9t0foeuwpfPbUm7u4y+6O+dKEk++rMZ55hpcEqaCIP9VCWY6d61dQzbSJVTGN3vcQeeLcK36RnhJuf4Hn8jUg2UuqjBtg01/DZAIvaKcI+8VIzx+/y8L/0Y1ZPzQoZ2WvGaOEHrSowMyg643pSR7sW0wDUDsjJgkOHfbBxjLMgM0XRX90R2e7lIbfqUiMH4Z6bTnQ7zYaYXHx9CUohSAOqfGSLtkQpKYJKiXVs6UylTUg6x2d0ptgA=
matrix:
- TRAVIS_SBT_VERSION=0.13.x
- TRAVIS_SBT_VERSION=1.0.0-M5

cache:
directories:
Expand Down
11 changes: 9 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,15 @@ organization := "com.dwijnand"
homepage := scmInfo.value map (_.browseUrl)
scmInfo := Some(ScmInfo(url("https://github.com/dwijnand/sbt-project-graph"), "scm:git:git@github.com:dwijnand/sbt-project-graph.git"))

sbtPlugin := true
scalaVersion := "2.10.6"
sbtPlugin := true
sbtVersion in Global := "0.13.16" // must be Global, otherwise ^^ won't change anything
crossSbtVersions := List("0.13.16", "1.0.0-RC3")

scalaVersion := (CrossVersion partialVersion (sbtVersion in pluginCrossBuild).value match {
case Some((0, 13)) => "2.10.6"
case Some((1, _)) => "2.12.3"
case _ => sys error s"Unhandled sbt version ${(sbtVersion in pluginCrossBuild).value}"
})

maxErrors := 15
triggeredMessage := Watched.clearWhenTriggered
Expand Down
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=0.13.13
sbt.version=0.13.16
10 changes: 5 additions & 5 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
addSbtPlugin("com.dwijnand" % "sbt-dynver" % "1.1.1")
addSbtPlugin("io.get-coursier" % "sbt-coursier" % "1.0.0-M14")
libraryDependencies += "org.scala-sbt" % "scripted-plugin" % sbtVersion.value
addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "0.1.11")
addSbtPlugin("me.lessis" % "bintray-sbt" % "0.3.0")
addSbtPlugin("com.dwijnand" % "sbt-dynver" % "2.0.0")
addSbtPlugin("io.get-coursier" % "sbt-coursier" % "1.0.0-RC8")
libraryDependencies += "org.scala-sbt" % "scripted-plugin" % sbtVersion.value
addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "0.1.17")
addSbtPlugin("org.foundweekends" % "sbt-bintray" % "0.5.1")
8 changes: 7 additions & 1 deletion project/travis.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
#!/usr/bin/env bash

if [[ "$TRAVIS_SBT_VERSION" == "0.13.x" ]]; then
SWITCH_SBT_VERSION=""
else
SWITCH_SBT_VERSION="^^$TRAVIS_SBT_VERSION"
fi

[[ "$TRAVIS_PULL_REQUEST" == "false"
&& "$TRAVIS_BRANCH" == "master"
&& "$TRAVIS_SECURE_ENV_VARS" == "true"
Expand All @@ -24,4 +30,4 @@ else
PUBLISH=publishLocal
fi

sbt ++$TRAVIS_SCALA_VERSION verify "$PUBLISH"
sbt "$SWITCH_SBT_VERSION" verify "$PUBLISH"
6 changes: 6 additions & 0 deletions src/main/scala-sbt-0.13/compat.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package sbt

package object internal {
type BuildStructure = sbt.BuildStructure
type LoadedBuildUnit = sbt.LoadedBuildUnit
}
1 change: 1 addition & 0 deletions src/main/scala/sbtprojectgraph/SbtProjectGraphPlugin.scala
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package sbtprojectgraph

import sbt._, Keys._
import sbt.internal.{ BuildStructure, LoadedBuildUnit } // sbt/sbt#3296

object SbtProjectGraphPlugin extends AutoPlugin {
override def trigger = allRequirements
Expand Down

0 comments on commit ef34cd8

Please sign in to comment.