Permalink
Browse files

Fixes for microsite after circe-optics move

  • Loading branch information...
travisbrown committed Oct 10, 2018
1 parent e733288 commit 7765cc4b18d9939696981f5e2f055d58487a9dbd
Showing with 24 additions and 13 deletions.
  1. +9 −0 .travis.yml
  2. +6 −3 build.sbt
  3. +7 −9 docs/src/main/tut/codecs/semiauto-derivation.md
  4. +2 −1 project/plugins.sbt
View
@@ -16,10 +16,19 @@ cache:
install:
- pip install --user codecov
- rvm use 2.2.8 --install --fuzzy
- gem update --system
- gem install sass
- gem install jekyll -v 3.2.1
script:
- sbt ++$TRAVIS_SCALA_VERSION clean coverage validateJVM;
- sbt ++$TRAVIS_SCALA_VERSION benchmark/test coverageReport && codecov;
- if [[ "$TRAVIS_SCALA_VERSION" == 2.12.* ]];
then
sbt ++$TRAVIS_SCALA_VERSION docs/makeMicrosite;
else echo "Skipping docs on 2.11 and 2.13";
fi
- if [[ "$TRAVIS_BRANCH" == "scalajs" ]];
then
sbt ++$TRAVIS_SCALA_VERSION clean validateJS;
View
@@ -163,10 +163,13 @@ lazy val docSettings = allSettings ++ Seq(
lazy val docs = project.dependsOn(core, genericExtras, parser, shapes)
.settings(
moduleName := "circe-docs",
name := "Circe docs"
name := "Circe docs",
crossScalaVersions := crossScalaVersions.value.filterNot(_.startsWith("2.13")),
libraryDependencies += "io.circe" %% "circe-optics" % "0.10.0"
)
.settings(docSettings)
.settings(noPublishSettings)
.settings(macroSettings)
.enablePlugins(GhpagesPlugin)
.enablePlugins(MicrositesPlugin)
.enablePlugins(ScalaUnidocPlugin)
@@ -199,7 +202,7 @@ lazy val jsProjects: Seq[Project] =
lazy val aggregatedProjects: Seq[ProjectReference] = (
circeCrossModules.flatMap(cp => Seq(cp._1, cp._2)) ++
circeJsModules ++ circeJvmModules ++ circeDocsModules
circeJsModules ++ circeJvmModules
).map(p => p: ProjectReference)
lazy val macroSettings: Seq[Setting[_]] = Seq(
@@ -561,7 +564,7 @@ val jsTestProjects = jsProjects.filterNot(Set(core, parser, scalajs))
addCommandAlias("buildJVM", jvmProjects.map(";" + _.id + "/compile").mkString)
addCommandAlias(
"validateJVM",
";buildJVM" + jvmTestProjects.map(";" + _.id + "/test").mkString + ";scalastyle;unidoc"
";buildJVM" + jvmTestProjects.map(";" + _.id + "/test").mkString + ";scalastyle"
)
addCommandAlias("buildJS", jsProjects.map(";" + _.id + "/compile").mkString)
addCommandAlias(
@@ -45,20 +45,18 @@ NOTE: You will need the [Macro Paradise](https://docs.scala-lang.org/overviews/m
It's also possible to construct encoders and decoders for case class-like types
in a relatively boilerplate-free way without generic derivation:
```tut:silent
```tut:book
import io.circe.{ Decoder, Encoder }
case class User(id: Long, firstName: String, lastName: String)
object User {
implicit val decodeUser: Decoder[User] =
Decoder.forProduct3("id", "first_name", "last_name")(User.apply)
implicit val decodeUser: Decoder[User] =
Decoder.forProduct3("id", "first_name", "last_name")(User.apply)
implicit val encodeUser: Encoder[User] =
Encoder.forProduct3("id", "first_name", "last_name")(u =>
(u.id, u.firstName, u.lastName)
)
}
implicit val encodeUser: Encoder[User] =
Encoder.forProduct3("id", "first_name", "last_name")(u =>
(u.id, u.firstName, u.lastName)
)
```
It's not as clean or as maintainable as generic derivation, but it's less magical, it requires nothing but `circe-core`, and if you need a custom name mapping it's currently the best solution (although `0.6.0` introduces experimental configurable generic derivation in the `circe-generic-extras` module).
View
@@ -1,5 +1,5 @@
addSbtCoursier
addSbtPlugin("com.47deg" % "sbt-microsites" % "0.7.23")
addSbtPlugin("com.47deg" % "sbt-microsites" % "0.7.24")
addSbtPlugin("com.dwijnand" % "sbt-travisci" % "1.1.1")
addSbtPlugin("com.eed3si9n" % "sbt-unidoc" % "0.4.2")
addSbtPlugin("com.github.gseitz" % "sbt-release" % "1.0.9")
@@ -10,4 +10,5 @@ addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "0.6.0")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.24")
addSbtPlugin("org.scalastyle" %% "scalastyle-sbt-plugin" % "1.0.0")
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.5.1")
addSbtPlugin("org.tpolecat" % "tut-plugin" % "0.6.7")
addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.3.4")

0 comments on commit 7765cc4

Please sign in to comment.