Skip to content

Commit

Permalink
Update build for 2.13.0 final
Browse files Browse the repository at this point in the history
  - Work around unavailability of macro-compat for 2.13.
  - Use openjdk8 in Travis CI since oraclejdk8 is no longer available by
    default
  • Loading branch information
liff committed Jun 13, 2019
1 parent bac90e6 commit 4635893
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ scala:
- 2.10.7
- 2.11.12
- 2.12.8
- 2.13.0-RC2
- 2.13.0

jdk:
- oraclejdk8
- openjdk8

branches:
only:
Expand Down
18 changes: 15 additions & 3 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ lazy val catsTests = crossProject(JSPlatform, JVMPlatform).in(file("cats-tests")
if (scalaVersion.value.startsWith("2.10."))
"org.typelevel" %%% "cats-core" % "1.2.0"
else
"org.typelevel" %%% "cats-core" % "2.0.0-M2"
"org.typelevel" %%% "cats-core" % "2.0.0-M4"
}
)

Expand Down Expand Up @@ -100,6 +100,7 @@ lazy val defaultSettings = Seq(
"-Ymacro-annotations"
)
}.toList.flatten,
macrocompatDependency,
defaultLibraryDependencies,
libraryDependencies ++= {
CrossVersion.partialVersion(scalaVersion.value) match {
Expand Down Expand Up @@ -136,12 +137,23 @@ lazy val defaultScalacOptions = scalacOptions ++= Seq(
Seq("-Xlint:-unused,_")
})

// Only include for 2.10; see https://github.com/milessabin/macro-compat/pull/85 for discussion
lazy val macrocompatDependency = libraryDependencies ++= {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, v)) if v < 11 =>
Seq(
"org.typelevel" %% "macro-compat" % "1.1.1"
)
case _ =>
Nil
}
}

lazy val defaultLibraryDependencies = libraryDependencies ++= Seq(
"org.typelevel" %% "macro-compat" % "1.1.1",
scalaOrganization.value % "scala-reflect" % scalaVersion.value % Provided,
scalaOrganization.value % "scala-compiler" % scalaVersion.value % Provided,
"org.scalacheck" %%% "scalacheck" % "1.14.0" % Test,
"org.scalatest" %%% "scalatest" % "3.0.8-RC4" % Test
"org.scalatest" %%% "scalatest" % "3.0.8" % Test
)

def scalaPartV = Def.setting(CrossVersion.partialVersion(scalaVersion.value))
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package io.estatico.newtype

package object macros extends ScalaVersionSpecifics

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package io.estatico.newtype.macros

trait ScalaVersionSpecifics
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package io.estatico.newtype.macros

trait ScalaVersionSpecifics {
object macrocompat {
class bundle extends annotation.Annotation
}
}

0 comments on commit 4635893

Please sign in to comment.