From 694dc38fd94436a3fe82fb8221dff2e90246b735 Mon Sep 17 00:00:00 2001 From: Kai Date: Sat, 3 Oct 2020 16:07:41 +0100 Subject: [PATCH 1/3] add doctest plugin --- project/Deps.sc | 2 ++ project/plugins.sbt | 2 ++ project/project/PluginVersions.scala | 1 + 3 files changed, 5 insertions(+) diff --git a/project/Deps.sc b/project/Deps.sc index a113dd226d..4f46f374bb 100644 --- a/project/Deps.sc +++ b/project/Deps.sc @@ -36,6 +36,7 @@ object Izumi { object PV { val sbt_mdoc = Version.VExpr("PV.sbt_mdoc") + val sbt_doctest = Version.VExpr("PV.sbt_doctest") val sbt_paradox_material_theme = Version.VExpr("PV.sbt_paradox_material_theme") val sbt_ghpages = Version.VExpr("PV.sbt_ghpages") val sbt_site = Version.VExpr("PV.sbt_site") @@ -705,6 +706,7 @@ object Izumi { SbtPlugin("com.typesafe.sbt", "sbt-ghpages", PV.sbt_ghpages), SbtPlugin("io.github.jonas", "sbt-paradox-material-theme", PV.sbt_paradox_material_theme), SbtPlugin("org.scalameta", "sbt-mdoc", PV.sbt_mdoc), + SbtPlugin("com.github.tkawachi", "sbt-doctest", PV.sbt_doctest), ), ) } diff --git a/project/plugins.sbt b/project/plugins.sbt index 7f99bd98c7..ac91f7b205 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -19,3 +19,5 @@ addSbtPlugin("io.github.jonas" % "sbt-paradox-material-theme" % PV.sbt_paradox_m addSbtPlugin("org.scalameta" % "sbt-mdoc" % PV.sbt_mdoc) +addSbtPlugin("com.github.tkawachi" % "sbt-doctest" % PV.sbt_doctest) + diff --git a/project/project/PluginVersions.scala b/project/project/PluginVersions.scala index cbcc2f3c3d..c6f0065b23 100644 --- a/project/project/PluginVersions.scala +++ b/project/project/PluginVersions.scala @@ -1,5 +1,6 @@ object PV { val sbt_mdoc = "2.2.9" + val sbt_doctest = "0.9.7" val sbt_paradox_material_theme = "0.6.0" val sbt_ghpages = "0.6.3" val sbt_site = "1.3.3" From 0b5a30023bc4dbd5ef8a4ca76d353955d662d70e Mon Sep 17 00:00:00 2001 From: Kai Date: Sat, 3 Oct 2020 18:31:17 +0100 Subject: [PATCH 2/3] wrap functoidMacro block in text to avoid error --- .../izumi/distage/model/reflection/macros/FunctoidMacro.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/distage/distage-core-api/src/main/scala/izumi/distage/model/reflection/macros/FunctoidMacro.scala b/distage/distage-core-api/src/main/scala/izumi/distage/model/reflection/macros/FunctoidMacro.scala index 3819d2d656..433b8b3499 100644 --- a/distage/distage-core-api/src/main/scala/izumi/distage/model/reflection/macros/FunctoidMacro.scala +++ b/distage/distage-core-api/src/main/scala/izumi/distage/model/reflection/macros/FunctoidMacro.scala @@ -14,9 +14,9 @@ import scala.reflect.macros.blackbox /** * To see macro debug output during compilation, set `-Dizumi.debug.macro.distage.functoid=true` java property! * - * {{{ + * {{{""" * sbt -Dizumi.debug.macro.distage.functoid=true compile - * }}} + * """}}} * * @see [[izumi.distage.constructors.DebugProperties]] */ From 5cae759dfe46f01af23a590981251d10a46eb3ae Mon Sep 17 00:00:00 2001 From: Kai Date: Sat, 3 Oct 2020 18:33:52 +0100 Subject: [PATCH 3/3] Set up doctext codeblocksMode=true, testFramework=scalatest --- build.sbt | 4 +++- project/Deps.sc | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index 9dd800232a..20c63bb84a 100644 --- a/build.sbt +++ b/build.sbt @@ -3065,7 +3065,9 @@ lazy val `izumi` = (project in file(".")) scmInfo in ThisBuild := Some(ScmInfo(url("https://github.com/7mind/izumi"), "scm:git:https://github.com/7mind/izumi.git")), scalacOptions in ThisBuild ++= Seq( s"-Xmacro-settings:scalatest-version=${V.scalatest}" - ) + ), + doctestOnlyCodeBlocksMode in ThisBuild := true, + doctestTestFramework in ThisBuild := DoctestTestFramework.ScalaTest ) .disablePlugins(AssemblyPlugin) .aggregate( diff --git a/project/Deps.sc b/project/Deps.sc index 4f46f374bb..1eefd55081 100644 --- a/project/Deps.sc +++ b/project/Deps.sc @@ -232,6 +232,8 @@ object Izumi { "scalacOptions" in SettingScope.Build ++= Seq( """s"-Xmacro-settings:scalatest-version=${V.scalatest}"""".raw ), + "doctestOnlyCodeBlocksMode" in SettingScope.Build := true, + "doctestTestFramework" in SettingScope.Build := """DoctestTestFramework.ScalaTest""".raw, ) final val sharedSettings = Defaults.SbtMetaOptions ++ Seq(