Skip to content

Commit

Permalink
replace sbt-travis with in house code since it no longer parse our tr…
Browse files Browse the repository at this point in the history
…avis file using a different scala setting (#2771)
  • Loading branch information
kailuowang authored Apr 3, 2019
1 parent 276a948 commit abb97eb
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
24 changes: 23 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import java.time.LocalDateTime

import microsites._
import ReleaseTransformations._
import sbt.io.Using

import scala.xml.transform.{RewriteRule, RuleTransformer}
import sbtcrossproject.CrossProject
import sbtcrossproject.CrossPlugin.autoImport.{crossProject, CrossType}
Expand All @@ -18,7 +22,24 @@ lazy val scoverageSettings = Seq(

organization in ThisBuild := "org.typelevel"

val isTravisBuild = settingKey[Boolean]("Flag indicating whether the current build is running under Travis")
val crossScalaVersionsFromTravis = settingKey[Seq[String]]("Scala versions set in .travis.yml as scala_version_XXX")
isTravisBuild in Global := sys.env.get("TRAVIS").isDefined

crossScalaVersionsFromTravis in Global := {
val manifest = (baseDirectory in ThisBuild).value / ".travis.yml"
import collection.JavaConverters._
Using.fileInputStream(manifest) { fis =>
List(new org.yaml.snakeyaml.Yaml().load(fis))
.collect { case map: java.util.Map[_, _] => map.asScala.toList }
.flatMap(_.collect {
case (k: String, v: String) if k.contains("scala_version_") => v
})
}
}

lazy val commonSettings = Seq(
crossScalaVersions := (crossScalaVersionsFromTravis in Global).value,
scalacOptions ++= commonScalacOptions(scalaVersion.value),
Compile / unmanagedSourceDirectories ++= {
val bd = baseDirectory.value
Expand Down Expand Up @@ -610,6 +631,7 @@ lazy val binCompatTest = project
.disablePlugins(CoursierPlugin)
.settings(noPublishSettings)
.settings(
crossScalaVersions := (crossScalaVersionsFromTravis in Global).value,
addCompilerPlugin("org.spire-math" %% "kind-projector" % "0.9.9"),
libraryDependencies ++= List(
{
Expand Down Expand Up @@ -743,7 +765,7 @@ addCommandAlias("validateKernelJS", "kernelLawsJS/test")
addCommandAlias("validateFreeJS", "freeJS/test") //separated due to memory constraint on travis
addCommandAlias("validate", ";clean;validateJS;validateKernelJS;validateFreeJS;validateJVM")

addCommandAlias("prePR", ";fmt;++2.11.12;validateBC")
addCommandAlias("prePR", ";fmt;++2.11.12 mimaReportBinaryIssues")

////////////////////////////////////////////////////////////////////////////////////////////////////
// Base Build Settings - Should not need to edit below this line.
Expand Down
1 change: 1 addition & 0 deletions project/build.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
libraryDependencies += "org.yaml" % "snakeyaml" % "1.24"
1 change: 0 additions & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ addSbtPlugin("com.typesafe.sbt" % "sbt-git" % "1.0.0")
addSbtPlugin("com.github.tkawachi" % "sbt-doctest" % "0.8.0")
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "2.0")
addSbtPlugin("com.47deg" % "sbt-microsites" % "0.7.20")
addSbtPlugin("com.dwijnand" % "sbt-travisci" % "1.2.0")
addSbtPlugin("org.lyranthe.sbt" % "partial-unification" % "1.1.2")
addSbtPlugin("org.tpolecat" % "tut-plugin" % "0.6.10")
addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "0.6.0")
Expand Down

0 comments on commit abb97eb

Please sign in to comment.