diff --git a/.gitignore b/.gitignore index 66ddf1f..73fccc8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .idea/ +.bsp/ *.iml project/project project/target diff --git a/build.sbt b/build.sbt index 2654dfb..b62be5e 100644 --- a/build.sbt +++ b/build.sbt @@ -77,7 +77,7 @@ lazy val metasJS = metas.js.settings(name := "metas") val buildMacrosSettings = globalSettings ++ Seq( libraryDependencies += "org.scala-lang" % "scala-reflect" % scalaVersion.value, resolvers += Resolver.sonatypeRepo("releases"), - addCompilerPlugin("org.scalamacros" % "paradise" % "2.1.0" cross CrossVersion.full) + addCompilerPlugin("org.scalamacros" % "paradise" % "2.1.1" cross CrossVersion.full) ) val macroSettings = buildMacrosSettings ++ publishSettings @@ -97,9 +97,9 @@ lazy val hamsters = CrossPlugin.autoImport.crossProject(JSPlatform, JVMPlatform) .dependsOn(metas) .dependsOn(macros) .settings(libraryDependencies ++= Seq( - "org.scalatest" %%% "scalatest" % "3.1.0" % "test", + "org.scalatest" %%% "scalatest" % "3.2.2" % "test", "org.scalamock" %%% "scalamock-scalatest-support" % "3.6.0" % "test", - "org.scalacheck" %%% "scalacheck" % "1.14.1" % "test" + "org.scalacheck" %%% "scalacheck" % "1.15.1" % "test" )) .settings(hamstersSettings) diff --git a/metas/shared/src/main/scala/io/github/hamsters/CartesianMacro.scala b/metas/shared/src/main/scala/io/github/hamsters/CartesianMacro.scala index e54c57f..ddbe980 100644 --- a/metas/shared/src/main/scala/io/github/hamsters/CartesianMacro.scala +++ b/metas/shared/src/main/scala/io/github/hamsters/CartesianMacro.scala @@ -6,7 +6,8 @@ import scala.meta._ class CartesianMacro extends StaticAnnotation { - inline def apply(defn: Any): Any = meta { + @inline + def apply(defn: Any): Any = { val MAX_ARITY = 23 diff --git a/metas/shared/src/main/scala/io/github/hamsters/GenLens.scala b/metas/shared/src/main/scala/io/github/hamsters/GenLens.scala index 9941070..bd6ba6f 100644 --- a/metas/shared/src/main/scala/io/github/hamsters/GenLens.scala +++ b/metas/shared/src/main/scala/io/github/hamsters/GenLens.scala @@ -5,7 +5,8 @@ import scala.collection.immutable.Seq import scala.meta._ class GenLens extends StaticAnnotation { - inline def apply(defn: Any): Any = meta { + @inline + def apply(defn: Any): Any = { defn match { case q"""case class $tName(..$params)""" => { diff --git a/metas/shared/src/main/scala/io/github/hamsters/HListMacro.scala b/metas/shared/src/main/scala/io/github/hamsters/HListMacro.scala index ece01b4..0935b6b 100644 --- a/metas/shared/src/main/scala/io/github/hamsters/HListMacro.scala +++ b/metas/shared/src/main/scala/io/github/hamsters/HListMacro.scala @@ -5,7 +5,8 @@ import scala.meta._ class HListMacro extends scala.annotation.StaticAnnotation { - inline def apply(defn: Any): Any = meta { + @inline + def apply(defn: Any): Any = { defn match { case q"..$mods class $tName(..$params)" => diff --git a/metas/shared/src/main/scala/io/github/hamsters/ShowMacro.scala b/metas/shared/src/main/scala/io/github/hamsters/ShowMacro.scala index b97d69d..9d23e1a 100644 --- a/metas/shared/src/main/scala/io/github/hamsters/ShowMacro.scala +++ b/metas/shared/src/main/scala/io/github/hamsters/ShowMacro.scala @@ -5,7 +5,8 @@ import scala.meta._ class ShowMacro extends scala.annotation.StaticAnnotation { - inline def apply(defn: Any): Any = meta { + @inline + def apply(defn: Any): Any = { defn match { // TODO handle object with existing companion // case Seq(cls @ Defn.Class(_, name, _, ctor, template), companion: Defn.Object)=> q"""""" diff --git a/metas/shared/src/main/scala/io/github/hamsters/UnionMacro.scala b/metas/shared/src/main/scala/io/github/hamsters/UnionMacro.scala index acc49c6..1d83540 100644 --- a/metas/shared/src/main/scala/io/github/hamsters/UnionMacro.scala +++ b/metas/shared/src/main/scala/io/github/hamsters/UnionMacro.scala @@ -6,7 +6,8 @@ import scala.meta.{Term, _} class UnionMacro extends scala.annotation.StaticAnnotation { - inline def apply(defn: Any): Any = meta { + @inline + def apply(defn: Any): Any = { def argByXY(idx: Int, i: Int): Term = if (idx == i) q"""Some(t)""" diff --git a/metas/shared/src/main/scala/io/github/hamsters/ValidationMacro.scala b/metas/shared/src/main/scala/io/github/hamsters/ValidationMacro.scala index ddf38af..1a03643 100644 --- a/metas/shared/src/main/scala/io/github/hamsters/ValidationMacro.scala +++ b/metas/shared/src/main/scala/io/github/hamsters/ValidationMacro.scala @@ -5,7 +5,8 @@ import scala.meta._ class ValidationMacro extends scala.annotation.StaticAnnotation { - inline def apply(defn: Any): Any = meta { + @inline + def apply(defn: Any): Any = { val arityRange = Range(1, 23) diff --git a/project/build.properties b/project/build.properties index 1fc4b80..c06db1b 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=1.2.8 \ No newline at end of file +sbt.version=1.4.5 diff --git a/project/plugins.sbt b/project/plugins.sbt index 0cbe09a..200907d 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,5 +1,5 @@ addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.32") addSbtPlugin("org.portable-scala" % "sbt-crossproject" % "0.6.1") addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "0.6.1") -addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.8.1") -addSbtPlugin("com.jsuereth" % "sbt-pgp" % "2.0.0") \ No newline at end of file +addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.9.5") +addSbtPlugin("com.jsuereth" % "sbt-pgp" % "2.0.1") \ No newline at end of file diff --git a/scripts/try-hamsters.sh b/scripts/try-hamsters.sh index a92925d..33e50b6 100755 --- a/scripts/try-hamsters.sh +++ b/scripts/try-hamsters.sh @@ -3,7 +3,7 @@ COURSIER_URL=https://git.io/vgvpD test -e ~/.coursier/coursier || \ (mkdir -p ~/.coursier && curl -L -s --output ~/.coursier/coursier $COURSIER_URL && chmod +x ~/.coursier/coursier) ~/.coursier/coursier launch -q -P \ - com.lihaoyi:ammonite_2.12.3:1.0.1 \ + com.lihaoyi:ammonite_2.12.8:2.3.8 \ io.github.scala-hamsters:hamsters_2.12:3.0.0 \ -- --predef-code 'import io.github.hamsters._; import HList._;