From 2b6cbef684340a497dff2332ca65e56c341d478d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Hern=C3=A1ndez?= Date: Mon, 1 Jun 2020 07:54:43 +0200 Subject: [PATCH 01/22] Move microsite files to `microsite` --- build.sbt | 17 +++++++---------- {docs => microsite}/docs/activity.md | 0 {docs => microsite}/docs/auth.md | 0 {docs => microsite}/docs/contributing.md | 0 {docs => microsite}/docs/docs.md | 0 {docs => microsite}/docs/gist.md | 0 {docs => microsite}/docs/git_data.md | 0 {docs => microsite}/docs/index.md | 0 {docs => microsite}/docs/issue.md | 0 {docs => microsite}/docs/organization.md | 0 {docs => microsite}/docs/project.md | 0 {docs => microsite}/docs/pull_request.md | 0 {docs => microsite}/docs/repository.md | 0 {docs => microsite}/docs/team.md | 0 {docs => microsite}/docs/user.md | 0 .../src/main/resources/microsite/data/menu.yml | 0 .../microsite/img/jumbotron_pattern.png | Bin .../microsite/img/jumbotron_pattern2x.png | Bin .../microsite/img/light-navbar-brand.svg | 0 .../microsite/img/light-sidebar-brand.svg | 0 .../microsite/img/light_navbar_brand.png | Bin .../resources/microsite/img/navbar_brand.png | Bin .../resources/microsite/img/navbar_brand2x.png | Bin .../main/resources/microsite/img/poster.png | Bin .../resources/microsite/img/sidebar_brand.png | Bin .../microsite/img/sidebar_brand2x.png | Bin 26 files changed, 7 insertions(+), 10 deletions(-) rename {docs => microsite}/docs/activity.md (100%) rename {docs => microsite}/docs/auth.md (100%) rename {docs => microsite}/docs/contributing.md (100%) rename {docs => microsite}/docs/docs.md (100%) rename {docs => microsite}/docs/gist.md (100%) rename {docs => microsite}/docs/git_data.md (100%) rename {docs => microsite}/docs/index.md (100%) rename {docs => microsite}/docs/issue.md (100%) rename {docs => microsite}/docs/organization.md (100%) rename {docs => microsite}/docs/project.md (100%) rename {docs => microsite}/docs/pull_request.md (100%) rename {docs => microsite}/docs/repository.md (100%) rename {docs => microsite}/docs/team.md (100%) rename {docs => microsite}/docs/user.md (100%) rename {docs => microsite}/src/main/resources/microsite/data/menu.yml (100%) rename {docs => microsite}/src/main/resources/microsite/img/jumbotron_pattern.png (100%) rename {docs => microsite}/src/main/resources/microsite/img/jumbotron_pattern2x.png (100%) rename {docs => microsite}/src/main/resources/microsite/img/light-navbar-brand.svg (100%) rename {docs => microsite}/src/main/resources/microsite/img/light-sidebar-brand.svg (100%) rename {docs => microsite}/src/main/resources/microsite/img/light_navbar_brand.png (100%) rename {docs => microsite}/src/main/resources/microsite/img/navbar_brand.png (100%) rename {docs => microsite}/src/main/resources/microsite/img/navbar_brand2x.png (100%) rename {docs => microsite}/src/main/resources/microsite/img/poster.png (100%) rename {docs => microsite}/src/main/resources/microsite/img/sidebar_brand.png (100%) rename {docs => microsite}/src/main/resources/microsite/img/sidebar_brand2x.png (100%) diff --git a/build.sbt b/build.sbt index 0a2ddfdc6..54453bde7 100644 --- a/build.sbt +++ b/build.sbt @@ -1,6 +1,6 @@ -addCommandAlias("ci-test", "+scalafmtCheckAll; +scalafmtSbtCheck; +docs/mdoc; +test") -addCommandAlias("ci-docs", "project-docs/mdoc; docs/mdoc; headerCreateAll") -addCommandAlias("ci-microsite", "docs/publishMicrosite") +addCommandAlias("ci-test", "+scalafmtCheckAll; +scalafmtSbtCheck; +mdoc; +test") +addCommandAlias("ci-docs", "+mdoc; headerCreateAll") +addCommandAlias("ci-microsite", "publishMicrosite") skip in publish := true @@ -20,16 +20,13 @@ lazy val github4s = project // DOCS // ////////// -lazy val docs: Project = project - .aggregate(github4s) +lazy val microsite: Project = project .dependsOn(github4s) - .settings(micrositeSettings: _*) - .settings(skip in publish := true) .enablePlugins(MicrositesPlugin) .enablePlugins(ScalaUnidocPlugin) - .settings( - unidocProjectFilter in (ScalaUnidoc, unidoc) := inProjects(github4s, docs) - ) + .settings(micrositeSettings: _*) + .settings(skip in publish := true) + .settings(unidocProjectFilter in (ScalaUnidoc, unidoc) := inProjects(github4s, microsite)) lazy val `project-docs` = (project in file(".docs")) .aggregate(github4s) diff --git a/docs/docs/activity.md b/microsite/docs/activity.md similarity index 100% rename from docs/docs/activity.md rename to microsite/docs/activity.md diff --git a/docs/docs/auth.md b/microsite/docs/auth.md similarity index 100% rename from docs/docs/auth.md rename to microsite/docs/auth.md diff --git a/docs/docs/contributing.md b/microsite/docs/contributing.md similarity index 100% rename from docs/docs/contributing.md rename to microsite/docs/contributing.md diff --git a/docs/docs/docs.md b/microsite/docs/docs.md similarity index 100% rename from docs/docs/docs.md rename to microsite/docs/docs.md diff --git a/docs/docs/gist.md b/microsite/docs/gist.md similarity index 100% rename from docs/docs/gist.md rename to microsite/docs/gist.md diff --git a/docs/docs/git_data.md b/microsite/docs/git_data.md similarity index 100% rename from docs/docs/git_data.md rename to microsite/docs/git_data.md diff --git a/docs/docs/index.md b/microsite/docs/index.md similarity index 100% rename from docs/docs/index.md rename to microsite/docs/index.md diff --git a/docs/docs/issue.md b/microsite/docs/issue.md similarity index 100% rename from docs/docs/issue.md rename to microsite/docs/issue.md diff --git a/docs/docs/organization.md b/microsite/docs/organization.md similarity index 100% rename from docs/docs/organization.md rename to microsite/docs/organization.md diff --git a/docs/docs/project.md b/microsite/docs/project.md similarity index 100% rename from docs/docs/project.md rename to microsite/docs/project.md diff --git a/docs/docs/pull_request.md b/microsite/docs/pull_request.md similarity index 100% rename from docs/docs/pull_request.md rename to microsite/docs/pull_request.md diff --git a/docs/docs/repository.md b/microsite/docs/repository.md similarity index 100% rename from docs/docs/repository.md rename to microsite/docs/repository.md diff --git a/docs/docs/team.md b/microsite/docs/team.md similarity index 100% rename from docs/docs/team.md rename to microsite/docs/team.md diff --git a/docs/docs/user.md b/microsite/docs/user.md similarity index 100% rename from docs/docs/user.md rename to microsite/docs/user.md diff --git a/docs/src/main/resources/microsite/data/menu.yml b/microsite/src/main/resources/microsite/data/menu.yml similarity index 100% rename from docs/src/main/resources/microsite/data/menu.yml rename to microsite/src/main/resources/microsite/data/menu.yml diff --git a/docs/src/main/resources/microsite/img/jumbotron_pattern.png b/microsite/src/main/resources/microsite/img/jumbotron_pattern.png similarity index 100% rename from docs/src/main/resources/microsite/img/jumbotron_pattern.png rename to microsite/src/main/resources/microsite/img/jumbotron_pattern.png diff --git a/docs/src/main/resources/microsite/img/jumbotron_pattern2x.png b/microsite/src/main/resources/microsite/img/jumbotron_pattern2x.png similarity index 100% rename from docs/src/main/resources/microsite/img/jumbotron_pattern2x.png rename to microsite/src/main/resources/microsite/img/jumbotron_pattern2x.png diff --git a/docs/src/main/resources/microsite/img/light-navbar-brand.svg b/microsite/src/main/resources/microsite/img/light-navbar-brand.svg similarity index 100% rename from docs/src/main/resources/microsite/img/light-navbar-brand.svg rename to microsite/src/main/resources/microsite/img/light-navbar-brand.svg diff --git a/docs/src/main/resources/microsite/img/light-sidebar-brand.svg b/microsite/src/main/resources/microsite/img/light-sidebar-brand.svg similarity index 100% rename from docs/src/main/resources/microsite/img/light-sidebar-brand.svg rename to microsite/src/main/resources/microsite/img/light-sidebar-brand.svg diff --git a/docs/src/main/resources/microsite/img/light_navbar_brand.png b/microsite/src/main/resources/microsite/img/light_navbar_brand.png similarity index 100% rename from docs/src/main/resources/microsite/img/light_navbar_brand.png rename to microsite/src/main/resources/microsite/img/light_navbar_brand.png diff --git a/docs/src/main/resources/microsite/img/navbar_brand.png b/microsite/src/main/resources/microsite/img/navbar_brand.png similarity index 100% rename from docs/src/main/resources/microsite/img/navbar_brand.png rename to microsite/src/main/resources/microsite/img/navbar_brand.png diff --git a/docs/src/main/resources/microsite/img/navbar_brand2x.png b/microsite/src/main/resources/microsite/img/navbar_brand2x.png similarity index 100% rename from docs/src/main/resources/microsite/img/navbar_brand2x.png rename to microsite/src/main/resources/microsite/img/navbar_brand2x.png diff --git a/docs/src/main/resources/microsite/img/poster.png b/microsite/src/main/resources/microsite/img/poster.png similarity index 100% rename from docs/src/main/resources/microsite/img/poster.png rename to microsite/src/main/resources/microsite/img/poster.png diff --git a/docs/src/main/resources/microsite/img/sidebar_brand.png b/microsite/src/main/resources/microsite/img/sidebar_brand.png similarity index 100% rename from docs/src/main/resources/microsite/img/sidebar_brand.png rename to microsite/src/main/resources/microsite/img/sidebar_brand.png diff --git a/docs/src/main/resources/microsite/img/sidebar_brand2x.png b/microsite/src/main/resources/microsite/img/sidebar_brand2x.png similarity index 100% rename from docs/src/main/resources/microsite/img/sidebar_brand2x.png rename to microsite/src/main/resources/microsite/img/sidebar_brand2x.png From a6da8e520a98b2cd4db8dcc0344fafce77f62f97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Hern=C3=A1ndez?= Date: Mon, 1 Jun 2020 07:56:16 +0200 Subject: [PATCH 02/22] Move docs templates to `docs` folder, as Mdoc is expecting --- build.sbt | 8 ++------ {.docs => docs}/AUTHORS.md | 0 {.docs => docs}/CODE_OF_CONDUCT.md | 0 {.docs => docs}/CONTRIBUTING.md | 0 {.docs => docs}/LICENSE.md | 0 {.docs => docs}/NOTICE.md | 0 {.docs => docs}/README.md | 0 7 files changed, 2 insertions(+), 6 deletions(-) rename {.docs => docs}/AUTHORS.md (100%) rename {.docs => docs}/CODE_OF_CONDUCT.md (100%) rename {.docs => docs}/CONTRIBUTING.md (100%) rename {.docs => docs}/LICENSE.md (100%) rename {.docs => docs}/NOTICE.md (100%) rename {.docs => docs}/README.md (100%) diff --git a/build.sbt b/build.sbt index 54453bde7..04c36de65 100644 --- a/build.sbt +++ b/build.sbt @@ -28,11 +28,7 @@ lazy val microsite: Project = project .settings(skip in publish := true) .settings(unidocProjectFilter in (ScalaUnidoc, unidoc) := inProjects(github4s, microsite)) -lazy val `project-docs` = (project in file(".docs")) - .aggregate(github4s) - .dependsOn(github4s) - .settings(moduleName := "github4s-project-docs") - .settings(mdocIn := file(".docs")) +lazy val documentation = project + .enablePlugins(MdocPlugin) .settings(mdocOut := file(".")) .settings(skip in publish := true) - .enablePlugins(MdocPlugin) diff --git a/.docs/AUTHORS.md b/docs/AUTHORS.md similarity index 100% rename from .docs/AUTHORS.md rename to docs/AUTHORS.md diff --git a/.docs/CODE_OF_CONDUCT.md b/docs/CODE_OF_CONDUCT.md similarity index 100% rename from .docs/CODE_OF_CONDUCT.md rename to docs/CODE_OF_CONDUCT.md diff --git a/.docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md similarity index 100% rename from .docs/CONTRIBUTING.md rename to docs/CONTRIBUTING.md diff --git a/.docs/LICENSE.md b/docs/LICENSE.md similarity index 100% rename from .docs/LICENSE.md rename to docs/LICENSE.md diff --git a/.docs/NOTICE.md b/docs/NOTICE.md similarity index 100% rename from .docs/NOTICE.md rename to docs/NOTICE.md diff --git a/.docs/README.md b/docs/README.md similarity index 100% rename from .docs/README.md rename to docs/README.md From 03a1f4a421c8d885fe992f92402bfb68a23bd0ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Hern=C3=A1ndez?= Date: Mon, 1 Jun 2020 09:40:58 +0200 Subject: [PATCH 03/22] Remove `sbt-buildinfo` plugin, it isn't used anymore --- build.sbt | 12 +----------- project/ProjectPlugin.scala | 9 --------- project/plugins.sbt | 1 - 3 files changed, 1 insertion(+), 21 deletions(-) diff --git a/build.sbt b/build.sbt index 04c36de65..73a19725d 100644 --- a/build.sbt +++ b/build.sbt @@ -4,17 +4,7 @@ addCommandAlias("ci-microsite", "publishMicrosite") skip in publish := true -lazy val github4s = project - .enablePlugins(BuildInfoPlugin) - .settings( - buildInfoKeys := Seq[BuildInfoKey]( - name, - version, - "token" -> sys.env.getOrElse("GITHUB_TOKEN", "") - ), - buildInfoPackage := "github4s" - ) - .settings(coreDeps: _*) +lazy val github4s = project.settings(coreDeps: _*) ////////// // DOCS // diff --git a/project/ProjectPlugin.scala b/project/ProjectPlugin.scala index 574bb016b..8cc1f66c9 100644 --- a/project/ProjectPlugin.scala +++ b/project/ProjectPlugin.scala @@ -3,7 +3,6 @@ import microsites._ import microsites.MicrositesPlugin.autoImport._ import sbt.Keys._ import sbt._ -import scoverage.ScoverageKeys import scoverage.ScoverageKeys._ import com.alejandrohdezma.sbt.github.SbtGithubPlugin import sbtunidoc.ScalaUnidocPlugin.autoImport._ @@ -115,13 +114,5 @@ object ProjectPlugin extends AutoPlugin { coverageMinimum := 70d, coverageFailOnMinimum := true, coverageExcludedPackages := ";github4s\\.scalaz\\..*", - // This is necessary to prevent packaging the BuildInfo with - // sensible information like the Github token. Do not remove. - mappings in (Compile, packageBin) ~= { (ms: Seq[(File, String)]) => - ms filter { - case (_, toPath) => - !toPath.startsWith("github4s/BuildInfo") - } - } ) } diff --git a/project/plugins.sbt b/project/plugins.sbt index 760326671..bc41d4c82 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,4 +1,3 @@ -addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.9.0") addSbtPlugin("com.geirsson" % "sbt-ci-release" % "1.5.3") addSbtPlugin("com.47deg" % "sbt-microsites" % "1.2.0") addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.6.1") From 0bc5e750a567fb62ff2b4e2d161af71d1b97ce1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Hern=C3=A1ndez?= Date: Mon, 1 Jun 2020 09:43:47 +0200 Subject: [PATCH 04/22] Move `organization` & `crossScalaVersions` as build settings --- build.sbt | 3 +++ project/ProjectPlugin.scala | 8 +------- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/build.sbt b/build.sbt index 73a19725d..14fa5905f 100644 --- a/build.sbt +++ b/build.sbt @@ -1,3 +1,6 @@ +ThisBuild / organization := "com.47deg" +ThisBuild / crossScalaVersions := Seq("2.12.10", "2.13.1") + addCommandAlias("ci-test", "+scalafmtCheckAll; +scalafmtSbtCheck; +mdoc; +test") addCommandAlias("ci-docs", "+mdoc; headerCreateAll") addCommandAlias("ci-microsite", "publishMicrosite") diff --git a/project/ProjectPlugin.scala b/project/ProjectPlugin.scala index 8cc1f66c9..e6d1ea4cf 100644 --- a/project/ProjectPlugin.scala +++ b/project/ProjectPlugin.scala @@ -17,8 +17,6 @@ object ProjectPlugin extends AutoPlugin { object autoImport { lazy val V = new { - val scala212: String = "2.12.10" - val scala213: String = "2.13.1" val base64: String = "0.2.9" val cats: String = "2.1.1" val catsEffect: String = "2.1.1" @@ -98,12 +96,8 @@ object ProjectPlugin extends AutoPlugin { } - import autoImport.V - override def projectSettings: Seq[Def.Setting[_]] = Seq( - organization := "com.47deg", - crossScalaVersions := Seq(V.scala212, V.scala213), scalacOptions := { val withStripedLinter = scalacOptions.value filterNot Set("-Xlint", "-Xfuture").contains (CrossVersion.partialVersion(scalaBinaryVersion.value) match { @@ -113,6 +107,6 @@ object ProjectPlugin extends AutoPlugin { }, coverageMinimum := 70d, coverageFailOnMinimum := true, - coverageExcludedPackages := ";github4s\\.scalaz\\..*", + coverageExcludedPackages := ";github4s\\.scalaz\\..*" ) } From 4b5db96366f09386db3930b4817d61b1f160fea5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Hern=C3=A1ndez?= Date: Mon, 1 Jun 2020 09:44:14 +0200 Subject: [PATCH 05/22] Add `scalaVersion` setting --- build.sbt | 1 + 1 file changed, 1 insertion(+) diff --git a/build.sbt b/build.sbt index 14fa5905f..1afa7892c 100644 --- a/build.sbt +++ b/build.sbt @@ -1,4 +1,5 @@ ThisBuild / organization := "com.47deg" +ThisBuild / scalaVersion := "2.13.1" ThisBuild / crossScalaVersions := Seq("2.12.10", "2.13.1") addCommandAlias("ci-test", "+scalafmtCheckAll; +scalafmtSbtCheck; +mdoc; +test") From ccaa2040fec477f0da73a679119e38c413aa17df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Hern=C3=A1ndez?= Date: Mon, 1 Jun 2020 09:44:32 +0200 Subject: [PATCH 06/22] Update to latest Scala versions --- build.sbt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.sbt b/build.sbt index 1afa7892c..92f0755fe 100644 --- a/build.sbt +++ b/build.sbt @@ -1,6 +1,6 @@ ThisBuild / organization := "com.47deg" -ThisBuild / scalaVersion := "2.13.1" -ThisBuild / crossScalaVersions := Seq("2.12.10", "2.13.1") +ThisBuild / scalaVersion := "2.13.2" +ThisBuild / crossScalaVersions := Seq("2.12.11", "2.13.2") addCommandAlias("ci-test", "+scalafmtCheckAll; +scalafmtSbtCheck; +mdoc; +test") addCommandAlias("ci-docs", "+mdoc; headerCreateAll") From 35cb27216e0933b8a137737df03138101aa4b936 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Hern=C3=A1ndez?= Date: Mon, 1 Jun 2020 09:48:31 +0200 Subject: [PATCH 07/22] Remove unused variable --- project/ProjectPlugin.scala | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/project/ProjectPlugin.scala b/project/ProjectPlugin.scala index e6d1ea4cf..bab272ca4 100644 --- a/project/ProjectPlugin.scala +++ b/project/ProjectPlugin.scala @@ -17,15 +17,14 @@ object ProjectPlugin extends AutoPlugin { object autoImport { lazy val V = new { - val base64: String = "0.2.9" - val cats: String = "2.1.1" - val catsEffect: String = "2.1.1" - val circe: String = "0.13.0" - val http4s: String = "0.21.4" - val paradise: String = "2.1.1" - val scalamock: String = "4.4.0" - val scalatest: String = "3.1.2" - val silencer: String = "1.6.0" + val base64: String = "0.2.9" + val cats: String = "2.1.1" + val circe: String = "0.13.0" + val http4s: String = "0.21.4" + val paradise: String = "2.1.1" + val scalamock: String = "4.4.0" + val scalatest: String = "3.1.2" + val silencer: String = "1.6.0" } lazy val docsMappingsAPIDir: SettingKey[String] = From ae1d97d2c00b03e0f25e926329fac23d7f39ece3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Hern=C3=A1ndez?= Date: Mon, 1 Jun 2020 09:49:03 +0200 Subject: [PATCH 08/22] This requirement isn't needed --- project/ProjectPlugin.scala | 3 --- 1 file changed, 3 deletions(-) diff --git a/project/ProjectPlugin.scala b/project/ProjectPlugin.scala index bab272ca4..c49e2cca5 100644 --- a/project/ProjectPlugin.scala +++ b/project/ProjectPlugin.scala @@ -4,7 +4,6 @@ import microsites.MicrositesPlugin.autoImport._ import sbt.Keys._ import sbt._ import scoverage.ScoverageKeys._ -import com.alejandrohdezma.sbt.github.SbtGithubPlugin import sbtunidoc.ScalaUnidocPlugin.autoImport._ import mdoc.MdocPlugin.autoImport._ @@ -12,8 +11,6 @@ object ProjectPlugin extends AutoPlugin { override def trigger: PluginTrigger = allRequirements - override def requires: Plugins = SbtGithubPlugin - object autoImport { lazy val V = new { From 398575d05524fd53114cd731ba9b3bf840949387 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Hern=C3=A1ndez?= Date: Mon, 1 Jun 2020 10:05:16 +0200 Subject: [PATCH 09/22] Extract common code and remove options provided by `sbt-tpolecat` --- project/ProjectPlugin.scala | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/project/ProjectPlugin.scala b/project/ProjectPlugin.scala index c49e2cca5..1ddb4aa3f 100644 --- a/project/ProjectPlugin.scala +++ b/project/ProjectPlugin.scala @@ -83,26 +83,26 @@ object ProjectPlugin extends AutoPlugin { "com.github.ghik" % "silencer-lib" % V.silencer % Provided cross CrossVersion.full, compilerPlugin("com.github.ghik" % "silencer-plugin" % V.silencer cross CrossVersion.full) ), - libraryDependencies ++= (CrossVersion.partialVersion(scalaBinaryVersion.value) match { - case Some((2, 13)) => Seq.empty[ModuleID] - case _ => - Seq(compilerPlugin("org.scalamacros" %% "paradise" % V.paradise cross CrossVersion.full)) - }) + libraryDependencies ++= on(2, 12)( + compilerPlugin("org.scalamacros" %% "paradise" % V.paradise cross CrossVersion.full) + ).value ) } override def projectSettings: Seq[Def.Setting[_]] = Seq( - scalacOptions := { - val withStripedLinter = scalacOptions.value filterNot Set("-Xlint", "-Xfuture").contains - (CrossVersion.partialVersion(scalaBinaryVersion.value) match { - case Some((2, 13)) => withStripedLinter :+ "-Ymacro-annotations" - case _ => withStripedLinter - }) :+ "-language:higherKinds" - }, + scalacOptions ++= on(2, 13)("-Ymacro-annotations").value, coverageMinimum := 70d, coverageFailOnMinimum := true, coverageExcludedPackages := ";github4s\\.scalaz\\..*" ) + + def on[A](major: Int, minor: Int)(a: A): Def.Initialize[Seq[A]] = + Def.setting { + CrossVersion.partialVersion(scalaVersion.value) match { + case Some(v) if v == (major, minor) => Seq(a) + case _ => Nil + } + } } From c2a047ea54c80d0aa6b4921dc437b2e65cab9c53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Hern=C3=A1ndez?= Date: Mon, 1 Jun 2020 10:06:38 +0200 Subject: [PATCH 10/22] These are already provided by `sbt-microsites` --- project/ProjectPlugin.scala | 2 -- 1 file changed, 2 deletions(-) diff --git a/project/ProjectPlugin.scala b/project/ProjectPlugin.scala index 1ddb4aa3f..ca2a55256 100644 --- a/project/ProjectPlugin.scala +++ b/project/ProjectPlugin.scala @@ -32,8 +32,6 @@ object ProjectPlugin extends AutoPlugin { micrositeDescription := "Github API wrapper written in Scala", micrositeBaseUrl := "github4s", micrositeDocumentationUrl := "docs", - micrositeGithubOwner := "47degrees", - micrositeGithubRepo := "github4s", micrositeAuthor := "Github4s contributors", micrositeGithubToken := Option(System.getenv().get("GITHUB_TOKEN")), micrositeCompilingDocsTool := WithMdoc, From b62b523033ad1ca79b48d0e2f0b0892a75d700bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Hern=C3=A1ndez?= Date: Mon, 1 Jun 2020 10:15:13 +0200 Subject: [PATCH 11/22] Inline `publishMicrosite` into `ci-docs` --- build.sbt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/build.sbt b/build.sbt index 92f0755fe..c695ac955 100644 --- a/build.sbt +++ b/build.sbt @@ -3,8 +3,7 @@ ThisBuild / scalaVersion := "2.13.2" ThisBuild / crossScalaVersions := Seq("2.12.11", "2.13.2") addCommandAlias("ci-test", "+scalafmtCheckAll; +scalafmtSbtCheck; +mdoc; +test") -addCommandAlias("ci-docs", "+mdoc; headerCreateAll") -addCommandAlias("ci-microsite", "publishMicrosite") +addCommandAlias("ci-docs", "+mdoc; headerCreateAll; publishMicrosite") skip in publish := true From 0ac15afcdb0e9fe0a053e894b889691f0e0d2b28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Hern=C3=A1ndez?= Date: Mon, 1 Jun 2020 10:15:56 +0200 Subject: [PATCH 12/22] Add new alias that will be used for releasing new artifacts --- build.sbt | 1 + 1 file changed, 1 insertion(+) diff --git a/build.sbt b/build.sbt index c695ac955..2eb43e13f 100644 --- a/build.sbt +++ b/build.sbt @@ -4,6 +4,7 @@ ThisBuild / crossScalaVersions := Seq("2.12.11", "2.13.2") addCommandAlias("ci-test", "+scalafmtCheckAll; +scalafmtSbtCheck; +mdoc; +test") addCommandAlias("ci-docs", "+mdoc; headerCreateAll; publishMicrosite") +addCommandAlias("ci-publish", "ci-release") skip in publish := true From a950c5530d64259afe653da6ceb512afb37315f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Hern=C3=A1ndez?= Date: Mon, 1 Jun 2020 10:16:30 +0200 Subject: [PATCH 13/22] Enable downloading info from github before `ci-docs`/`ci-publish` --- build.sbt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.sbt b/build.sbt index 2eb43e13f..ddfffa313 100644 --- a/build.sbt +++ b/build.sbt @@ -3,8 +3,8 @@ ThisBuild / scalaVersion := "2.13.2" ThisBuild / crossScalaVersions := Seq("2.12.11", "2.13.2") addCommandAlias("ci-test", "+scalafmtCheckAll; +scalafmtSbtCheck; +mdoc; +test") -addCommandAlias("ci-docs", "+mdoc; headerCreateAll; publishMicrosite") -addCommandAlias("ci-publish", "ci-release") +addCommandAlias("ci-docs", "github; +mdoc; headerCreateAll; publishMicrosite") +addCommandAlias("ci-publish", "github; ci-release") skip in publish := true From 4f3b1ca33912a6a1020a957edc754ca8b5e2439d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Hern=C3=A1ndez?= Date: Mon, 1 Jun 2020 10:16:51 +0200 Subject: [PATCH 14/22] There is no need to call `scalafmt` with cross-compilation --- build.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index ddfffa313..863ffed11 100644 --- a/build.sbt +++ b/build.sbt @@ -2,7 +2,7 @@ ThisBuild / organization := "com.47deg" ThisBuild / scalaVersion := "2.13.2" ThisBuild / crossScalaVersions := Seq("2.12.11", "2.13.2") -addCommandAlias("ci-test", "+scalafmtCheckAll; +scalafmtSbtCheck; +mdoc; +test") +addCommandAlias("ci-test", "scalafmtCheckAll; scalafmtSbtCheck; +mdoc; +test") addCommandAlias("ci-docs", "github; +mdoc; headerCreateAll; publishMicrosite") addCommandAlias("ci-publish", "github; ci-release") From 73e810e959ba0a514ff3bde3319e6f65a9dff53e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Hern=C3=A1ndez?= Date: Mon, 1 Jun 2020 10:18:19 +0200 Subject: [PATCH 15/22] Remove `sbt-mdoc-toc` since it is not being used --- project/plugins.sbt | 1 - 1 file changed, 1 deletion(-) diff --git a/project/plugins.sbt b/project/plugins.sbt index bc41d4c82..6157fb650 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -8,5 +8,4 @@ addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.4.0") addSbtPlugin("com.alejandrohdezma" %% "sbt-github" % "0.6.0") addSbtPlugin("com.alejandrohdezma" % "sbt-github-header" % "0.6.0") addSbtPlugin("com.alejandrohdezma" % "sbt-github-mdoc" % "0.6.0") -addSbtPlugin("com.alejandrohdezma" % "sbt-mdoc-toc" % "0.2") addSbtPlugin("io.github.davidgregory084" % "sbt-tpolecat" % "0.1.11") From 8bea1dafd97124b8c0336c18d8942453ba7e9974 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Hern=C3=A1ndez?= Date: Mon, 1 Jun 2020 10:19:44 +0200 Subject: [PATCH 16/22] Update plugins to latest versions --- project/ProjectPlugin.scala | 2 +- project/plugins.sbt | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/project/ProjectPlugin.scala b/project/ProjectPlugin.scala index ca2a55256..868d528c9 100644 --- a/project/ProjectPlugin.scala +++ b/project/ProjectPlugin.scala @@ -21,7 +21,7 @@ object ProjectPlugin extends AutoPlugin { val paradise: String = "2.1.1" val scalamock: String = "4.4.0" val scalatest: String = "3.1.2" - val silencer: String = "1.6.0" + val silencer: String = "1.7.0" } lazy val docsMappingsAPIDir: SettingKey[String] = diff --git a/project/plugins.sbt b/project/plugins.sbt index 6157fb650..94e8bcf8d 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,11 +1,11 @@ addSbtPlugin("com.geirsson" % "sbt-ci-release" % "1.5.3") -addSbtPlugin("com.47deg" % "sbt-microsites" % "1.2.0") +addSbtPlugin("com.47deg" % "sbt-microsites" % "1.2.1") addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.6.1") -addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.3.3") +addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.0") addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.2.0") addSbtPlugin("com.eed3si9n" % "sbt-unidoc" % "0.4.3") -addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.4.0") -addSbtPlugin("com.alejandrohdezma" %% "sbt-github" % "0.6.0") -addSbtPlugin("com.alejandrohdezma" % "sbt-github-header" % "0.6.0") -addSbtPlugin("com.alejandrohdezma" % "sbt-github-mdoc" % "0.6.0") +addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.6.0") +addSbtPlugin("com.alejandrohdezma" % "sbt-github" % "0.8.2") +addSbtPlugin("com.alejandrohdezma" % "sbt-github-header" % "0.8.2") +addSbtPlugin("com.alejandrohdezma" % "sbt-github-mdoc" % "0.8.2") addSbtPlugin("io.github.davidgregory084" % "sbt-tpolecat" % "0.1.11") From 6a4c34c60db6007ad61fc730efe80621a17c0e50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Hern=C3=A1ndez?= Date: Mon, 1 Jun 2020 10:20:26 +0200 Subject: [PATCH 17/22] There is no need to call `mdoc` with cross-compilation --- build.sbt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.sbt b/build.sbt index 863ffed11..91d4bc5d7 100644 --- a/build.sbt +++ b/build.sbt @@ -2,8 +2,8 @@ ThisBuild / organization := "com.47deg" ThisBuild / scalaVersion := "2.13.2" ThisBuild / crossScalaVersions := Seq("2.12.11", "2.13.2") -addCommandAlias("ci-test", "scalafmtCheckAll; scalafmtSbtCheck; +mdoc; +test") -addCommandAlias("ci-docs", "github; +mdoc; headerCreateAll; publishMicrosite") +addCommandAlias("ci-test", "scalafmtCheckAll; scalafmtSbtCheck; mdoc; +test") +addCommandAlias("ci-docs", "github; mdoc; headerCreateAll; publishMicrosite") addCommandAlias("ci-publish", "github; ci-release") skip in publish := true From 1286384e815f523a1d9aa7b9eceadea75efc77e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Hern=C3=A1ndez?= Date: Mon, 1 Jun 2020 10:22:23 +0200 Subject: [PATCH 18/22] Add `sbt-codecov` to manage testing with coverage and uploading it --- build.sbt | 2 +- project/plugins.sbt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index 91d4bc5d7..b0c62c8ad 100644 --- a/build.sbt +++ b/build.sbt @@ -2,7 +2,7 @@ ThisBuild / organization := "com.47deg" ThisBuild / scalaVersion := "2.13.2" ThisBuild / crossScalaVersions := Seq("2.12.11", "2.13.2") -addCommandAlias("ci-test", "scalafmtCheckAll; scalafmtSbtCheck; mdoc; +test") +addCommandAlias("ci-test", "scalafmtCheckAll; scalafmtSbtCheck; mdoc; testCovered") addCommandAlias("ci-docs", "github; mdoc; headerCreateAll; publishMicrosite") addCommandAlias("ci-publish", "github; ci-release") diff --git a/project/plugins.sbt b/project/plugins.sbt index 94e8bcf8d..3e1e6e736 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -5,6 +5,7 @@ addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.0") addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.2.0") addSbtPlugin("com.eed3si9n" % "sbt-unidoc" % "0.4.3") addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.6.0") +addSbtPlugin("com.alejandrohdezma" % "sbt-codecov" % "0.2.0") addSbtPlugin("com.alejandrohdezma" % "sbt-github" % "0.8.2") addSbtPlugin("com.alejandrohdezma" % "sbt-github-header" % "0.8.2") addSbtPlugin("com.alejandrohdezma" % "sbt-github-mdoc" % "0.8.2") From e34c8902647b91443ec0fbafd882604403e238e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Hern=C3=A1ndez?= Date: Mon, 1 Jun 2020 10:24:28 +0200 Subject: [PATCH 19/22] This file will be used by next version of workflows provided by .github --- .github/actions.yml | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .github/actions.yml diff --git a/.github/actions.yml b/.github/actions.yml new file mode 100644 index 000000000..e02f01632 --- /dev/null +++ b/.github/actions.yml @@ -0,0 +1,2 @@ +pre: + docs: 'gem install jekyll -v 4' \ No newline at end of file From 4f01b49fe2a2dfe82adbcc0c60cd9d7d65e16971 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Hern=C3=A1ndez?= Date: Mon, 1 Jun 2020 12:11:18 +0200 Subject: [PATCH 20/22] Remove `sbt-org-policies` unused markers --- README.md | 11 ----------- docs/README.md | 11 ----------- 2 files changed, 22 deletions(-) diff --git a/README.md b/README.md index 0012d9cdf..964699065 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,6 @@ -[comment]: # (Start Badges) - [![Join the chat at https://gitter.im/47degrees/github4s](https://badges.gitter.im/47degrees/github4s.svg)](https://gitter.im/47degrees/github4s?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![codecov.io](http://codecov.io/gh/47degrees/github4s/branch/master/graph/badge.svg)](http://codecov.io/gh/47degrees/github4s) [![Maven Central](https://img.shields.io/badge/maven%20central-0.24.0-green.svg)](https://oss.sonatype.org/#nexus-search;gav~com.47deg~github4s*) [![License](https://img.shields.io/badge/license-Apache%202-blue.svg)](https://raw.githubusercontent.com/47degrees/github4s/master/LICENSE) [![Latest version](https://img.shields.io/badge/github4s-0.24.0-green.svg)](https://index.scala-lang.org/47degrees/github4s) [![GitHub Issues](https://img.shields.io/github/issues/47degrees/github4s.svg)](https://github.com/47degrees/github4s/issues) -[comment]: # (End Badges) - Github4s ============= @@ -14,14 +10,10 @@ Github4s To get started with SBT, simply add the following to your build.sbt file. -[comment]: # (Start Replace) - ```scala libraryDependencies += "com.47deg" %% "github4s" % "0.24.0" ``` -[comment]: # (End Replace) - ## Github4s in the wild If you wish to add your library here please consider a PR to include it in the list below. @@ -32,11 +24,8 @@ If you wish to add your library here please consider a PR to include it in the l | | [**dashing**](https://github.com/benfradet/dashing) | Dashing is a collection of dashboards to monitor the health of an open source organization. | | [**cla-bot**](https://github.com/snowplow-incubator/cla-bot) | Bot making sure external contributors sign a CLA. -[comment]: # (Start Copyright) # Copyright Github4s is designed and developed by 47 Degrees Copyright (C) 2016-2020 47 Degrees. - -[comment]: # (End Copyright) diff --git a/docs/README.md b/docs/README.md index 04070e8ea..cd6e2e027 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,10 +1,6 @@ -[comment]: # (Start Badges) - [![Join the chat at https://gitter.im/47degrees/github4s](https://badges.gitter.im/47degrees/github4s.svg)](https://gitter.im/47degrees/github4s?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![codecov.io](http://codecov.io/gh/47degrees/github4s/branch/master/graph/badge.svg)](http://codecov.io/gh/47degrees/github4s) [![Maven Central](https://img.shields.io/badge/maven%20central-@VERSION@-green.svg)](https://oss.sonatype.org/#nexus-search;gav~com.47deg~github4s*) [![License](https://img.shields.io/badge/license-Apache%202-blue.svg)](https://raw.githubusercontent.com/47degrees/github4s/master/LICENSE) [![Latest version](https://img.shields.io/badge/github4s-@VERSION@-green.svg)](https://index.scala-lang.org/47degrees/github4s) [![GitHub Issues](https://img.shields.io/github/issues/47degrees/github4s.svg)](https://github.com/47degrees/github4s/issues) -[comment]: # (End Badges) - Github4s ============= @@ -14,14 +10,10 @@ Github4s To get started with SBT, simply add the following to your build.sbt file. -[comment]: # (Start Replace) - ```scala libraryDependencies += "com.47deg" %% "github4s" % "@VERSION@" ``` -[comment]: # (End Replace) - ## Github4s in the wild If you wish to add your library here please consider a PR to include it in the list below. @@ -32,11 +24,8 @@ If you wish to add your library here please consider a PR to include it in the l | | [**dashing**](https://github.com/benfradet/dashing) | Dashing is a collection of dashboards to monitor the health of an open source organization. | | [**cla-bot**](https://github.com/snowplow-incubator/cla-bot) | Bot making sure external contributors sign a CLA. -[comment]: # (Start Copyright) # Copyright Github4s is designed and developed by 47 Degrees Copyright (C) 2016-2020 47 Degrees. - -[comment]: # (End Copyright) From 7d43c86f3dd6ab657f6cb99b803854e9c5667b7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Hern=C3=A1ndez?= Date: Mon, 1 Jun 2020 12:12:16 +0200 Subject: [PATCH 21/22] Add `sbt-remove-test-from-pom` plugin --- project/plugins.sbt | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/project/plugins.sbt b/project/plugins.sbt index 3e1e6e736..277466c4a 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,12 +1,13 @@ -addSbtPlugin("com.geirsson" % "sbt-ci-release" % "1.5.3") -addSbtPlugin("com.47deg" % "sbt-microsites" % "1.2.1") -addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.6.1") -addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.0") -addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.2.0") -addSbtPlugin("com.eed3si9n" % "sbt-unidoc" % "0.4.3") -addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.6.0") -addSbtPlugin("com.alejandrohdezma" % "sbt-codecov" % "0.2.0") -addSbtPlugin("com.alejandrohdezma" % "sbt-github" % "0.8.2") -addSbtPlugin("com.alejandrohdezma" % "sbt-github-header" % "0.8.2") -addSbtPlugin("com.alejandrohdezma" % "sbt-github-mdoc" % "0.8.2") -addSbtPlugin("io.github.davidgregory084" % "sbt-tpolecat" % "0.1.11") +addSbtPlugin("com.geirsson" % "sbt-ci-release" % "1.5.3") +addSbtPlugin("com.47deg" % "sbt-microsites" % "1.2.1") +addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.6.1") +addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.0") +addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.2.0") +addSbtPlugin("com.eed3si9n" % "sbt-unidoc" % "0.4.3") +addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.6.0") +addSbtPlugin("com.alejandrohdezma" % "sbt-codecov" % "0.2.0") +addSbtPlugin("com.alejandrohdezma" % "sbt-github" % "0.8.2") +addSbtPlugin("com.alejandrohdezma" % "sbt-github-header" % "0.8.2") +addSbtPlugin("com.alejandrohdezma" % "sbt-github-mdoc" % "0.8.2") +addSbtPlugin("com.alejandrohdezma" % "sbt-remove-test-from-pom" % "0.1.0") +addSbtPlugin("io.github.davidgregory084" % "sbt-tpolecat" % "0.1.11") From 2d14932947cf1f51fc6bee242e202e41ecbe211d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Hern=C3=A1ndez?= Date: Tue, 2 Jun 2020 09:46:44 +0200 Subject: [PATCH 22/22] Remove unneeded setting --- project/ProjectPlugin.scala | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/project/ProjectPlugin.scala b/project/ProjectPlugin.scala index 868d528c9..e122ca875 100644 --- a/project/ProjectPlugin.scala +++ b/project/ProjectPlugin.scala @@ -92,8 +92,7 @@ object ProjectPlugin extends AutoPlugin { Seq( scalacOptions ++= on(2, 13)("-Ymacro-annotations").value, coverageMinimum := 70d, - coverageFailOnMinimum := true, - coverageExcludedPackages := ";github4s\\.scalaz\\..*" + coverageFailOnMinimum := true ) def on[A](major: Int, minor: Int)(a: A): Def.Initialize[Seq[A]] =