From 1f6fdc4a5e0107c2531f80e2b4d2f5a863352dd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Raddum=20Berg?= Date: Sat, 14 May 2022 01:01:17 +0200 Subject: [PATCH] improve templating --- .../src/main/scala/bleep/JsonList.scala | 2 + bleep-core/src/main/scala/bleep/model.scala | 26 +- .../scala/bleep/testing/SnapshotTest.scala | 8 +- bleep.json | 144 +-- .../scala/bleep/commands/BuildCreateNew.scala | 12 +- .../commands/BuildReinferTemplates.scala | 2 +- .../main/scala/bleep/commands/Import.scala | 3 +- .../main/scala/bleep/internal/Templates.scala | 334 ++++--- bleep/src/test/resources/foo.json | 30 + .../bleep/IntegrationSnapshotTests.scala | 2 +- bleep/src/test/scala/bleep/TemplateTest.scala | 143 +++ snapshot-tests/doobie/bleep.json | 206 +++-- snapshot-tests/http4s/bleep.json | 636 +++++++++---- snapshot-tests/tapir/bleep.json | 836 ++++++++++++------ snapshot-tests/templates/common_template.json | 21 + .../templates/common_test_template.json | 29 + snapshot-tests/templates/foo.json | 48 + .../templates/template_ignore_b.json | 26 + 18 files changed, 1747 insertions(+), 761 deletions(-) create mode 100644 bleep/src/test/resources/foo.json create mode 100644 bleep/src/test/scala/bleep/TemplateTest.scala create mode 100644 snapshot-tests/templates/common_template.json create mode 100644 snapshot-tests/templates/common_test_template.json create mode 100644 snapshot-tests/templates/foo.json create mode 100644 snapshot-tests/templates/template_ignore_b.json diff --git a/bleep-core/src/main/scala/bleep/JsonList.scala b/bleep-core/src/main/scala/bleep/JsonList.scala index 250ef602b..8e5b59478 100644 --- a/bleep-core/src/main/scala/bleep/JsonList.scala +++ b/bleep-core/src/main/scala/bleep/JsonList.scala @@ -16,6 +16,8 @@ case class JsonList[T](values: List[T]) extends SetLike[JsonList[T]] { override def removeAll(other: JsonList[T]): JsonList[T] = JsonList(values.filterNot(other.values.toSet)) override def union(other: JsonList[T]): JsonList[T] = JsonList((values ++ other.values).distinct) + def transform[U](f: List[T] => List[U]): JsonList[U] = JsonList(f(values)) + def +(t: T): JsonList[T] = JsonList(values :+ t) override def toString(): String = diff --git a/bleep-core/src/main/scala/bleep/model.scala b/bleep-core/src/main/scala/bleep/model.scala index 06b33955e..082b11999 100644 --- a/bleep-core/src/main/scala/bleep/model.scala +++ b/bleep-core/src/main/scala/bleep/model.scala @@ -136,7 +136,7 @@ object model { implicit val encodesScala: Encoder[Versions.Scala] = Encoder[String].contramap(_.scalaVersion) implicit val decodes: Decoder[Scala] = deriveDecoder - implicit val Encodes: Encoder[Scala] = deriveEncoder + implicit val encodes: Encoder[Scala] = deriveEncoder } sealed abstract class PlatformId(val value: String) @@ -164,6 +164,7 @@ object model { implicit val ordering: Ordering[TemplateId] = Ordering.by(_.value) implicit val encodes: Encoder[TemplateId] = Encoder[String].contramap(_.value) + implicit val formats: Formatter[TemplateId] = _.value implicit val keyDecodes: KeyDecoder[TemplateId] = KeyDecoder[String].map(TemplateId.apply) implicit val keyEncodes: KeyEncoder[TemplateId] = KeyEncoder[String].contramap(_.value) } @@ -355,6 +356,7 @@ object model { implicit val encodes: Encoder[ProjectName] = Encoder[String].contramap(_.value) implicit val keyDecodes: KeyDecoder[ProjectName] = KeyDecoder[String].map(ProjectName.apply) implicit val keyEncodes: KeyEncoder[ProjectName] = KeyEncoder[String].contramap(_.value) + implicit val formatter: Formatter[ProjectName] = pn => fansi.Str(pn.value) def decoder(legal: Iterable[ProjectName]): Decoder[ProjectName] = { val byString: Map[String, ProjectName] = legal.map(t => t.value -> t).toMap @@ -399,15 +401,18 @@ object model { Decoder.instance(c => for { str <- c.as[String] - crossName <- str.split("@") match { - case Array(name) => Right(CrossProjectName(ProjectName(name), None)) - case Array(name, crossId) => Right(CrossProjectName(ProjectName(name), Some(CrossId(crossId)))) - case _ => Left(DecodingFailure(s"more than one '@' encountered in CrossProjectName $str", c.history)) - } + crossName <- keyDecodes(str).toRight(DecodingFailure(s"more than one '@' encountered in CrossProjectName $str", c.history)) } yield crossName ) - implicit val encodes: Encoder[CrossProjectName] = Encoder[String].contramap(_.value) + implicit val keyEncodes: KeyEncoder[CrossProjectName] = KeyEncoder[String].contramap(_.value) + implicit val keyDecodes: KeyDecoder[CrossProjectName] = KeyDecoder.instance(str => + str.split("@") match { + case Array(name) => Some(CrossProjectName(ProjectName(name), None)) + case Array(name, crossId) => Some(CrossProjectName(ProjectName(name), Some(CrossId(crossId)))) + case _ => None + } + ) } case class Project( @@ -604,6 +609,13 @@ object model { ) object Build { + val empty = Build( + constants.$schema, + JsonMap.empty, + JsonMap.empty, + resolvers = JsonList.empty, + projects = JsonMap.empty + ) implicit val decodes: Decoder[Build] = Decoder.instance(c => for { diff --git a/bleep-test-harness/src/main/scala/bleep/testing/SnapshotTest.scala b/bleep-test-harness/src/main/scala/bleep/testing/SnapshotTest.scala index aaef7f466..0f20a6910 100644 --- a/bleep-test-harness/src/main/scala/bleep/testing/SnapshotTest.scala +++ b/bleep-test-harness/src/main/scala/bleep/testing/SnapshotTest.scala @@ -11,7 +11,7 @@ import java.nio.file.{Files, Path, Paths} import scala.util.Properties trait SnapshotTest extends AnyFunSuite with TripleEqualsSupport { - val isCi: Boolean = + val enforceUpToDate: Boolean = sys.env.contains("BUILD_NUMBER") || sys.env.contains("CI") // from sbt val outFolder: Path = @@ -29,11 +29,11 @@ trait SnapshotTest extends AnyFunSuite with TripleEqualsSupport { def writeAndCompare(in: Path, fileMap: Map[Path, String]): Assertion = if (Properties.isWin) pending // let's deal with this later else { - if (isCi) { + if (enforceUpToDate) { fileMap.foreach { case (path, contents) => if (Files.exists(path)) { val existingContents = Files.readString(path) - assert(existingContents === contents) + assert(existingContents === contents, path) } else { fail(s"Expected path $path to exist") } @@ -50,7 +50,7 @@ trait SnapshotTest extends AnyFunSuite with TripleEqualsSupport { def writeAndCompareEarly(in: Path, fileMap: Map[Path, String]): Assertion = if (Properties.isWin) succeed // let's deal with this later else { - if (isCi) { + if (enforceUpToDate) { fileMap.foreach { case (path, contents) => if (Files.exists(path)) { val existingContents = Files.readString(path) diff --git a/bleep.json b/bleep.json index 19c7d7bc8..3bad922a1 100644 --- a/bleep.json +++ b/bleep.json @@ -30,9 +30,9 @@ "module" : "ch.epfl.scala::bloop-config:1.5.0" }, "com.lihaoyi::fansi:0.3.1", - "io.circe::circe-core:0.14.1", - "io.circe::circe-generic:0.14.1", - "io.circe::circe-parser:0.14.1", + "io.circe::circe-core:0.14.2", + "io.circe::circe-generic:0.14.2", + "io.circe::circe-parser:0.14.2", { "exclusions" : { "org.scala-lang.modules" : "scala-collection-compat_2.13" @@ -43,25 +43,34 @@ "org.gnieh::diffson-circe:4.1.1", "org.virtuslab.scala-cli::bloop-rifle:0.1.6" ], - "extends" : "template-cross-all" + "extends" : [ + "template-common-main", + "template-cross-all" + ] }, "bleep-tasks" : { "dependsOn" : "bleep-core", - "extends" : "template-cross-all", + "extends" : [ + "template-common-main", + "template-cross-all" + ], "resources" : "./../liberated/sbt-native-image/plugin/src/main/resources", "sources" : "./../liberated/sbt-native-image/plugin/src/main/scala" }, "bleep-tasks-publishing" : { "dependencies" : [ "com.eed3si9n::gigahorse-okhttp:0.6.0", - "org.bouncycastle:bcpg-jdk15on:1.69", + "org.bouncycastle:bcpg-jdk15on:1.70", "org.scala-lang.modules::scala-parser-combinators:2.1.1", "org.sonatype.spice.zapper:spice-zapper:1.3", "org.wvlet.airframe::airframe-http:22.4.2", "se.sawano.java:alphanumeric-comparator:1.4.1" ], "dependsOn" : "bleep-tasks", - "extends" : "template-cross-jvm-212-213-main", + "extends" : [ + "template-common-main", + "template-cross-jvm-212-213" + ], "sources" : [ "./../liberated/sbt-ci-release/plugin/src/main/scala", "./../liberated/sbt-dynver/dynver/src/main/scala", @@ -73,35 +82,28 @@ ] }, "bleep-tasks-publishing-test" : { - "cross" : { - "jvm212" : { - "extends" : [ - "template-common-test", - "template-scala-2.12" - ] - }, - "jvm213" : { - "extends" : [ - "template-common-test", - "template-scala-2.13" - ] - } - }, "dependsOn" : "bleep-tasks-publishing", + "extends" : [ + "template-common-test", + "template-cross-jvm-212-213" + ], "folder" : "./bleep-tasks-publishing" }, "bleep-test" : { "dependsOn" : "bleep", "extends" : [ - "template-common-test", - "template-scala-2.13" + "template-scala-2.13", + "template-common-test" ], "folder" : "./bleep" }, "bleep-test-harness" : { "dependencies" : "org.scalatest::scalatest:3.2.12", "dependsOn" : "bleep-core", - "extends" : "template-cross-jvm-212-213-main" + "extends" : [ + "template-common-main", + "template-cross-jvm-212-213" + ] }, "scripts" : { "dependsOn" : [ @@ -145,80 +147,37 @@ "dependsOn" : "bleep-test-harness", "extends" : "template-common", "isTestProject" : true, - "sbt-scope" : "test", - "scala" : { - "options" : [ - "-Xcheckinit", - "-Xlint:adapted-args", - "-Xlint:constant", - "-Xlint:delayedinit-select", - "-Xlint:doc-detached", - "-Xlint:inaccessible", - "-Xlint:infer-any", - "-Xlint:missing-interpolator", - "-Xlint:nullary-unit", - "-Xlint:option-implicit", - "-Xlint:package-object-classes", - "-Xlint:poly-implicit-overload", - "-Xlint:private-shadow", - "-Xlint:stars-align", - "-Xlint:type-parameter-shadow", - "-language:existentials" - ] - } + "sbt-scope" : "test" }, "template-cross-all" : { "cross" : { - "jvm212" : { - "extends" : [ - "template-common-main", - "template-scala-2.12" - ] - }, - "jvm213" : { - "extends" : [ - "template-common-main", - "template-scala-2.13" - ] - }, "jvm3" : { - "extends" : [ - "template-common-main", - "template-scala-3" - ] + "extends" : "template-scala-3" } - } + }, + "extends" : "template-cross-jvm-212-213" }, - "template-cross-jvm-212-213-main" : { + "template-cross-jvm-212-213" : { "cross" : { "jvm212" : { - "extends" : [ - "template-common-main", - "template-scala-2.12" - ] + "extends" : "template-scala-2.12" }, "jvm213" : { - "extends" : [ - "template-common-main", - "template-scala-2.13" - ] + "extends" : "template-scala-2.13" } } }, - "template-scala-2.12" : { - "extends" : "template-common", + "template-scala-2" : { "scala" : { "options" : [ "-Xcheckinit", "-Xlint:adapted-args", - "-Xlint:by-name-right-associative", "-Xlint:constant", "-Xlint:delayedinit-select", "-Xlint:doc-detached", "-Xlint:inaccessible", "-Xlint:infer-any", "-Xlint:missing-interpolator", - "-Xlint:nullary-override", "-Xlint:nullary-unit", "-Xlint:option-implicit", "-Xlint:package-object-classes", @@ -226,6 +185,16 @@ "-Xlint:private-shadow", "-Xlint:stars-align", "-Xlint:type-parameter-shadow", + "-language:existentials" + ] + } + }, + "template-scala-2.12" : { + "extends" : "template-scala-2", + "scala" : { + "options" : [ + "-Xlint:by-name-right-associative", + "-Xlint:nullary-override", "-Xlint:unsound-match", "-Yno-adapted-args", "-Ypartial-unification", @@ -241,14 +210,13 @@ "-Ywarn-unused:patvars", "-Ywarn-unused:privates", "-Ywarn-value-discard", - "-deprecation", - "-language:existentials" + "-deprecation" ], "version" : "2.12.15" } }, "template-scala-2.13" : { - "extends" : "template-common", + "extends" : "template-scala-2", "scala" : { "options" : [ "-Wdead-code", @@ -263,34 +231,16 @@ "-Wunused:patvars", "-Wunused:privates", "-Wvalue-discard", - "-Xcheckinit", "-Xlint:-byname-implicit", - "-Xlint:adapted-args", - "-Xlint:constant", - "-Xlint:delayedinit-select", "-Xlint:deprecation", - "-Xlint:doc-detached", "-Xlint:implicit-not-found", "-Xlint:implicit-recursion", - "-Xlint:inaccessible", - "-Xlint:infer-any", - "-Xlint:missing-interpolator", - "-Xlint:nullary-unit", - "-Xlint:option-implicit", - "-Xlint:package-object-classes", - "-Xlint:poly-implicit-overload", - "-Xlint:private-shadow", - "-Xlint:stars-align", - "-Xlint:strict-unsealed-patmat", - "-Xlint:type-parameter-shadow", - "-language:existentials" + "-Xlint:strict-unsealed-patmat" ], "version" : "2.13.8" } }, "template-scala-3" : { - "extends" : "template-common", - "sbt-scope" : "main", "scala" : { "options" : [ "-Ykind-projector", diff --git a/bleep/src/main/scala/bleep/commands/BuildCreateNew.scala b/bleep/src/main/scala/bleep/commands/BuildCreateNew.scala index a19fca124..82fda6aaa 100644 --- a/bleep/src/main/scala/bleep/commands/BuildCreateNew.scala +++ b/bleep/src/main/scala/bleep/commands/BuildCreateNew.scala @@ -50,7 +50,7 @@ case class BuildCreateNew(logger: Logger, cwd: Path, platforms: NonEmptyList[mod def genAllFiles(buildPaths: BuildPaths): Map[Path, String] = { val exampleFiles = new BuildCreateNew.ExampleFiles(name) - val build = BuildCreateNew.genBuild(exampleFiles, platforms, scalas, name) + val build = BuildCreateNew.genBuild(logger, exampleFiles, platforms, scalas, name) val value = Map[Path, String]( buildPaths.bleepJsonFile -> build.asJson.foldWith(ShortenAndSortJson).spaces2, @@ -100,7 +100,13 @@ object BuildCreateNew { } } - def genBuild(exampleFiles: ExampleFiles, platforms: NonEmptyList[model.PlatformId], scalas: NonEmptyList[Versions.Scala], name: String): model.Build = { + def genBuild( + logger: Logger, + exampleFiles: ExampleFiles, + platforms: NonEmptyList[model.PlatformId], + scalas: NonEmptyList[Versions.Scala], + name: String + ): model.Build = { val defaultOpts = Options(Set(Options.Opt.WithArgs("-encoding", List("utf8")), Options.Opt.Flag("-feature"), Options.Opt.Flag("-unchecked"))) def variants(name: String): NonEmptyList[(model.PlatformId, Versions.Scala, model.CrossProjectName)] = @@ -174,6 +180,6 @@ object BuildCreateNew { retainCrossTemplates = Map.empty ) - Templates.apply(explodedBuild, ignoreWhenInferringTemplates = _ => false) + Templates.apply(logger, explodedBuild, ignoreWhenInferringTemplates = _ => false) } } diff --git a/bleep/src/main/scala/bleep/commands/BuildReinferTemplates.scala b/bleep/src/main/scala/bleep/commands/BuildReinferTemplates.scala index 365b05206..a0bf7973a 100644 --- a/bleep/src/main/scala/bleep/commands/BuildReinferTemplates.scala +++ b/bleep/src/main/scala/bleep/commands/BuildReinferTemplates.scala @@ -10,7 +10,7 @@ case class BuildReinferTemplates(started: Started, ignoreWhenInferringTemplates: val normalizedBuild = normalizeBuild(started.build) val droppedTemplates = normalizedBuild.dropTemplates - val build = Templates(droppedTemplates, ignoreWhenInferringTemplates) + val build = Templates(started.logger, droppedTemplates, ignoreWhenInferringTemplates) // fail if we have done illegal rewrites during templating ExplodedBuild.diffProjects(Defaults.add(normalizedBuild).dropTemplates, ExplodedBuild.of(build).dropTemplates) match { diff --git a/bleep/src/main/scala/bleep/commands/Import.scala b/bleep/src/main/scala/bleep/commands/Import.scala index b2e99d331..045f98c9b 100644 --- a/bleep/src/main/scala/bleep/commands/Import.scala +++ b/bleep/src/main/scala/bleep/commands/Import.scala @@ -117,7 +117,8 @@ addSbtPlugin("build.bleep" % "sbt-export-dependencies" % "0.1.0") val build0 = importBloopFilesFromSbt(logger, sbtBuildDir, destinationPaths, bloopFilesByProjectName, sbtExportFiles) val normalizedBuild = normalizeBuild(build0) - val build1 = Templates(normalizedBuild, options.ignoreWhenInferringTemplates) + + val build1 = Templates(logger, normalizedBuild, options.ignoreWhenInferringTemplates) val build = maybeExistingBleepJson.flatMap(x => model.parseBuild(Files.readString(x)).toOption) match { diff --git a/bleep/src/main/scala/bleep/internal/Templates.scala b/bleep/src/main/scala/bleep/internal/Templates.scala index 0f7da0c36..f8e869674 100644 --- a/bleep/src/main/scala/bleep/internal/Templates.scala +++ b/bleep/src/main/scala/bleep/internal/Templates.scala @@ -2,10 +2,13 @@ package bleep package internal import bleep.internal.Functions.sortedExtends +import bleep.logging.{Formatter, Logger} +import bleep.model.ProjectName import bleep.rewrites.deduplicateDependencies import scala.annotation.tailrec -import scala.collection.immutable.{SortedMap, SortedSet} +import scala.collection.immutable.SortedSet +import scala.collection.mutable object Templates { case class ProjectKeepExploded(exploded: model.Project, current: model.Project) { @@ -20,6 +23,8 @@ object Templates { implicit class ProjectOps(p: model.Project) { def withTemplate(t: model.TemplateId): model.Project = p.copy(`extends` = p.`extends` + t) + def dropTemplates: model.Project = + p.copy(`extends` = JsonList.empty) } sealed trait TemplateDef { @@ -60,37 +65,92 @@ object Templates { object TemplateDef { implicit def ordering: Ordering[TemplateDef] = Ordering.by(_.name) - def applicableForProjects(projects: List[model.Project]): List[TemplateDef] = { - val scalas: List[ScalaVersion] = - projects.flatMap(p => p.scala.flatMap(_.version)).distinct.map(v => ScalaVersion(v.binVersion)) + def templateGroupsForProjects( + projects0: Map[model.CrossProjectName, model.Project], + ignoreWhenInferringTemplates: model.ProjectName => Boolean + ): List[TemplateDef] = { + val projects = projects0.toList.collect { case (name, p) if !ignoreWhenInferringTemplates(name.name) => p } + + val scalas: List[ScalaTemplate] = + projects + .flatMap(p => p.scala.flatMap(_.version)) + .flatMap { v => + val scala2 = if (v.epoch == '2') Some(Scala2) else None + val binVersion = ScalaBinVersion(v.binVersion, scala2) + scala2.toList ++ List(binVersion) + } + .distinct + val platforms: List[Platform] = - projects.flatMap(p => p.platform.flatMap(_.name)).distinct.map(platformId => Platform(platformId)) + projects.flatMap(p => p.platform.flatMap(_.name)).distinct.map(Platform.apply) + val combined: List[PlatformScalaVersion] = scalas.flatMap(s => platforms.map(p => PlatformScalaVersion(p, s))) - List(List(Common), scalas, platforms, combined).flatten.flatMap(t => List(t, Main(t), Test(t))) + val base = List( + List(Common), + List(Main(Common)), + scalas, + scalas.map(Main.apply), + platforms, + platforms.map(Main.apply), + combined, + combined.map(Main.apply), + // test + List(Test(Common)), + scalas.map(Test.apply), + platforms.map(Test.apply), + combined.map(Test.apply) + ) + base.flatten } - def crossTemplates(crossProjects: Iterable[model.Project]): List[TemplateDef] = { - val allCross = SortedSet.empty[model.CrossId] ++ crossProjects.flatMap(_.cross.value.keys) - - val crossSetups: List[CrossSetup] = - crossProjects - .flatMap { p => - if (p.cross.value.size < 2) None - else Some(CrossSetup(SortedSet.empty[model.CrossId] ++ p.cross.value.keys, parents = Nil, all = allCross)) + def crossTemplates( + crossProjects0: Map[model.ProjectName, ProjectKeepExploded], + ignoreWhenInferringTemplates: model.ProjectName => Boolean + ): List[TemplateDef] = { + val crossGroups: List[SortedSet[model.CrossId]] = + crossProjects0 + .collect { + case (crossName, p) if !ignoreWhenInferringTemplates(crossName) && p.exploded.cross.value.size > 1 => + SortedSet.empty[model.CrossId] ++ p.exploded.cross.value.keys } .toList .distinct - val withParents = crossSetups.map { cs => - val parents = crossSetups.collect { - case maybeParent if maybeParent.crossIds.forall(cs.crossIds) && maybeParent.crossIds != cs.crossIds => maybeParent + val crossGroupsWithParentGroups: Map[SortedSet[model.CrossId], List[SortedSet[model.CrossId]]] = + crossGroups.map { crossGroup => + val parentGroups = crossGroups.collect { + case maybeParent if maybeParent.size < crossGroup.size && maybeParent.forall(crossGroup) => maybeParent + } + (crossGroup, parentGroups) + }.toMap + + val crossSetups: Map[SortedSet[model.CrossId], TemplateDef] = { + implicit val x: Ordering[SortedSet[model.CrossId]] = Ordering.by(_.mkString("")) + val allCross = SortedSet.empty[model.CrossId] ++ crossGroups.flatten + + rewriteDependentData(crossGroupsWithParentGroups).eager[TemplateDef] { case (crossGroup, parentGroups, eval) => + val parents = parentGroups.map(eval.apply) + CrossSetup(crossGroup, parents.map(_.forceGet), all = allCross) } - cs.copy(parents = parents) } - withParents.flatMap(t => List(t, Main(t), Test(t))) + val sorted: List[TemplateDef] = + crossSetups.values.toList.sortWith { case (one, two) => + def inherits(current: TemplateDef, maybeParent: model.TemplateId): Boolean = + current.templateId == maybeParent || current.parents.exists(parent => inherits(parent, maybeParent)) + + val oneInherits = inherits(one, two.templateId) + val twoInherits = inherits(two, one.templateId) + if (oneInherits) false + else if (twoInherits) true + else if (one.parents.length < two.parents.length) true + else if (one.parents.length > two.parents.length) false + else one.templateId.value.compareTo(two.templateId.value) < 0 + } + + sorted ++ sorted.map(Main.apply) ++ sorted.map(Test.apply) } case object Common extends TemplateDef { @@ -114,20 +174,30 @@ object Templates { } case class Platform(platformName: model.PlatformId) extends TemplateDef { - override def parents = List(Common) + override def parents: List[TemplateDef] = List.empty override def name = platformName.value override def include(p: model.Project): Boolean = parents.forall(_.include(p)) && p.cross.isEmpty && p.platform.exists(_.name.contains(platformName)) } - case class ScalaVersion(binVersion: String) extends TemplateDef { + sealed trait ScalaTemplate extends TemplateDef + + case object Scala2 extends ScalaTemplate { + override def name = s"scala-2" + override def parents: List[TemplateDef] = List.empty + override def include(p: model.Project): Boolean = + parents.forall(_.include(p)) && p.cross.isEmpty && p.scala.flatMap(_.version).exists(_.epoch == '2') + } + + case class ScalaBinVersion(binVersion: String, scala2: Option[Scala2.type]) extends ScalaTemplate { override def name = s"scala-$binVersion" - override def parents = List(Common) + override def parents: List[TemplateDef] = scala2.toList override def include(p: model.Project): Boolean = parents.forall(_.include(p)) && p.cross.isEmpty && p.scala.flatMap(_.version).exists(_.binVersion == binVersion) } - case class CrossSetup(crossIds: SortedSet[model.CrossId], parents: List[CrossSetup], all: SortedSet[model.CrossId]) extends TemplateDef { + case class CrossSetup(crossIds: SortedSet[model.CrossId], parents: List[TemplateDef], all: SortedSet[model.CrossId]) extends TemplateDef { + override def toString: String = templateId.value override def name: String = { val baseName = if (crossIds == all) "all" @@ -150,7 +220,7 @@ object Templates { crossIds.forall(p.cross.value.keySet) } - case class PlatformScalaVersion(platform: Platform, scalaVersion: ScalaVersion) extends TemplateDef { + case class PlatformScalaVersion(platform: Platform, scalaVersion: ScalaTemplate) extends TemplateDef { override def name = s"${scalaVersion.name}-${platform.name}" override def parents = List(platform, scalaVersion) override def include(p: model.Project): Boolean = parents.forall(_.include(p)) @@ -159,54 +229,121 @@ object Templates { /** Takes an exploded build, infers templates and applies them. also groups cross projects */ - def apply(build0: ExplodedBuild, ignoreWhenInferringTemplates: model.ProjectName => Boolean): model.Build = { - val initial: Map[model.CrossProjectName, ProjectKeepExploded] = - build0.projects.map { case (name, exploded) => (name, ProjectKeepExploded(exploded, exploded)) } - - val templates: SortedMap[TemplateDef, Templates.TemplateKeepExploded] = { - val projects: List[(model.ProjectName, ProjectKeepExploded)] = - initial.toList.collect { case (crossName, p) if !ignoreWhenInferringTemplates(crossName.name) => (crossName.name, p) } - - Templates.inferFromExistingProjects( - TemplateDef.applicableForProjects(projects.map(_._2.exploded)), - projects + def apply(logger: Logger, build0: ExplodedBuild, ignoreWhenInferringTemplates: model.ProjectName => Boolean): model.Build = { + val s1 = + step[model.CrossProjectName]( + logger, + templates = TemplateDef.templateGroupsForProjects(build0.projects, ignoreWhenInferringTemplates), + initialProjects = build0.projects.map { case (crossName, p) => (crossName, ProjectKeepExploded(p, p)) }, + x => ignoreWhenInferringTemplates(x.name) ) - } - - val templated: Map[model.CrossProjectName, ProjectKeepExploded] = - initial.map { case (name, p) => - val pp = Templates.applyTemplatesToProject(templates, p) - (name, pp) - } val groupedCrossProjects: Map[model.ProjectName, ProjectKeepExploded] = - groupCrossProjects(templated) + groupCrossProjects(s1.templatedProjects) - val crossTemplates: SortedMap[TemplateDef, Templates.TemplateKeepExploded] = { - val projects = groupedCrossProjects.collect { case (name, p) if !ignoreWhenInferringTemplates(name) => (name, p) } - Templates.inferFromExistingProjects( - TemplateDef.crossTemplates(projects.map(_._2.exploded)), - projects.toList - ) - } - - val groupedTemplatedCrossProjects: Map[model.ProjectName, ProjectKeepExploded] = - groupedCrossProjects.map { case (name, p) => - val pp = Templates.applyTemplatesToProject(crossTemplates, p) - (name, pp) - } + val s2 = step[model.ProjectName]( + logger, + templates = TemplateDef.crossTemplates(groupedCrossProjects, ignoreWhenInferringTemplates), + initialProjects = groupedCrossProjects, + ignoreWhenInferringTemplates + ) val build = model.Build( constants.$schema, - JsonMap((templates ++ crossTemplates).map { case (templateDef, p) => (templateDef.templateId, p.current) }.filterNot(_._2.isEmpty)), + JsonMap( + (s1.inferredTemplates ++ s2.inferredTemplates) + .collect { case (templateDef, Some(p)) => (templateDef.templateId, p.current) } + .filterNot(_._2.isEmpty) + ), JsonMap(build0.scripts), build0.resolvers, - JsonMap(groupedTemplatedCrossProjects.map { case (n, cp) => (n, cp.current) }) + JsonMap(s2.templatedProjects.map { case (n, cp) => (n, cp.current) }) ) garbageCollectTemplates(inlineTrivialTemplates(build)) } + case class StepResult[ProjectName]( + templatedProjects: Map[ProjectName, ProjectKeepExploded], + inferredTemplates: Map[TemplateDef, Option[Templates.TemplateKeepExploded]] + ) + + def step[ProjectName: Formatter]( + logger: Logger, + // we'll apply these groups of templates in turn + templates: List[TemplateDef], + initialProjects: Map[ProjectName, ProjectKeepExploded], + ignoreWhenInferringTemplates: ProjectName => Boolean + ): StepResult[ProjectName] = { + val templateById = templates.map(x => (x.templateId, x)).toMap + + // keep state here as we go about applying + var templatedProjects: Map[ProjectName, ProjectKeepExploded] = + initialProjects + + val inferredTemplates: mutable.Map[TemplateDef, Option[Templates.TemplateKeepExploded]] = + mutable.Map.empty + + templates.foreach { templateDef => + // filter which projects we use to infer the contents of the template + val projects = templatedProjects.toVector.filter { case (name, pe) => + !ignoreWhenInferringTemplates(name) && + templateDef.include(pe.exploded) + } + + // only infer contents for a template if it is used by more than one project (not counting cross) + val initial: Either[String, Vector[(ProjectName, ProjectKeepExploded)]] = { + val projectNames = projects.map(_._1).distinct + if (projectNames.sizeIs <= 1) Left(s"Too few qualifying project names: $projectNames") + else Right(projects) + } + + val current: Either[String, model.Project] = { + // todo: investigate if correct/necessary + val keepParent = templateDef.allParents.map(_.templateId).toSet + def relevantExtends(p: model.Project) = + p.copy(`extends` = JsonList(p.`extends`.values.filter(keepParent))) + + initial.flatMap { projects => + projects.map(x => relevantExtends(x._2.current)).optReduce(_.intersectDropEmpty(_)).toRight("No common settings") + } + } + + val maybeTemplateAfterParents: Either[String, TemplateKeepExploded] = + current.map { current => + val exploded = current.`extends`.values.foldLeft(current) { case (acc, templateId) => + inferredTemplates(templateById(templateId)) match { + case Some(parent) => acc.union(parent.current) + case None => acc + } + } + val template = TemplateKeepExploded(exploded, current) + applyInheritance(templateDef, inferredTemplates.apply, template) + } + + inferredTemplates(templateDef) = maybeTemplateAfterParents.toOption + + maybeTemplateAfterParents match { + case Right(template) => + val appliedTo = List.newBuilder[ProjectName] + + templatedProjects = templatedProjects.flatMap { case (name, project0) => + tryApplyTemplate(templateDef, template, project0) match { + case Some(project) => + appliedTo += name + Map(name -> project) + case None => Map(name -> project0) + } + } + val ps = appliedTo.result() + logger.withContext("templateId", templateDef.templateId).withContext(ps).info(s"applied to") + + case Left(err) => logger.withContext("templateId", templateDef.templateId).info(err) + } + } + StepResult(templatedProjects, inferredTemplates.toMap) + } + /** Takes an exploded build, reapplies existing templates */ def reapply(build0: ExplodedBuild, unexplodedTemplates: JsonMap[model.TemplateId, model.Project]): model.Build = { @@ -323,75 +460,26 @@ object Templates { ) } - def inferFromExistingProjects( - applicableTemplateDefs: List[TemplateDef], - projects: List[(model.ProjectName, ProjectKeepExploded)] - ): SortedMap[TemplateDef, TemplateKeepExploded] = { - val templateDefsWithProjects: Map[TemplateDef, List[(model.ProjectName, ProjectKeepExploded)]] = - applicableTemplateDefs.map { templateDef => - val projectsForTemplate = projects.collect { - case (name, pe @ ProjectKeepExploded(exploded, _)) if templateDef.include(exploded) => (name, pe) - } - (templateDef, projectsForTemplate) - }.toMap - - val maybeTemplates: SortedMap[TemplateDef, Lazy[Option[TemplateKeepExploded]]] = - rewriteDependentData(templateDefsWithProjects).apply[Option[TemplateKeepExploded]] { - case (_, projects, _) if projects.map(_._1).distinct.sizeIs < 2 => None - case (templateDef, projects, eval) => - // check what all the picked projects have in common - val maybeInitialTemplate: Option[TemplateKeepExploded] = { - val current = projects.map(_._2.current).optReduce(_.intersectDropEmpty(_)) - val exploded = projects.map(_._2.exploded).optReduce(_.intersectDropEmpty(_)) - exploded.zip(current).map { case (exploded, current) => TemplateKeepExploded(exploded, current) } - } - - val templateAfterParents: Option[TemplateKeepExploded] = - maybeInitialTemplate - .map(initialTemplate => applyTemplatesToTemplate(templateDef.allParents, eval.apply, initialTemplate)) - - templateAfterParents - } - - maybeTemplates.flatMap { case (templateDef, lazyP) => lazyP.forceGet.map(p => (templateDef, p)) } - } - - def applyTemplatesToProject(templates: Map[TemplateDef, TemplateKeepExploded], project: ProjectKeepExploded): ProjectKeepExploded = { - def go(project: ProjectKeepExploded, templateDef: TemplateDef): ProjectKeepExploded = - if (project.current.`extends`.values.contains(templateDef.templateId)) project - else { - val projectAppliedTemplateParents = templateDef.allParents.foldLeft(project)(go) - - templates.get(templateDef) match { - case Some(templateProject) => tryApplyTemplate(templateDef.templateId, templateProject, projectAppliedTemplateParents) - case None => projectAppliedTemplateParents - } - } - - templates.keys.foldLeft(project)(go) - } - /* templates can extend templates*/ - def applyTemplatesToTemplate( - templatesDefs: List[TemplateDef], - getTemplate: TemplateDef => Lazy[Option[TemplateKeepExploded]], + def applyInheritance( + templateDef: TemplateDef, + getTemplate: TemplateDef => Option[TemplateKeepExploded], project: TemplateKeepExploded ): TemplateKeepExploded = { - def go(project: TemplateKeepExploded, templateDef: TemplateDef): TemplateKeepExploded = - if (project.current.`extends`.values.contains(templateDef.templateId)) project + def go(acc: TemplateKeepExploded, parent: TemplateDef): TemplateKeepExploded = + if (acc.current.`extends`.values.contains(parent.templateId)) acc else { - val projectAppliedTemplateParents = templateDef.allParents.foldLeft(project)(go) + val rec = parent.allParents.foldLeft(acc)(go) - getTemplate(templateDef).forceGet match { - case Some(templateProject) => tryApplyTemplate(templateDef.templateId, templateProject, projectAppliedTemplateParents.toProject).toTemplate - case None => projectAppliedTemplateParents - } + getTemplate(parent) + .flatMap(templateProject => tryApplyTemplate(parent, templateProject, rec.toProject)) + .fold(rec)(_.toTemplate) } - templatesDefs.foldLeft(project)(go) + templateDef.allParents.foldLeft(project)(go) } - def tryApplyTemplate(templateId: model.TemplateId, templateProject: TemplateKeepExploded, project: ProjectKeepExploded): ProjectKeepExploded = { + def tryApplyTemplate(template: TemplateDef, templateProject: TemplateKeepExploded, project: ProjectKeepExploded): Option[ProjectKeepExploded] = { val shortened = project.current.removeAll(templateProject.exploded) val isShortened = shortened != project.current @@ -407,10 +495,12 @@ object Templates { templateProject.exploded.cross.value.keys.forall(project.exploded.cross.value.keySet) if (isShortened && doesntAddNew && doesntHaveIncompatiblePrimitives && sameCrossVersions) { - project.copy( - current = shortened.withTemplate(templateId), - exploded = project.exploded.withTemplate(templateId) + Some( + project.copy( + current = shortened.withTemplate(template.templateId), + exploded = project.exploded.withTemplate(template.templateId) + ) ) - } else project + } else None } } diff --git a/bleep/src/test/resources/foo.json b/bleep/src/test/resources/foo.json new file mode 100644 index 000000000..e20a9576a --- /dev/null +++ b/bleep/src/test/resources/foo.json @@ -0,0 +1,30 @@ +{ + "bleep-core@jvm212": { + "sbt-scope": "main", + "scala": { + "version": "2.12.15" + }, + "source-layout": "sbt-matrix" + }, + "bleep-core@jvm213": { + "sbt-scope": "main", + "scala": { + "version": "2.13.8" + }, + "source-layout": "sbt-matrix" + }, + "bleep-tasks@jvm212": { + "sbt-scope": "main", + "scala": { + "version": "2.12.15" + }, + "source-layout": "sbt-matrix" + }, + "bleep-test": { + "isTestProject": true, + "scala": { + "version": "2.13.8" + }, + "source-layout": "sbt-matrix" + } +} \ No newline at end of file diff --git a/bleep/src/test/scala/bleep/IntegrationSnapshotTests.scala b/bleep/src/test/scala/bleep/IntegrationSnapshotTests.scala index b71b6460b..1e2467d71 100644 --- a/bleep/src/test/scala/bleep/IntegrationSnapshotTests.scala +++ b/bleep/src/test/scala/bleep/IntegrationSnapshotTests.scala @@ -20,7 +20,7 @@ class IntegrationSnapshotTests extends SnapshotTest { val inFolder = Paths.get("snapshot-tests-in").toAbsolutePath val resolver: CoursierResolver = { val sbtReleases = model.Repository.Ivy(None, URI.create(Repositories.sbtPlugin("releases").pattern.chunks.head.string)) - val cachePath = if (isCi) CoursierPaths.cacheDirectory().toPath / "sneaky-bleep-cache" else UserPaths.fromAppDirs.cacheDir + val cachePath = if (enforceUpToDate) CoursierPaths.cacheDirectory().toPath / "sneaky-bleep-cache" else UserPaths.fromAppDirs.cacheDir CoursierResolver(List(sbtReleases), logger, downloadSources = false, cacheIn = Some(cachePath), Authentications.empty) } diff --git a/bleep/src/test/scala/bleep/TemplateTest.scala b/bleep/src/test/scala/bleep/TemplateTest.scala new file mode 100644 index 000000000..992e46a6f --- /dev/null +++ b/bleep/src/test/scala/bleep/TemplateTest.scala @@ -0,0 +1,143 @@ +package bleep + +import bleep.internal.Templates +import bleep.internal.Templates.TemplateDef +import bleep.testing.SnapshotTest +import io.circe.Decoder +import io.circe.syntax.EncoderOps +import org.scalactic.{source, Prettifier} +import org.scalatest.Assertion + +import java.nio.file.{Files, Path, Paths} +import java.time.Instant + +class TemplateTest extends SnapshotTest { + override val outFolder = Paths.get("snapshot-tests").resolve("templates").toAbsolutePath + val scala = model.Scala(Some(Versions.Scala213), Options.empty, None, JsonSet.empty) + val a = noCross("a") + val aTest = noCross("aTest") + val b = noCross("b") + val bTest = noCross("bTest") + val p: model.Project = model.Project.empty + val fooOpt: Options = Options(Set(Options.Opt.Flag("foo"))) + + test("should extract common template") { + val projects = Map( + a -> p.copy(scala = Some(scala)), + b -> p.copy(scala = Some(scala.copy(options = fooOpt))) + ) + + val build = run(projects, "common_template.json") + requireBuildHasTemplate(build, TemplateDef.Common) + requireProjectsHaveTemplate(build, TemplateDef.Common, a.name, b.name) + } + + test("should extract common template and a test template") { + val scala = model.Scala(Some(Versions.Scala213), Options.empty, None, JsonSet.empty) + val projects = Map( + a -> p.copy(scala = Some(scala)), + aTest -> p.copy(scala = Some(scala.copy(options = fooOpt)), isTestProject = Some(true), dependsOn = JsonSet(a.name)), + bTest -> p.copy(scala = Some(scala.copy(options = fooOpt)), isTestProject = Some(true), dependsOn = JsonSet(a.name)) + ) + + val build = run(projects, "common_test_template.json") + val commonTest = TemplateDef.Test(TemplateDef.Common) + requireBuildHasTemplate(build, commonTest) + requireTemplateHasParent(build, childTemplate = commonTest, parentTemplate = TemplateDef.Common) + requireProjectsHaveTemplate(build, commonTest, aTest.name, bTest.name) + } + + test("should heed ignoreWhenInferringTemplates") { + val scala = model.Scala(Some(Versions.Scala213), Options.empty, None, JsonSet.empty) + val projects = Map( + a -> p.copy(scala = Some(scala)), + b -> p.copy(dependsOn = JsonSet(a.name)), + aTest -> p.copy(scala = Some(scala.copy(options = fooOpt)), isTestProject = Some(true), dependsOn = JsonSet(a.name)) + ) + + val build = run(projects, "template_ignore_b.json", ignoreWhenInferringTemplates = Set(b.name)) + requireBuildHasProject(build, b.name) + requireBuildHasTemplate(build, TemplateDef.Common) + requireProjectsHaveTemplate(build, TemplateDef.Common, aTest.name, bTest.name) + } + + test("foo") { + val path = Path.of(getClass.getResource("/foo.json").toURI) + val content = Files.readString(path) + + implicit val foo: Decoder[model.Project] = + model.Project.decodes(model.TemplateId.decoder(Nil), Decoder[String].map(model.ProjectName.apply)) + + val Right(projects) = io.circe.parser.decode[Map[model.CrossProjectName, model.Project]](content) + val build = run(projects, "foo.json", ignoreWhenInferringTemplates = Set(b.name)) +// println(build) +// requireBuildHasProject(build, b.name) +// requireBuildHasTemplate(build, TemplateDef.Common) +// requireProjectsHaveTemplate(build, TemplateDef.Common, aTest.name, bTest.name) + } + + def run( + projects: Map[model.CrossProjectName, model.Project], + testName: String, + ignoreWhenInferringTemplates: Set[model.ProjectName] = Set.empty + ): model.Build = { + val pre = ExplodedBuild(Map.empty, Map.empty, JsonList.empty, projects, Map.empty) + val logger = bleep.logging.stdout(LogPatterns.interface(Instant.now, None, noColor = false)).withContext(testName).untyped + val build = Templates(logger, pre, ignoreWhenInferringTemplates) + writeAndCompareEarly(outFolder.resolve(testName), Map(outFolder.resolve(testName) -> build.asJson.foldWith(internal.ShortenAndSortJson).spaces2)) + + // complain if we have done illegal rewrites during templating + val post = ExplodedBuild.of(build).dropTemplates + ExplodedBuild.diffProjects(Defaults.add(pre), post) match { + case empty if empty.isEmpty => () + case diffs => + diffs.foreach { case (projectName, msg) => System.err.println(s"$projectName: $msg") } + fail("Project templating did illegal rewrites. ") + } + + build + } + + def requireProjectsHaveTemplate( + build: model.Build, + templateId: TemplateDef, + firstProject: model.ProjectName, + restProjects: model.ProjectName* + )(implicit prettifier: Prettifier, pos: source.Position): Assertion = { + val ps = build.projects.value.filter { case (k, _) => firstProject == k || restProjects.contains(k) } + assert( + ps.values.forall(_.`extends`.values.contains(templateId.templateId)), + ps.map { case (k, v) => s"$k:${v.`extends`.values.mkString(", ")}" }.mkString("\n") + ) + } + + def requireTemplateHasParent( + build: model.Build, + childTemplate: TemplateDef, + parentTemplate: TemplateDef + )(implicit prettifier: Prettifier, pos: source.Position): Assertion = { + val child = build.templates.value(childTemplate.templateId) + assert( + child.`extends`.values.contains(parentTemplate.templateId), + child.`extends`.values.mkString(", ") + ) + } + + def requireBuildHasTemplate(build: model.Build, templateId: TemplateDef)(implicit prettifier: Prettifier, pos: source.Position): model.Project = { + assert( + build.templates.value.contains(templateId.templateId), + build.templates.value.keySet.mkString(", ") + ) + build.templates.value(templateId.templateId) + } + def requireBuildHasProject(build: model.Build, name: model.ProjectName)(implicit prettifier: Prettifier, pos: source.Position): model.Project = { + assert( + build.projects.value.contains(name), + build.projects.value.keySet.mkString(", ") + ) + build.projects.value(name) + } + + def noCross(str: String): model.CrossProjectName = + model.CrossProjectName(model.ProjectName(str), None) +} diff --git a/snapshot-tests/doobie/bleep.json b/snapshot-tests/doobie/bleep.json index 2efda8848..1c35cb5f6 100644 --- a/snapshot-tests/doobie/bleep.json +++ b/snapshot-tests/doobie/bleep.json @@ -8,7 +8,10 @@ "org.openjdk.jmh:jmh-generator-reflection:1.32" ], "dependsOn" : "postgres", - "extends" : "template-cross-jvm-212-213-main", + "extends" : [ + "template-common-main", + "template-cross-all" + ], "folder" : "./../../snapshot-tests-in/doobie/modules/bench", "scala" : { "options" : "-Xfatal-warnings" @@ -30,7 +33,10 @@ }, "dependencies" : "org.tpolecat::typename:1.0.0", "dependsOn" : "free", - "extends" : "template-cross-jvm-212-213-main", + "extends" : [ + "template-common-main", + "template-cross-all" + ], "folder" : "./../../snapshot-tests-in/doobie/modules/core", "scala" : { "options" : [ @@ -46,7 +52,10 @@ "org.typelevel::scalacheck-effect-munit:1.0.3" ], "dependsOn" : "core", - "extends" : "template-cross-all-test", + "extends" : [ + "template-common-test", + "template-cross-all" + ], "folder" : "./../../snapshot-tests-in/doobie/modules/core", "scala" : { "options" : "-Yno-predef" @@ -60,7 +69,10 @@ "scalatest", "specs2" ], - "extends" : "template-cross-jvm-212-213-main", + "extends" : [ + "template-common-main", + "template-cross-all" + ], "folder" : "./../../snapshot-tests-in/doobie/modules/example", "scala" : { "options" : "-Xfatal-warnings" @@ -72,7 +84,10 @@ "org.typelevel::scalacheck-effect-munit:1.0.3" ], "dependsOn" : "example", - "extends" : "template-cross-jvm-212-213-test", + "extends" : [ + "template-common-test", + "template-cross-jvm-212-213" + ], "folder" : "./../../snapshot-tests-in/doobie/modules/example" }, "free" : { @@ -91,7 +106,10 @@ "org.typelevel::cats-effect:3.3.5", "org.typelevel::cats-free:2.7.0" ], - "extends" : "template-cross-jvm-212-213-main", + "extends" : [ + "template-common-main", + "template-cross-all" + ], "folder" : "./../../snapshot-tests-in/doobie/modules/free", "scala" : { "options" : "-Yno-predef" @@ -100,7 +118,10 @@ "h2" : { "dependencies" : "com.h2database:h2:1.4.200", "dependsOn" : "core", - "extends" : "template-cross-jvm-212-213-main", + "extends" : [ + "template-common-main", + "template-cross-all" + ], "folder" : "./../../snapshot-tests-in/doobie/modules/h2" }, "h2-circe" : { @@ -109,7 +130,10 @@ "io.circe::circe-parser:0.14.1" ], "dependsOn" : "h2", - "extends" : "template-cross-jvm-212-213-main", + "extends" : [ + "template-common-main", + "template-cross-all" + ], "folder" : "./../../snapshot-tests-in/doobie/modules/h2-circe", "scala" : { "options" : "-Xfatal-warnings" @@ -121,7 +145,10 @@ "org.typelevel::scalacheck-effect-munit:1.0.3" ], "dependsOn" : "h2-circe", - "extends" : "template-cross-all-test", + "extends" : [ + "template-common-test", + "template-cross-all" + ], "folder" : "./../../snapshot-tests-in/doobie/modules/h2-circe" }, "h2-test" : { @@ -129,7 +156,10 @@ "core-test", "h2" ], - "extends" : "template-cross-all-test", + "extends" : [ + "template-common-test", + "template-cross-all" + ], "folder" : "./../../snapshot-tests-in/doobie/modules/h2" }, "hikari" : { @@ -143,7 +173,10 @@ "org.slf4j:slf4j-api:1.7.36" ], "dependsOn" : "core", - "extends" : "template-cross-jvm-212-213-main", + "extends" : [ + "template-common-main", + "template-cross-all" + ], "folder" : "./../../snapshot-tests-in/doobie/modules/hikari", "scala" : { "options" : "-Xfatal-warnings" @@ -160,13 +193,19 @@ "hikari", "postgres" ], - "extends" : "template-cross-all-test", + "extends" : [ + "template-common-test", + "template-cross-all" + ], "folder" : "./../../snapshot-tests-in/doobie/modules/hikari" }, "munit" : { "dependencies" : "org.scalameta::munit:0.7.29", "dependsOn" : "core", - "extends" : "template-cross-jvm-212-213-main", + "extends" : [ + "template-common-main", + "template-cross-all" + ], "folder" : "./../../snapshot-tests-in/doobie/modules/munit", "scala" : { "options" : "-Xfatal-warnings" @@ -179,7 +218,10 @@ "org.typelevel::scalacheck-effect-munit:1.0.3" ], "dependsOn" : "munit", - "extends" : "template-cross-all-test", + "extends" : [ + "template-common-test", + "template-cross-all" + ], "folder" : "./../../snapshot-tests-in/doobie/modules/munit" }, "postgres" : { @@ -192,7 +234,10 @@ "org.postgresql:postgresql:42.3.2" ], "dependsOn" : "core", - "extends" : "template-cross-jvm-212-213-main", + "extends" : [ + "template-common-main", + "template-cross-all" + ], "folder" : "./../../snapshot-tests-in/doobie/modules/postgres" }, "postgres-circe" : { @@ -201,7 +246,10 @@ "io.circe::circe-parser:0.14.1" ], "dependsOn" : "postgres", - "extends" : "template-cross-jvm-212-213-main", + "extends" : [ + "template-common-main", + "template-cross-all" + ], "folder" : "./../../snapshot-tests-in/doobie/modules/postgres-circe", "scala" : { "options" : "-Xfatal-warnings" @@ -213,7 +261,10 @@ "org.typelevel::scalacheck-effect-munit:1.0.3" ], "dependsOn" : "postgres-circe", - "extends" : "template-cross-all-test", + "extends" : [ + "template-common-test", + "template-cross-all" + ], "folder" : "./../../snapshot-tests-in/doobie/modules/postgres-circe" }, "postgres-test" : { @@ -225,13 +276,19 @@ "core-test", "postgres" ], - "extends" : "template-cross-all-test", + "extends" : [ + "template-common-test", + "template-cross-all" + ], "folder" : "./../../snapshot-tests-in/doobie/modules/postgres" }, "refined" : { "dependencies" : "eu.timepit::refined:0.9.28", "dependsOn" : "core", - "extends" : "template-cross-jvm-212-213-main", + "extends" : [ + "template-common-main", + "template-cross-all" + ], "folder" : "./../../snapshot-tests-in/doobie/modules/refined", "scala" : { "options" : "-Xfatal-warnings" @@ -244,13 +301,19 @@ "org.typelevel::scalacheck-effect-munit:1.0.3" ], "dependsOn" : "refined", - "extends" : "template-cross-all-test", + "extends" : [ + "template-common-test", + "template-cross-all" + ], "folder" : "./../../snapshot-tests-in/doobie/modules/refined" }, "scalatest" : { "dependencies" : "org.scalatest::scalatest:3.2.10", "dependsOn" : "core", - "extends" : "template-cross-jvm-212-213-main", + "extends" : [ + "template-common-main", + "template-cross-all" + ], "folder" : "./../../snapshot-tests-in/doobie/modules/scalatest", "scala" : { "options" : "-Xfatal-warnings" @@ -263,7 +326,10 @@ "org.typelevel::scalacheck-effect-munit:1.0.3" ], "dependsOn" : "scalatest", - "extends" : "template-cross-all-test", + "extends" : [ + "template-common-test", + "template-cross-all" + ], "folder" : "./../../snapshot-tests-in/doobie/modules/scalatest" }, "specs2" : { @@ -276,7 +342,10 @@ } }, "dependsOn" : "core", - "extends" : "template-cross-jvm-212-213-main", + "extends" : [ + "template-common-main", + "template-cross-all" + ], "folder" : "./../../snapshot-tests-in/doobie/modules/specs2", "scala" : { "options" : "-Xfatal-warnings" @@ -301,7 +370,10 @@ "h2", "specs2" ], - "extends" : "template-cross-all-test", + "extends" : [ + "template-common-test", + "template-cross-all" + ], "folder" : "./../../snapshot-tests-in/doobie/modules/specs2" } }, @@ -331,70 +403,36 @@ "isTestProject" : true, "sbt-scope" : "test" }, - "template-cross-all-test" : { + "template-cross-all" : { "cross" : { "jvm3" : { - "extends" : [ - "template-common-test", - "template-scala-3" - ] + "extends" : "template-scala-3" } }, - "extends" : "template-cross-jvm-212-213-test" + "extends" : "template-cross-jvm-212-213" }, - "template-cross-jvm-212-213-main" : { + "template-cross-jvm-212-213" : { "cross" : { "jvm212" : { - "extends" : [ - "template-common-main", - "template-scala-2.12" - ] - }, - "jvm213" : { - "extends" : [ - "template-common-main", - "template-scala-2.13" - ] - }, - "jvm3" : { - "extends" : [ - "template-common-main", - "template-scala-3" - ] - } - } - }, - "template-cross-jvm-212-213-test" : { - "cross" : { - "jvm212" : { - "extends" : [ - "template-common-test", - "template-scala-2.12" - ] + "extends" : "template-scala-2.12" }, "jvm213" : { - "extends" : [ - "template-common-test", - "template-scala-2.13" - ] + "extends" : "template-scala-2.13" } } }, - "template-scala-2.12" : { - "extends" : "template-common", + "template-scala-2" : { "scala" : { "compilerPlugins" : "org.typelevel:::kind-projector:0.13.2", "options" : [ "-Xcheckinit", "-Xlint:adapted-args", - "-Xlint:by-name-right-associative", "-Xlint:constant", "-Xlint:delayedinit-select", "-Xlint:doc-detached", "-Xlint:inaccessible", "-Xlint:infer-any", "-Xlint:missing-interpolator", - "-Xlint:nullary-override", "-Xlint:nullary-unit", "-Xlint:option-implicit", "-Xlint:package-object-classes", @@ -402,6 +440,17 @@ "-Xlint:private-shadow", "-Xlint:stars-align", "-Xlint:type-parameter-shadow", + "-explaintypes", + "-language:existentials" + ] + } + }, + "template-scala-2.12" : { + "extends" : "template-scala-2", + "scala" : { + "options" : [ + "-Xlint:by-name-right-associative", + "-Xlint:nullary-override", "-Xlint:unsound-match", "-Yno-adapted-args", "-Ypartial-unification", @@ -417,17 +466,14 @@ "-Ywarn-unused:patvars", "-Ywarn-unused:privates", "-Ywarn-value-discard", - "-deprecation", - "-explaintypes", - "-language:existentials" + "-deprecation" ], "version" : "2.12.15" } }, "template-scala-2.13" : { - "extends" : "template-common", + "extends" : "template-scala-2", "scala" : { - "compilerPlugins" : "org.typelevel:::kind-projector:0.13.2", "options" : [ "-Vimplicits", "-Vtype-diffs", @@ -443,32 +489,14 @@ "-Wunused:patvars", "-Wunused:privates", "-Wvalue-discard", - "-Xcheckinit", "-Xlint:-byname-implicit", - "-Xlint:adapted-args", - "-Xlint:constant", - "-Xlint:delayedinit-select", "-Xlint:deprecation", - "-Xlint:doc-detached", - "-Xlint:inaccessible", - "-Xlint:infer-any", - "-Xlint:missing-interpolator", - "-Xlint:nullary-unit", - "-Xlint:option-implicit", - "-Xlint:package-object-classes", - "-Xlint:poly-implicit-overload", - "-Xlint:private-shadow", - "-Xlint:stars-align", - "-Xlint:strict-unsealed-patmat", - "-Xlint:type-parameter-shadow", - "-explaintypes", - "-language:existentials" + "-Xlint:strict-unsealed-patmat" ], "version" : "2.13.8" } }, "template-scala-3" : { - "extends" : "template-common", "scala" : { "options" : [ "-Ykind-projector", diff --git a/snapshot-tests/http4s/bleep.json b/snapshot-tests/http4s/bleep.json index 64d34d3a1..a91b3ce02 100644 --- a/snapshot-tests/http4s/bleep.json +++ b/snapshot-tests/http4s/bleep.json @@ -10,15 +10,33 @@ "org.reactivestreams:reactive-streams:1.0.3" ], "dependsOn" : "client", - "extends" : "template-cross-jvm-all-main", + "extends" : [ + "template-common-main", + "template-jvm", + "template-cross-jvm-all-main" + ], "folder" : "./../../snapshot-tests-in/http4s/async-http-client" }, "async-http-client-test" : { + "cross" : { + "jvm213" : { + "extends" : [ + "template-scala-2", + "template-scala-2-test" + ] + }, + "jvm3" : { + "extends" : "template-scala-3-test" + } + }, "dependsOn" : [ "async-http-client", "client-test" ], - "extends" : "template-cross-jvm-all-test", + "extends" : [ + "template-jvm", + "template-common-test" + ], "folder" : "./../../snapshot-tests-in/http4s/async-http-client" }, "bench" : { @@ -32,7 +50,11 @@ "circe", "ember-core" ], - "extends" : "template-cross-jvm-all-main", + "extends" : [ + "template-common-main", + "template-jvm", + "template-cross-jvm-all-main" + ], "folder" : "./../../snapshot-tests-in/http4s/bench" }, "blaze-client" : { @@ -40,30 +62,66 @@ "blaze-core", "client" ], - "extends" : "template-cross-jvm-all-main", + "extends" : [ + "template-common-main", + "template-jvm", + "template-cross-jvm-all-main" + ], "folder" : "./../../snapshot-tests-in/http4s/blaze-client" }, "blaze-client-test" : { + "cross" : { + "jvm213" : { + "extends" : [ + "template-scala-2", + "template-scala-2-test" + ] + }, + "jvm3" : { + "extends" : "template-scala-3-test" + } + }, "dependsOn" : [ "blaze-client", "blaze-core-test", "client-test" ], - "extends" : "template-cross-jvm-all-test", + "extends" : [ + "template-jvm", + "template-common-test" + ], "folder" : "./../../snapshot-tests-in/http4s/blaze-client" }, "blaze-core" : { "dependencies" : "org.http4s::blaze-http:0.15.3", "dependsOn" : "core", - "extends" : "template-cross-jvm-all-main", + "extends" : [ + "template-common-main", + "template-jvm", + "template-cross-jvm-all-main" + ], "folder" : "./../../snapshot-tests-in/http4s/blaze-core" }, "blaze-core-test" : { + "cross" : { + "jvm213" : { + "extends" : [ + "template-scala-2", + "template-scala-2-test" + ] + }, + "jvm3" : { + "extends" : "template-scala-3-test" + } + }, "dependsOn" : [ "blaze-core", "testing-test" ], - "extends" : "template-cross-jvm-all-test", + "extends" : [ + "template-jvm", + "template-common-test" + ], "folder" : "./../../snapshot-tests-in/http4s/blaze-core" }, "blaze-server" : { @@ -71,24 +129,44 @@ "blaze-core", "server" ], - "extends" : "template-cross-jvm-all-main", + "extends" : [ + "template-common-main", + "template-jvm", + "template-cross-jvm-all-main" + ], "folder" : "./../../snapshot-tests-in/http4s/blaze-server" }, "blaze-server-test" : { + "cross" : { + "jvm213" : { + "extends" : [ + "template-scala-2", + "template-scala-2-test" + ] + }, + "jvm3" : { + "extends" : "template-scala-3-test" + } + }, "dependsOn" : [ "blaze-core-test", "blaze-server", "server-test" ], - "extends" : "template-cross-jvm-all-test", + "extends" : [ + "template-jvm", + "template-common-test" + ], "folder" : "./../../snapshot-tests-in/http4s/blaze-server" }, "boopickle" : { "dependencies" : "io.suzaku::boopickle:1.4.0", "dependsOn" : "core", "extends" : [ - "template-cross-jvm-all-main", - "template-cross-js-all-main" + "template-common-main", + "template-cross-all", + "template-cross-js-all-main", + "template-cross-jvm-all-main" ], "folder" : "./../../snapshot-tests-in/http4s/boopickle", "source-layout" : "cross-pure" @@ -99,7 +177,8 @@ "testing-test" ], "extends" : [ - "template-cross-jvm-all-test", + "template-common-test", + "template-cross-all", "template-cross-js-all-test" ], "folder" : "./../../snapshot-tests-in/http4s/boopickle", @@ -112,8 +191,10 @@ ], "dependsOn" : "jawn", "extends" : [ - "template-cross-jvm-all-main", - "template-cross-js-all-main" + "template-common-main", + "template-cross-all", + "template-cross-js-all-main", + "template-cross-jvm-all-main" ], "folder" : "./../../snapshot-tests-in/http4s/circe", "source-layout" : "cross-pure" @@ -125,7 +206,8 @@ "jawn-test" ], "extends" : [ - "template-cross-jvm-all-test", + "template-common-test", + "template-cross-all", "template-cross-js-all-test" ], "folder" : "./../../snapshot-tests-in/http4s/circe", @@ -134,8 +216,10 @@ "client" : { "dependsOn" : "core", "extends" : [ - "template-cross-jvm-all-main", - "template-cross-js-all-main" + "template-common-main", + "template-cross-all", + "template-cross-js-all-main", + "template-cross-jvm-all-main" ], "folder" : "./../../snapshot-tests-in/http4s/client", "source-layout" : "cross-full" @@ -168,7 +252,8 @@ "testing-test" ], "extends" : [ - "template-cross-jvm-all-test", + "template-common-test", + "template-cross-all", "template-cross-js-all-test" ], "folder" : "./../../snapshot-tests-in/http4s/client", @@ -223,8 +308,10 @@ "org.typelevel::vault:3.1.0" ], "extends" : [ - "template-cross-jvm-all-main", - "template-cross-js-all-main" + "template-common-main", + "template-cross-all", + "template-cross-js-all-main", + "template-cross-jvm-all-main" ], "folder" : "./../../snapshot-tests-in/http4s/core", "source-layout" : "cross-full" @@ -235,10 +322,25 @@ "io.dropwizard.metrics:metrics-json:4.2.8" ], "dependsOn" : "core", - "extends" : "template-cross-jvm-all-main", + "extends" : [ + "template-common-main", + "template-jvm", + "template-cross-jvm-all-main" + ], "folder" : "./../../snapshot-tests-in/http4s/dropwizard-metrics" }, "dropwizard-metrics-test" : { + "cross" : { + "jvm213" : { + "extends" : [ + "template-scala-2", + "template-scala-2-test" + ] + }, + "jvm3" : { + "extends" : "template-scala-3-test" + } + }, "dependsOn" : [ "client", "dropwizard-metrics", @@ -246,14 +348,19 @@ "server", "testing-test" ], - "extends" : "template-cross-jvm-all-test", + "extends" : [ + "template-jvm", + "template-common-test" + ], "folder" : "./../../snapshot-tests-in/http4s/dropwizard-metrics" }, "dsl" : { "dependsOn" : "core", "extends" : [ - "template-cross-jvm-all-main", - "template-cross-js-all-main" + "template-common-main", + "template-cross-all", + "template-cross-js-all-main", + "template-cross-jvm-all-main" ], "folder" : "./../../snapshot-tests-in/http4s/dsl", "source-layout" : "cross-pure" @@ -264,7 +371,8 @@ "testing-test" ], "extends" : [ - "template-cross-jvm-all-test", + "template-common-test", + "template-cross-all", "template-cross-js-all-test" ], "folder" : "./../../snapshot-tests-in/http4s/dsl", @@ -291,8 +399,10 @@ "ember-core" ], "extends" : [ - "template-cross-jvm-all-main", - "template-cross-js-all-main" + "template-common-main", + "template-cross-all", + "template-cross-js-all-main", + "template-cross-jvm-all-main" ], "folder" : "./../../snapshot-tests-in/http4s/ember-client", "source-layout" : "cross-full" @@ -304,7 +414,8 @@ "ember-core-test" ], "extends" : [ - "template-cross-jvm-all-test", + "template-common-test", + "template-cross-all", "template-cross-js-all-test" ], "folder" : "./../../snapshot-tests-in/http4s/ember-client", @@ -328,8 +439,10 @@ "dependencies" : "org.typelevel::log4cats-core:2.2.0", "dependsOn" : "core", "extends" : [ - "template-cross-jvm-all-main", - "template-cross-js-all-main" + "template-common-main", + "template-cross-all", + "template-cross-js-all-main", + "template-cross-jvm-all-main" ], "folder" : "./../../snapshot-tests-in/http4s/ember-core", "source-layout" : "cross-full" @@ -341,7 +454,8 @@ "testing-test" ], "extends" : [ - "template-cross-jvm-all-test", + "template-common-test", + "template-cross-all", "template-cross-js-all-test" ], "folder" : "./../../snapshot-tests-in/http4s/ember-core", @@ -367,8 +481,10 @@ "server" ], "extends" : [ - "template-cross-jvm-all-main", - "template-cross-js-all-main" + "template-common-main", + "template-cross-all", + "template-cross-js-all-main", + "template-cross-jvm-all-main" ], "folder" : "./../../snapshot-tests-in/http4s/ember-server", "source-layout" : "cross-full" @@ -395,7 +511,8 @@ "server-test" ], "extends" : [ - "template-cross-jvm-all-test", + "template-common-test", + "template-cross-all", "template-cross-js-all-test" ], "folder" : "./../../snapshot-tests-in/http4s/ember-server", @@ -413,7 +530,11 @@ "scala-xml", "server" ], - "extends" : "template-cross-jvm-all-main", + "extends" : [ + "template-common-main", + "template-jvm", + "template-cross-jvm-all-main" + ], "folder" : "./../../snapshot-tests-in/http4s/examples" }, "examples-blaze" : { @@ -422,7 +543,11 @@ "blaze-server", "examples" ], - "extends" : "template-cross-jvm-all-main", + "extends" : [ + "template-common-main", + "template-jvm", + "template-cross-jvm-all-main" + ], "folder" : "./../../snapshot-tests-in/http4s/examples/blaze", "platform" : { "jvmOptions" : "-Duser.dir=${PROJECT_DIR}" @@ -433,7 +558,11 @@ "blaze-server", "dsl" ], - "extends" : "template-cross-jvm-all-main", + "extends" : [ + "template-common-main", + "template-jvm", + "template-cross-jvm-all-main" + ], "folder" : "./../../snapshot-tests-in/http4s/examples/docker" }, "examples-ember" : { @@ -442,7 +571,11 @@ "ember-server", "examples" ], - "extends" : "template-cross-jvm-all-main", + "extends" : [ + "template-common-main", + "template-jvm", + "template-cross-jvm-all-main" + ], "folder" : "./../../snapshot-tests-in/http4s/examples/ember", "platform" : { "jvmOptions" : "-Duser.dir=${PROJECT_DIR}" @@ -453,7 +586,11 @@ "dsl", "ember-client" ], - "extends" : "template-cross-js-all-main", + "extends" : [ + "template-common-main", + "template-cross-js-all", + "template-cross-js-all-main" + ], "folder" : "./../../snapshot-tests-in/http4s/examples/ember-client-h2" }, "examples-ember-server-h2" : { @@ -461,7 +598,11 @@ "dsl", "ember-server" ], - "extends" : "template-cross-js-all-main", + "extends" : [ + "template-common-main", + "template-cross-js-all", + "template-cross-js-all-main" + ], "folder" : "./../../snapshot-tests-in/http4s/examples/ember-server-h2" }, "examples-jetty" : { @@ -469,7 +610,11 @@ "examples", "jetty-server" ], - "extends" : "template-cross-jvm-all-main", + "extends" : [ + "template-common-main", + "template-jvm", + "template-cross-jvm-all-main" + ], "folder" : "./../../snapshot-tests-in/http4s/examples/jetty", "platform" : { "jvmOptions" : "-Duser.dir=${PROJECT_DIR}" @@ -480,7 +625,11 @@ "examples", "tomcat-server" ], - "extends" : "template-cross-jvm-all-main", + "extends" : [ + "template-common-main", + "template-jvm", + "template-cross-jvm-all-main" + ], "folder" : "./../../snapshot-tests-in/http4s/examples/tomcat", "platform" : { "jvmOptions" : "-Duser.dir=${PROJECT_DIR}" @@ -495,7 +644,11 @@ "examples", "servlet" ], - "extends" : "template-cross-jvm-all-main", + "extends" : [ + "template-common-main", + "template-jvm", + "template-cross-jvm-all-main" + ], "folder" : "./../../snapshot-tests-in/http4s/examples/war", "platform" : { "jvmOptions" : "-Duser.dir=${PROJECT_DIR}" @@ -508,8 +661,10 @@ ], "dependsOn" : "core", "extends" : [ - "template-cross-jvm-all-main", - "template-cross-js-all-main" + "template-common-main", + "template-cross-all", + "template-cross-js-all-main", + "template-cross-jvm-all-main" ], "folder" : "./../../snapshot-tests-in/http4s/jawn", "source-layout" : "cross-pure" @@ -520,7 +675,8 @@ "testing-test" ], "extends" : [ - "template-cross-jvm-all-test", + "template-common-test", + "template-cross-all", "template-cross-js-all-test" ], "folder" : "./../../snapshot-tests-in/http4s/jawn", @@ -533,15 +689,33 @@ "org.eclipse.jetty:jetty-util:9.4.45.v20220203" ], "dependsOn" : "client", - "extends" : "template-cross-jvm-all-main", + "extends" : [ + "template-common-main", + "template-jvm", + "template-cross-jvm-all-main" + ], "folder" : "./../../snapshot-tests-in/http4s/jetty-client" }, "jetty-client-test" : { + "cross" : { + "jvm213" : { + "extends" : [ + "template-scala-2", + "template-scala-2-test" + ] + }, + "jvm3" : { + "extends" : "template-scala-3-test" + } + }, "dependsOn" : [ "client-test", "jetty-client" ], - "extends" : "template-cross-jvm-all-test", + "extends" : [ + "template-jvm", + "template-common-test" + ], "folder" : "./../../snapshot-tests-in/http4s/jetty-client" }, "jetty-server" : { @@ -552,16 +726,34 @@ "org.eclipse.jetty:jetty-util:9.4.45.v20220203" ], "dependsOn" : "servlet", - "extends" : "template-cross-jvm-all-main", + "extends" : [ + "template-common-main", + "template-jvm", + "template-cross-jvm-all-main" + ], "folder" : "./../../snapshot-tests-in/http4s/jetty-server" }, "jetty-server-test" : { + "cross" : { + "jvm213" : { + "extends" : [ + "template-scala-2", + "template-scala-2-test" + ] + }, + "jvm3" : { + "extends" : "template-scala-3-test" + } + }, "dependsOn" : [ "dsl-test", "jetty-server", "servlet-test" ], - "extends" : "template-cross-jvm-all-test", + "extends" : [ + "template-jvm", + "template-common-test" + ], "folder" : "./../../snapshot-tests-in/http4s/jetty-server" }, "laws" : { @@ -578,15 +770,21 @@ ], "dependsOn" : "core", "extends" : [ - "template-cross-jvm-all-main", - "template-cross-js-all-main" + "template-common-main", + "template-cross-all", + "template-cross-js-all-main", + "template-cross-jvm-all-main" ], "folder" : "./../../snapshot-tests-in/http4s/laws", "source-layout" : "cross-pure" }, "node-serverless" : { "dependsOn" : "core", - "extends" : "template-cross-js-all-main", + "extends" : [ + "template-common-main", + "template-cross-js-all", + "template-cross-js-all-main" + ], "folder" : "./../../snapshot-tests-in/http4s/node-serverless" }, "okhttp-client" : { @@ -595,15 +793,33 @@ "com.squareup.okio:okio:2.10.0" ], "dependsOn" : "client", - "extends" : "template-cross-jvm-all-main", + "extends" : [ + "template-common-main", + "template-jvm", + "template-cross-jvm-all-main" + ], "folder" : "./../../snapshot-tests-in/http4s/okhttp-client" }, "okhttp-client-test" : { + "cross" : { + "jvm213" : { + "extends" : [ + "template-scala-2", + "template-scala-2-test" + ] + }, + "jvm3" : { + "extends" : "template-scala-3-test" + } + }, "dependsOn" : [ "client-test", "okhttp-client" ], - "extends" : "template-cross-jvm-all-test", + "extends" : [ + "template-jvm", + "template-common-test" + ], "folder" : "./../../snapshot-tests-in/http4s/okhttp-client" }, "play-json" : { @@ -612,15 +828,33 @@ "module" : "com.typesafe.play::play-json:2.9.2" }, "dependsOn" : "jawn", - "extends" : "template-cross-jvm-all-main", + "extends" : [ + "template-common-main", + "template-jvm", + "template-cross-jvm-all-main" + ], "folder" : "./../../snapshot-tests-in/http4s/play-json" }, "play-json-test" : { + "cross" : { + "jvm213" : { + "extends" : [ + "template-scala-2", + "template-scala-2-test" + ] + }, + "jvm3" : { + "extends" : "template-scala-3-test" + } + }, "dependsOn" : [ "jawn-test", "play-json" ], - "extends" : "template-cross-jvm-all-test", + "extends" : [ + "template-jvm", + "template-common-test" + ], "folder" : "./../../snapshot-tests-in/http4s/play-json" }, "prometheus-metrics" : { @@ -630,10 +864,25 @@ "io.prometheus:simpleclient_hotspot:0.15.0" ], "dependsOn" : "core", - "extends" : "template-cross-jvm-all-main", + "extends" : [ + "template-common-main", + "template-jvm", + "template-cross-jvm-all-main" + ], "folder" : "./../../snapshot-tests-in/http4s/prometheus-metrics" }, "prometheus-metrics-test" : { + "cross" : { + "jvm213" : { + "extends" : [ + "template-scala-2", + "template-scala-2-test" + ] + }, + "jvm3" : { + "extends" : "template-scala-3-test" + } + }, "dependsOn" : [ "client", "dsl", @@ -641,31 +890,60 @@ "server", "testing-test" ], - "extends" : "template-cross-jvm-all-test", + "extends" : [ + "template-jvm", + "template-common-test" + ], "folder" : "./../../snapshot-tests-in/http4s/prometheus-metrics" }, "scala-xml" : { "dependencies" : "org.scala-lang.modules::scala-xml:2.0.1", "dependsOn" : "core", - "extends" : "template-cross-jvm-all-main", + "extends" : [ + "template-common-main", + "template-jvm", + "template-cross-jvm-all-main" + ], "folder" : "./../../snapshot-tests-in/http4s/scala-xml" }, "scala-xml-test" : { + "cross" : { + "jvm213" : { + "extends" : [ + "template-scala-2", + "template-scala-2-test" + ] + }, + "jvm3" : { + "extends" : "template-scala-3-test" + } + }, "dependsOn" : [ "scala-xml", "testing-test" ], - "extends" : "template-cross-jvm-all-test", + "extends" : [ + "template-jvm", + "template-common-test" + ], "folder" : "./../../snapshot-tests-in/http4s/scala-xml" }, "scalafixInternalInput" : { "dependsOn" : "core", - "extends" : "template-cross-jvm-all-main", + "extends" : [ + "template-common-main", + "template-jvm", + "template-cross-jvm-all-main" + ], "folder" : "./../../snapshot-tests-in/http4s/scalafix-internal/input" }, "scalafixInternalOutput" : { "dependsOn" : "core", - "extends" : "template-cross-jvm-all-main", + "extends" : [ + "template-common-main", + "template-jvm", + "template-cross-jvm-all-main" + ], "folder" : "./../../snapshot-tests-in/http4s/scalafix-internal/output" }, "scalafixInternalRules" : { @@ -673,7 +951,8 @@ "extends" : [ "template-common-main", "template-jvm", - "template-scala-2.13-main" + "template-scala-2", + "template-scala-2-main" ], "folder" : "./../../snapshot-tests-in/http4s/scalafix-internal/rules" }, @@ -681,31 +960,52 @@ "dependencies" : "ch.epfl.scala:::scalafix-testkit:0.9.34", "dependsOn" : "scalafixInternalRules", "extends" : [ - "template-common-test", "template-jvm", - "template-scala-2.13-test" + "template-common-test", + "template-scala-2", + "template-scala-2-test" ], "folder" : "./../../snapshot-tests-in/http4s/scalafix-internal/tests" }, "scalatags" : { "dependencies" : "com.lihaoyi::scalatags:0.11.1", "dependsOn" : "core", - "extends" : "template-cross-jvm-all-main", + "extends" : [ + "template-common-main", + "template-jvm", + "template-cross-jvm-all-main" + ], "folder" : "./../../snapshot-tests-in/http4s/scalatags" }, "scalatags-test" : { + "cross" : { + "jvm213" : { + "extends" : [ + "template-scala-2", + "template-scala-2-test" + ] + }, + "jvm3" : { + "extends" : "template-scala-3-test" + } + }, "dependsOn" : [ "scalatags", "testing-test" ], - "extends" : "template-cross-jvm-all-test", + "extends" : [ + "template-jvm", + "template-common-test" + ], "folder" : "./../../snapshot-tests-in/http4s/scalatags" }, "server" : { "dependsOn" : "core", "extends" : [ - "template-cross-jvm-all-main", - "template-cross-js-all-main" + "template-common-main", + "template-cross-all", + "template-cross-js-all-main", + "template-cross-jvm-all-main" ], "folder" : "./../../snapshot-tests-in/http4s/server", "source-layout" : "cross-full" @@ -717,7 +1017,8 @@ "testing-test" ], "extends" : [ - "template-cross-jvm-all-test", + "template-common-test", + "template-cross-all", "template-cross-js-all-test" ], "folder" : "./../../snapshot-tests-in/http4s/server", @@ -729,10 +1030,25 @@ "module" : "javax.servlet:javax.servlet-api:3.1.0" }, "dependsOn" : "server", - "extends" : "template-cross-jvm-all-main", + "extends" : [ + "template-common-main", + "template-jvm", + "template-cross-jvm-all-main" + ], "folder" : "./../../snapshot-tests-in/http4s/servlet" }, "servlet-test" : { + "cross" : { + "jvm213" : { + "extends" : [ + "template-scala-2", + "template-scala-2-test" + ] + }, + "jvm3" : { + "extends" : "template-scala-3-test" + } + }, "dependencies" : [ { "configuration" : "provided", @@ -746,7 +1062,10 @@ "server-test", "servlet" ], - "extends" : "template-cross-jvm-all-test", + "extends" : [ + "template-jvm", + "template-common-test" + ], "folder" : "./../../snapshot-tests-in/http4s/servlet" }, "testing-test" : { @@ -769,7 +1088,8 @@ ], "dependsOn" : "laws", "extends" : [ - "template-cross-jvm-all-test", + "template-common-test", + "template-cross-all", "template-cross-js-all-test" ], "folder" : "./../../snapshot-tests-in/http4s/testing", @@ -778,7 +1098,8 @@ "tests-test" : { "dependsOn" : "testing-test", "extends" : [ - "template-cross-jvm-all-test", + "template-common-test", + "template-cross-all", "template-cross-js-all-test" ], "folder" : "./../../snapshot-tests-in/http4s/tests", @@ -791,15 +1112,33 @@ "org.apache.tomcat:tomcat-util-scan:9.0.58" ], "dependsOn" : "servlet", - "extends" : "template-cross-jvm-all-main", + "extends" : [ + "template-common-main", + "template-jvm", + "template-cross-jvm-all-main" + ], "folder" : "./../../snapshot-tests-in/http4s/tomcat-server" }, "tomcat-server-test" : { + "cross" : { + "jvm213" : { + "extends" : [ + "template-scala-2", + "template-scala-2-test" + ] + }, + "jvm3" : { + "extends" : "template-scala-3-test" + } + }, "dependsOn" : [ "servlet-test", "tomcat-server" ], - "extends" : "template-cross-jvm-all-test", + "extends" : [ + "template-jvm", + "template-common-test" + ], "folder" : "./../../snapshot-tests-in/http4s/tomcat-server" }, "twirl" : { @@ -808,15 +1147,33 @@ "module" : "com.typesafe.play::twirl-api:1.5.1" }, "dependsOn" : "core", - "extends" : "template-cross-jvm-all-main", + "extends" : [ + "template-common-main", + "template-jvm", + "template-cross-jvm-all-main" + ], "folder" : "./../../snapshot-tests-in/http4s/twirl" }, "twirl-test" : { + "cross" : { + "jvm213" : { + "extends" : [ + "template-scala-2", + "template-scala-2-test" + ] + }, + "jvm3" : { + "extends" : "template-scala-3-test" + } + }, "dependsOn" : [ "testing-test", "twirl" ], - "extends" : "template-cross-jvm-all-test", + "extends" : [ + "template-jvm", + "template-common-test" + ], "folder" : "./../../snapshot-tests-in/http4s/twirl" } }, @@ -848,98 +1205,82 @@ "isTestProject" : true, "sbt-scope" : "test" }, - "template-cross-js-all-main" : { + "template-cross-all" : { + "cross" : { + "jvm213" : { + "extends" : "template-jvm" + }, + "jvm3" : { + "extends" : "template-jvm" + } + }, + "extends" : "template-cross-js-all" + }, + "template-cross-js-all" : { "cross" : { "js213" : { "extends" : [ - "template-common-main", "template-js", - "template-scala-2.13-main", - "template-scala-2.13-js" + "template-scala-2-js" ] }, "js3" : { "extends" : [ - "template-common-main", "template-js", - "template-scala-3-main", "template-scala-3-js" ] } } }, - "template-cross-js-all-test" : { + "template-cross-js-all-main" : { "cross" : { "js213" : { "extends" : [ - "template-common-test", - "template-js", - "template-scala-2.13-test", - "template-scala-2.13-js" + "template-scala-2", + "template-scala-2-main" ] }, "js3" : { - "extends" : [ - "template-common-test", - "template-js", - "template-scala-3-test", - "template-scala-3-js" - ] - }, - "jvm213" : { - "extends" : [ - "template-common-test", - "template-jvm", - "template-scala-2.13-test" - ] - }, - "jvm3" : { - "extends" : [ - "template-common-test", - "template-jvm", - "template-scala-3-test" - ] + "extends" : "template-scala-3-main" } } }, - "template-cross-jvm-all-main" : { + "template-cross-js-all-test" : { "cross" : { - "jvm213" : { + "js213" : { "extends" : [ - "template-common-main", - "template-jvm", - "template-scala-2.13-main" + "template-scala-2", + "template-scala-2-test" ] }, - "jvm3" : { + "js3" : { + "extends" : "template-scala-3-test" + }, + "jvm213" : { "extends" : [ - "template-common-main", - "template-jvm", - "template-scala-3-main" + "template-scala-2", + "template-scala-2-test" ] + }, + "jvm3" : { + "extends" : "template-scala-3-test" } } }, - "template-cross-jvm-all-test" : { + "template-cross-jvm-all-main" : { "cross" : { "jvm213" : { "extends" : [ - "template-common-test", - "template-jvm", - "template-scala-2.13-test" + "template-scala-2", + "template-scala-2-main" ] }, "jvm3" : { - "extends" : [ - "template-common-test", - "template-jvm", - "template-scala-3-test" - ] + "extends" : "template-scala-3-main" } } }, "template-js" : { - "extends" : "template-common", "platform" : { "jsEmitSourceMaps" : false, "jsJsdom" : false, @@ -950,13 +1291,11 @@ } }, "template-jvm" : { - "extends" : "template-common", "platform" : { "name" : "jvm" } }, - "template-scala-2.13" : { - "extends" : "template-common", + "template-scala-2" : { "scala" : { "compilerPlugins" : [ "com.olegpy::better-monadic-for:0.3.1", @@ -988,35 +1327,22 @@ "version" : "2.13.8" } }, - "template-scala-2.13-js" : { - "extends" : [ - "template-js", - "template-scala-2.13" - ], + "template-scala-2-js" : { "scala" : { "options" : "-P:scala${PLATFORM}:mapSourceURI:file:${BUILD_DIR}/->https://raw.githubusercontent.com/http4s/http4s/bc0662792fd0c4d8462c247f634c01fee0dd5712/" } }, - "template-scala-2.13-main" : { - "extends" : [ - "template-common-main", - "template-scala-2.13" - ], + "template-scala-2-main" : { "scala" : { "options" : "-P:semanticdb:targetroot:${TARGET_DIR}/meta" } }, - "template-scala-2.13-test" : { - "extends" : [ - "template-common-test", - "template-scala-2.13" - ], + "template-scala-2-test" : { "scala" : { "options" : "-P:semanticdb:targetroot:${TARGET_DIR}/test-meta" } }, "template-scala-3" : { - "extends" : "template-common", "scala" : { "options" : [ "-Xsemanticdb", @@ -1028,10 +1354,6 @@ } }, "template-scala-3-js" : { - "extends" : [ - "template-js", - "template-scala-3" - ], "scala" : { "options" : [ "-scala${PLATFORM}", @@ -1040,10 +1362,7 @@ } }, "template-scala-3-main" : { - "extends" : [ - "template-common-main", - "template-scala-3" - ], + "extends" : "template-scala-3", "scala" : { "options" : [ "-semanticdb-target", @@ -1052,10 +1371,7 @@ } }, "template-scala-3-test" : { - "extends" : [ - "template-common-test", - "template-scala-3" - ], + "extends" : "template-scala-3", "scala" : { "options" : [ "-semanticdb-target", diff --git a/snapshot-tests/tapir/bleep.json b/snapshot-tests/tapir/bleep.json index 5df4a92a3..a7d8e5528 100644 --- a/snapshot-tests/tapir/bleep.json +++ b/snapshot-tests/tapir/bleep.json @@ -8,7 +8,11 @@ "com.typesafe.akka::akka-stream:2.6.17" ], "dependsOn" : "core", - "extends" : "template-cross-jvm-212-213-main", + "extends" : [ + "template-common-main", + "template-jvm", + "template-cross-jvm-212-213-main" + ], "folder" : "./../../snapshot-tests-in/tapir/server/akka-http-server" }, "akkaHttpServer-test" : { @@ -17,7 +21,11 @@ "akkaHttpServer", "serverTests" ], - "extends" : "template-cross-jvm-212-213-test", + "extends" : [ + "template-jvm", + "template-common-test", + "template-cross-jvm-212-213-test" + ], "folder" : "./../../snapshot-tests-in/tapir/server/akka-http-server" }, "apispecDocs" : { @@ -25,11 +33,21 @@ "apispecModel", "core" ], - "extends" : "template-cross-jvm-all-main", + "extends" : [ + "template-common-main", + "template-jvm", + "template-cross-jvm-all", + "template-cross-jvm-212-213-main" + ], "folder" : "./../../snapshot-tests-in/tapir/docs/apispec-docs" }, "apispecModel" : { - "extends" : "template-cross-jvm-all-main", + "extends" : [ + "template-common-main", + "template-jvm", + "template-cross-jvm-all", + "template-cross-jvm-212-213-main" + ], "folder" : "./../../snapshot-tests-in/tapir/apispec/apispec-model" }, "asyncapiCirce" : { @@ -39,13 +57,23 @@ "io.circe::circe-parser:0.14.1" ], "dependsOn" : "asyncapiModel", - "extends" : "template-cross-jvm-all-main", + "extends" : [ + "template-common-main", + "template-jvm", + "template-cross-jvm-all", + "template-cross-jvm-212-213-main" + ], "folder" : "./../../snapshot-tests-in/tapir/apispec/asyncapi-circe" }, "asyncapiCirceYaml" : { "dependencies" : "io.circe::circe-yaml:0.14.1", "dependsOn" : "asyncapiCirce", - "extends" : "template-cross-jvm-all-main", + "extends" : [ + "template-common-main", + "template-jvm", + "template-cross-jvm-all", + "template-cross-jvm-212-213-main" + ], "folder" : "./../../snapshot-tests-in/tapir/apispec/asyncapi-circe-yaml" }, "asyncapiDocs" : { @@ -53,7 +81,11 @@ "apispecDocs", "asyncapiModel" ], - "extends" : "template-cross-jvm-212-213-main", + "extends" : [ + "template-common-main", + "template-jvm", + "template-cross-jvm-212-213-main" + ], "folder" : "./../../snapshot-tests-in/tapir/docs/asyncapi-docs" }, "asyncapiDocs-test" : { @@ -66,12 +98,21 @@ "asyncapiDocs", "tests" ], - "extends" : "template-cross-jvm-212-213-test", + "extends" : [ + "template-jvm", + "template-common-test", + "template-cross-jvm-212-213-test" + ], "folder" : "./../../snapshot-tests-in/tapir/docs/asyncapi-docs" }, "asyncapiModel" : { "dependsOn" : "apispecModel", - "extends" : "template-cross-jvm-all-main", + "extends" : [ + "template-common-main", + "template-jvm", + "template-cross-jvm-all", + "template-cross-jvm-212-213-main" + ], "folder" : "./../../snapshot-tests-in/tapir/apispec/asyncapi-model" }, "awsExamples" : { @@ -93,7 +134,11 @@ }, "dependencies" : "com.softwaremill.sttp.client3::cats:3.3.18", "dependsOn" : "awsLambda", - "extends" : "template-cross-jvm-212-213-js-212-213-main", + "extends" : [ + "template-common-main", + "template-cross-jvm-212-213-js-212-213", + "template-cross-jvm-212-213-js-212-213-main" + ], "folder" : "./../../snapshot-tests-in/tapir/serverless/aws/examples" }, "awsLambda" : { @@ -121,7 +166,11 @@ "cats", "circeJson" ], - "extends" : "template-cross-jvm-all-js-212-213-main", + "extends" : [ + "template-common-main", + "template-cross-jvm-all-js-212-213", + "template-cross-jvm-212-213-js-212-213-main" + ], "folder" : "./../../snapshot-tests-in/tapir/serverless/aws/lambda" }, "awsLambda-test" : { @@ -129,7 +178,12 @@ "awsLambda", "tests" ], - "extends" : "template-cross-jvm-all-test", + "extends" : [ + "template-jvm", + "template-common-test", + "template-cross-jvm-all", + "template-cross-jvm-212-213-test" + ], "folder" : "./../../snapshot-tests-in/tapir/serverless/aws/lambda" }, "awsLambdaTests" : { @@ -140,12 +194,20 @@ "serverTests", "sttpStubServer" ], - "extends" : "template-cross-jvm-212-213-main", + "extends" : [ + "template-common-main", + "template-jvm", + "template-cross-jvm-212-213-main" + ], "folder" : "./../../snapshot-tests-in/tapir/serverless/aws/lambda-tests" }, "awsLambdaTests-test" : { "dependsOn" : "awsLambdaTests", - "extends" : "template-cross-jvm-212-213-test", + "extends" : [ + "template-jvm", + "template-common-test", + "template-cross-jvm-212-213-test" + ], "folder" : "./../../snapshot-tests-in/tapir/serverless/aws/lambda-tests" }, "awsSam" : { @@ -154,7 +216,12 @@ "io.circe::circe-yaml:0.14.1" ], "dependsOn" : "core", - "extends" : "template-cross-jvm-all-main", + "extends" : [ + "template-common-main", + "template-jvm", + "template-cross-jvm-all", + "template-cross-jvm-212-213-main" + ], "folder" : "./../../snapshot-tests-in/tapir/serverless/aws/sam" }, "awsSam-test" : { @@ -162,7 +229,12 @@ "awsSam", "tests" ], - "extends" : "template-cross-jvm-all-test", + "extends" : [ + "template-jvm", + "template-common-test", + "template-cross-jvm-all", + "template-cross-jvm-212-213-test" + ], "folder" : "./../../snapshot-tests-in/tapir/serverless/aws/sam" }, "awsTerraform" : { @@ -173,7 +245,11 @@ "org.typelevel::jawn-parser:1.3.0" ], "dependsOn" : "core", - "extends" : "template-cross-jvm-212-213-main", + "extends" : [ + "template-common-main", + "template-jvm", + "template-cross-jvm-212-213-main" + ], "folder" : "./../../snapshot-tests-in/tapir/serverless/aws/terraform" }, "awsTerraform-test" : { @@ -181,7 +257,11 @@ "awsTerraform", "tests" ], - "extends" : "template-cross-jvm-212-213-test", + "extends" : [ + "template-jvm", + "template-common-test", + "template-cross-jvm-212-213-test" + ], "folder" : "./../../snapshot-tests-in/tapir/serverless/aws/terraform" }, "cats" : { @@ -190,7 +270,11 @@ "org.typelevel::cats-effect:3.3.0" ], "dependsOn" : "core", - "extends" : "template-cross-all-main", + "extends" : [ + "template-common-main", + "template-cross-all", + "template-cross-jvm-212-213-js-212-213-main" + ], "folder" : "./../../snapshot-tests-in/tapir/integrations/cats" }, "cats-test" : { @@ -203,6 +287,7 @@ ], "dependsOn" : "cats", "extends" : [ + "template-common-test", "template-cross-all", "template-cross-jvm-all-js-212-213-test" ], @@ -215,13 +300,22 @@ "io.circe::circe-parser:0.14.1" ], "dependsOn" : "core", - "extends" : "template-cross-all-main", + "extends" : [ + "template-common-main", + "template-cross-all", + "template-cross-jvm-212-213-js-212-213-main" + ], "folder" : "./../../snapshot-tests-in/tapir/json/circe" }, "circeJson-test" : { "dependencies" : "org.scalatest::scalatest:3.2.10", "dependsOn" : "circeJson", - "extends" : "template-cross-jvm-all-test", + "extends" : [ + "template-jvm", + "template-common-test", + "template-cross-jvm-all", + "template-cross-jvm-212-213-test" + ], "folder" : "./../../snapshot-tests-in/tapir/json/circe" }, "clientTestServer" : { @@ -233,7 +327,12 @@ "org.http4s::http4s-circe:0.23.7", "org.http4s::http4s-dsl:0.23.7" ], - "extends" : "template-cross-jvm-all-main", + "extends" : [ + "template-common-main", + "template-jvm", + "template-cross-jvm-all", + "template-cross-jvm-212-213-main" + ], "folder" : "./../../snapshot-tests-in/tapir/client/testserver" }, "clientTests" : { @@ -263,7 +362,11 @@ } ], "dependsOn" : "tests", - "extends" : "template-cross-all-main", + "extends" : [ + "template-common-main", + "template-cross-all", + "template-cross-jvm-212-213-js-212-213-main" + ], "folder" : "./../../snapshot-tests-in/tapir/client/tests" }, "core" : { @@ -321,7 +424,11 @@ "com.softwaremill.sttp.shared::core:1.2.7", "com.softwaremill.sttp.shared::ws:1.2.7" ], - "extends" : "template-cross-all-main", + "extends" : [ + "template-common-main", + "template-cross-all", + "template-cross-jvm-212-213-js-212-213-main" + ], "folder" : "./../../snapshot-tests-in/tapir/core", "sources" : "./src/main/boilerplate-gen" }, @@ -376,6 +483,7 @@ ], "dependsOn" : "core", "extends" : [ + "template-common-test", "template-cross-all", "template-cross-jvm-all-js-212-213-test" ], @@ -404,7 +512,11 @@ }, "dependencies" : "tf.tofu::derevo-core:0.12.8", "dependsOn" : "newtype", - "extends" : "template-cross-jvm-212-213-main", + "extends" : [ + "template-common-main", + "template-jvm", + "template-cross-jvm-212-213-main" + ], "folder" : "./../../snapshot-tests-in/tapir/integrations/derevo" }, "derevo-test" : { @@ -430,13 +542,21 @@ }, "dependencies" : "org.scalatest::scalatest:3.2.10", "dependsOn" : "derevo", - "extends" : "template-cross-jvm-212-213-test", + "extends" : [ + "template-jvm", + "template-common-test", + "template-cross-jvm-212-213-test" + ], "folder" : "./../../snapshot-tests-in/tapir/integrations/derevo" }, "enumeratum" : { "dependencies" : "com.beachape::enumeratum:1.7.0", "dependsOn" : "core", - "extends" : "template-cross-jvm-212-213-js-212-213-main", + "extends" : [ + "template-common-main", + "template-cross-jvm-212-213-js-212-213", + "template-cross-jvm-212-213-js-212-213-main" + ], "folder" : "./../../snapshot-tests-in/tapir/integrations/enumeratum" }, "enumeratum-test" : { @@ -450,7 +570,11 @@ }, "dependencies" : "org.scalatest::scalatest:3.2.10", "dependsOn" : "enumeratum", - "extends" : "template-cross-jvm-212-213-js-212-213-test", + "extends" : [ + "template-common-test", + "template-cross-jvm-212-213-js-212-213", + "template-cross-jvm-212-213-js-212-213-test" + ], "folder" : "./../../snapshot-tests-in/tapir/integrations/enumeratum" }, "examples" : { @@ -493,7 +617,11 @@ "org.apache.httpcomponents:httpmime:4.5.13" ], "dependsOn" : "core", - "extends" : "template-cross-jvm-212-213-main", + "extends" : [ + "template-common-main", + "template-jvm", + "template-cross-jvm-212-213-main" + ], "folder" : "./../../snapshot-tests-in/tapir/server/finatra-server" }, "finatraServer-test" : { @@ -552,13 +680,21 @@ "finatraServer", "serverTests" ], - "extends" : "template-cross-jvm-212-213-test", + "extends" : [ + "template-jvm", + "template-common-test", + "template-cross-jvm-212-213-test" + ], "folder" : "./../../snapshot-tests-in/tapir/server/finatra-server" }, "finatraServerCats" : { "dependencies" : "org.typelevel::cats-effect:3.3.0", "dependsOn" : "finatraServer", - "extends" : "template-cross-jvm-212-213-main", + "extends" : [ + "template-common-main", + "template-jvm", + "template-cross-jvm-212-213-main" + ], "folder" : "./../../snapshot-tests-in/tapir/server/finatra-server/finatra-server-cats" }, "finatraServerCats-test" : { @@ -566,7 +702,11 @@ "finatraServer-test", "finatraServerCats" ], - "extends" : "template-cross-jvm-212-213-test", + "extends" : [ + "template-jvm", + "template-common-test", + "template-cross-jvm-212-213-test" + ], "folder" : "./../../snapshot-tests-in/tapir/server/finatra-server/finatra-server-cats" }, "http4sClient" : { @@ -578,7 +718,12 @@ "org.http4s::http4s-core:0.23.7" ], "dependsOn" : "core", - "extends" : "template-cross-jvm-all-main", + "extends" : [ + "template-common-main", + "template-jvm", + "template-cross-jvm-all", + "template-cross-jvm-212-213-main" + ], "folder" : "./../../snapshot-tests-in/tapir/client/http4s-client" }, "http4sClient-test" : { @@ -593,7 +738,12 @@ "clientTests", "http4sClient" ], - "extends" : "template-cross-jvm-all-test", + "extends" : [ + "template-jvm", + "template-common-test", + "template-cross-jvm-all", + "template-cross-jvm-212-213-test" + ], "folder" : "./../../snapshot-tests-in/tapir/client/http4s-client" }, "http4sServer" : { @@ -602,7 +752,12 @@ "org.http4s::http4s-blaze-server:0.23.7" ], "dependsOn" : "cats", - "extends" : "template-cross-jvm-all-main", + "extends" : [ + "template-common-main", + "template-jvm", + "template-cross-jvm-all", + "template-cross-jvm-212-213-main" + ], "folder" : "./../../snapshot-tests-in/tapir/server/http4s-server" }, "http4sServer-test" : { @@ -610,13 +765,22 @@ "http4sServer", "serverTests" ], - "extends" : "template-cross-jvm-all-test", + "extends" : [ + "template-jvm", + "template-common-test", + "template-cross-jvm-all", + "template-cross-jvm-212-213-test" + ], "folder" : "./../../snapshot-tests-in/tapir/server/http4s-server" }, "json4s" : { "dependencies" : "org.json4s::json4s-core:4.0.3", "dependsOn" : "core", - "extends" : "template-cross-jvm-212-213-main", + "extends" : [ + "template-common-main", + "template-jvm", + "template-cross-jvm-212-213-main" + ], "folder" : "./../../snapshot-tests-in/tapir/json/json4s" }, "json4s-test" : { @@ -625,13 +789,21 @@ "org.scalatest::scalatest:3.2.10" ], "dependsOn" : "json4s", - "extends" : "template-cross-jvm-212-213-test", + "extends" : [ + "template-jvm", + "template-common-test", + "template-cross-jvm-212-213-test" + ], "folder" : "./../../snapshot-tests-in/tapir/json/json4s" }, "jsoniterScala" : { "dependencies" : "com.github.plokhotnyuk.jsoniter-scala::jsoniter-scala-core:2.12.0", "dependsOn" : "core", - "extends" : "template-cross-jvm-212-213-js-212-213-main", + "extends" : [ + "template-common-main", + "template-cross-jvm-212-213-js-212-213", + "template-cross-jvm-212-213-js-212-213-main" + ], "folder" : "./../../snapshot-tests-in/tapir/json/jsoniter" }, "jsoniterScala-test" : { @@ -640,7 +812,11 @@ "org.scalatest::scalatest:3.2.10" ], "dependsOn" : "jsoniterScala", - "extends" : "template-cross-jvm-212-213-js-212-213-test", + "extends" : [ + "template-common-test", + "template-cross-jvm-212-213-js-212-213", + "template-cross-jvm-212-213-js-212-213-test" + ], "folder" : "./../../snapshot-tests-in/tapir/json/jsoniter" }, "nettyServer" : { @@ -655,7 +831,12 @@ "io.netty:netty-all:4.1.68.Final" ], "dependsOn" : "core", - "extends" : "template-cross-jvm-all-main", + "extends" : [ + "template-common-main", + "template-jvm", + "template-cross-jvm-all", + "template-cross-jvm-212-213-main" + ], "folder" : "./../../snapshot-tests-in/tapir/server/netty-server" }, "nettyServer-test" : { @@ -667,7 +848,12 @@ "nettyServer", "serverTests" ], - "extends" : "template-cross-jvm-all-test", + "extends" : [ + "template-jvm", + "template-common-test", + "template-cross-jvm-all", + "template-cross-jvm-212-213-test" + ], "folder" : "./../../snapshot-tests-in/tapir/server/netty-server" }, "newtype" : { @@ -695,7 +881,11 @@ }, "dependencies" : "io.estatico::newtype:0.4.4", "dependsOn" : "core", - "extends" : "template-cross-jvm-212-213-js-212-213-main", + "extends" : [ + "template-common-main", + "template-cross-jvm-212-213-js-212-213", + "template-cross-jvm-212-213-js-212-213-main" + ], "folder" : "./../../snapshot-tests-in/tapir/integrations/newtype" }, "newtype-test" : { @@ -723,7 +913,11 @@ }, "dependencies" : "org.scalatest::scalatest:3.2.10", "dependsOn" : "newtype", - "extends" : "template-cross-jvm-212-213-js-212-213-test", + "extends" : [ + "template-common-test", + "template-cross-jvm-212-213-js-212-213", + "template-cross-jvm-212-213-js-212-213-test" + ], "folder" : "./../../snapshot-tests-in/tapir/integrations/newtype" }, "openapiCirce" : { @@ -733,13 +927,23 @@ "io.circe::circe-parser:0.14.1" ], "dependsOn" : "openapiModel", - "extends" : "template-cross-jvm-all-main", + "extends" : [ + "template-common-main", + "template-jvm", + "template-cross-jvm-all", + "template-cross-jvm-212-213-main" + ], "folder" : "./../../snapshot-tests-in/tapir/apispec/openapi-circe" }, "openapiCirceYaml" : { "dependencies" : "io.circe::circe-yaml:0.14.1", "dependsOn" : "openapiCirce", - "extends" : "template-cross-jvm-all-main", + "extends" : [ + "template-common-main", + "template-jvm", + "template-cross-jvm-all", + "template-cross-jvm-212-213-main" + ], "folder" : "./../../snapshot-tests-in/tapir/apispec/openapi-circe-yaml" }, "openapiCodegen" : { @@ -780,8 +984,8 @@ "openapiCodegen" ], "extends" : [ - "template-common-test", "template-jvm", + "template-common-test", "template-scala-2.12-test" ], "folder" : "./../../snapshot-tests-in/tapir/sbt/sbt-openapi-codegen", @@ -803,7 +1007,12 @@ "apispecDocs", "openapiModel" ], - "extends" : "template-cross-jvm-all-main", + "extends" : [ + "template-common-main", + "template-jvm", + "template-cross-jvm-all", + "template-cross-jvm-212-213-main" + ], "folder" : "./../../snapshot-tests-in/tapir/docs/openapi-docs" }, "openapiDocs-test" : { @@ -812,18 +1021,33 @@ "openapiDocs", "tests" ], - "extends" : "template-cross-jvm-all-test", + "extends" : [ + "template-jvm", + "template-common-test", + "template-cross-jvm-all", + "template-cross-jvm-212-213-test" + ], "folder" : "./../../snapshot-tests-in/tapir/docs/openapi-docs" }, "openapiModel" : { "dependsOn" : "apispecModel", - "extends" : "template-cross-jvm-all-main", + "extends" : [ + "template-common-main", + "template-jvm", + "template-cross-jvm-all", + "template-cross-jvm-212-213-main" + ], "folder" : "./../../snapshot-tests-in/tapir/apispec/openapi-model" }, "openapiModel-test" : { "dependencies" : "org.scalatest::scalatest:3.2.10", "dependsOn" : "openapiModel", - "extends" : "template-cross-jvm-all-test", + "extends" : [ + "template-jvm", + "template-common-test", + "template-cross-jvm-all", + "template-cross-jvm-212-213-test" + ], "folder" : "./../../snapshot-tests-in/tapir/apispec/openapi-model" }, "opentelemetryMetrics" : { @@ -832,7 +1056,12 @@ "io.opentelemetry:opentelemetry-sdk:1.9.1" ], "dependsOn" : "core", - "extends" : "template-cross-jvm-all-main", + "extends" : [ + "template-common-main", + "template-jvm", + "template-cross-jvm-all", + "template-cross-jvm-212-213-main" + ], "folder" : "./../../snapshot-tests-in/tapir/metrics/opentelemetry-metrics" }, "opentelemetryMetrics-test" : { @@ -841,7 +1070,12 @@ "core-test", "opentelemetryMetrics" ], - "extends" : "template-cross-jvm-all-test", + "extends" : [ + "template-jvm", + "template-common-test", + "template-cross-jvm-all", + "template-cross-jvm-212-213-test" + ], "folder" : "./../../snapshot-tests-in/tapir/metrics/opentelemetry-metrics" }, "playClient" : { @@ -857,7 +1091,11 @@ "com.typesafe.play::play-ahc-ws-standalone:2.1.6" ], "dependsOn" : "core", - "extends" : "template-cross-jvm-212-213-main", + "extends" : [ + "template-common-main", + "template-jvm", + "template-cross-jvm-212-213-main" + ], "folder" : "./../../snapshot-tests-in/tapir/client/play-client" }, "playClient-test" : { @@ -875,13 +1113,21 @@ "clientTests", "playClient" ], - "extends" : "template-cross-jvm-212-213-test", + "extends" : [ + "template-jvm", + "template-common-test", + "template-cross-jvm-212-213-test" + ], "folder" : "./../../snapshot-tests-in/tapir/client/play-client" }, "playJson" : { "dependencies" : "com.typesafe.play::play-json:2.9.2", "dependsOn" : "core", - "extends" : "template-cross-jvm-212-213-js-212-213-main", + "extends" : [ + "template-common-main", + "template-cross-jvm-212-213-js-212-213", + "template-cross-jvm-212-213-js-212-213-main" + ], "folder" : "./../../snapshot-tests-in/tapir/json/playjson" }, "playJson-test" : { @@ -895,7 +1141,11 @@ }, "dependencies" : "org.scalatest::scalatest:3.2.10", "dependsOn" : "playJson", - "extends" : "template-cross-jvm-212-213-js-212-213-test", + "extends" : [ + "template-common-test", + "template-cross-jvm-212-213-js-212-213", + "template-cross-jvm-212-213-js-212-213-test" + ], "folder" : "./../../snapshot-tests-in/tapir/json/playjson" }, "playServer" : { @@ -906,7 +1156,11 @@ "com.typesafe.play::play:2.8.7" ], "dependsOn" : "core", - "extends" : "template-cross-jvm-212-213-main", + "extends" : [ + "template-common-main", + "template-jvm", + "template-cross-jvm-212-213-main" + ], "folder" : "./../../snapshot-tests-in/tapir/server/play-server" }, "playServer-test" : { @@ -914,13 +1168,22 @@ "playServer", "serverTests" ], - "extends" : "template-cross-jvm-212-213-test", + "extends" : [ + "template-jvm", + "template-common-test", + "template-cross-jvm-212-213-test" + ], "folder" : "./../../snapshot-tests-in/tapir/server/play-server" }, "prometheusMetrics" : { "dependencies" : "io.prometheus:simpleclient_common:0.12.0", "dependsOn" : "core", - "extends" : "template-cross-jvm-all-main", + "extends" : [ + "template-common-main", + "template-jvm", + "template-cross-jvm-all", + "template-cross-jvm-212-213-main" + ], "folder" : "./../../snapshot-tests-in/tapir/metrics/prometheus-metrics" }, "prometheusMetrics-test" : { @@ -928,12 +1191,22 @@ "core-test", "prometheusMetrics" ], - "extends" : "template-cross-jvm-all-test", + "extends" : [ + "template-jvm", + "template-common-test", + "template-cross-jvm-all", + "template-cross-jvm-212-213-test" + ], "folder" : "./../../snapshot-tests-in/tapir/metrics/prometheus-metrics" }, "redoc" : { "dependsOn" : "core", - "extends" : "template-cross-jvm-all-main", + "extends" : [ + "template-common-main", + "template-jvm", + "template-cross-jvm-all", + "template-cross-jvm-212-213-main" + ], "folder" : "./../../snapshot-tests-in/tapir/docs/redoc" }, "redocBundle" : { @@ -942,13 +1215,22 @@ "openapiDocs", "redoc" ], - "extends" : "template-cross-jvm-all-main", + "extends" : [ + "template-common-main", + "template-jvm", + "template-cross-jvm-all", + "template-cross-jvm-212-213-main" + ], "folder" : "./../../snapshot-tests-in/tapir/docs/redoc-bundle" }, "refined" : { "dependencies" : "eu.timepit::refined:0.9.28", "dependsOn" : "core", - "extends" : "template-cross-jvm-212-213-js-212-213-main", + "extends" : [ + "template-common-main", + "template-cross-jvm-212-213-js-212-213", + "template-cross-jvm-212-213-js-212-213-main" + ], "folder" : "./../../snapshot-tests-in/tapir/integrations/refined" }, "refined-test" : { @@ -968,25 +1250,42 @@ "circeJson", "refined" ], - "extends" : "template-cross-jvm-212-213-js-212-213-test", + "extends" : [ + "template-common-test", + "template-cross-jvm-212-213-js-212-213", + "template-cross-jvm-212-213-js-212-213-test" + ], "folder" : "./../../snapshot-tests-in/tapir/integrations/refined" }, "serverTests" : { "dependencies" : "com.softwaremill.sttp.client3::httpclient-backend-fs2:3.3.18", "dependsOn" : "tests", - "extends" : "template-cross-jvm-all-main", + "extends" : [ + "template-common-main", + "template-jvm", + "template-cross-jvm-all", + "template-cross-jvm-212-213-main" + ], "folder" : "./../../snapshot-tests-in/tapir/server/tests" }, "sprayJson" : { "dependencies" : "io.spray::spray-json:1.3.6", "dependsOn" : "core", - "extends" : "template-cross-jvm-212-213-main", + "extends" : [ + "template-common-main", + "template-jvm", + "template-cross-jvm-212-213-main" + ], "folder" : "./../../snapshot-tests-in/tapir/json/sprayjson" }, "sprayJson-test" : { "dependencies" : "org.scalatest::scalatest:3.2.10", "dependsOn" : "sprayJson", - "extends" : "template-cross-jvm-212-213-test", + "extends" : [ + "template-jvm", + "template-common-test", + "template-cross-jvm-212-213-test" + ], "folder" : "./../../snapshot-tests-in/tapir/json/sprayjson" }, "sttpClient" : { @@ -1046,7 +1345,11 @@ }, "dependencies" : "com.softwaremill.sttp.client3::core:3.3.18", "dependsOn" : "core", - "extends" : "template-cross-all-main", + "extends" : [ + "template-common-main", + "template-cross-all", + "template-cross-jvm-212-213-js-212-213-main" + ], "folder" : "./../../snapshot-tests-in/tapir/client/sttp-client" }, "sttpClient-test" : { @@ -1126,6 +1429,7 @@ "sttpClient" ], "extends" : [ + "template-common-test", "template-cross-all", "template-cross-jvm-all-js-212-213-test" ], @@ -1138,7 +1442,11 @@ "io.circe::circe-parser:0.14.1" ], "dependsOn" : "sttpClient", - "extends" : "template-cross-jvm-212-213-main", + "extends" : [ + "template-common-main", + "template-jvm", + "template-cross-jvm-212-213-main" + ], "folder" : "./../../snapshot-tests-in/tapir/server/sttp-mock-server" }, "sttpMockServer-test" : { @@ -1147,12 +1455,21 @@ "serverTests", "sttpMockServer" ], - "extends" : "template-cross-jvm-212-213-test", + "extends" : [ + "template-jvm", + "template-common-test", + "template-cross-jvm-212-213-test" + ], "folder" : "./../../snapshot-tests-in/tapir/server/sttp-mock-server" }, "sttpStubServer" : { "dependsOn" : "sttpClient", - "extends" : "template-cross-jvm-all-main", + "extends" : [ + "template-common-main", + "template-jvm", + "template-cross-jvm-all", + "template-cross-jvm-212-213-main" + ], "folder" : "./../../snapshot-tests-in/tapir/server/sttp-stub-server" }, "sttpStubServer-test" : { @@ -1160,13 +1477,23 @@ "serverTests", "sttpStubServer" ], - "extends" : "template-cross-jvm-all-test", + "extends" : [ + "template-jvm", + "template-common-test", + "template-cross-jvm-all", + "template-cross-jvm-212-213-test" + ], "folder" : "./../../snapshot-tests-in/tapir/server/sttp-stub-server" }, "swaggerUi" : { "dependencies" : "org.webjars:swagger-ui:4.1.3", "dependsOn" : "core", - "extends" : "template-cross-jvm-all-main", + "extends" : [ + "template-common-main", + "template-jvm", + "template-cross-jvm-all", + "template-cross-jvm-212-213-main" + ], "folder" : "./../../snapshot-tests-in/tapir/docs/swagger-ui" }, "swaggerUiBundle" : { @@ -1175,7 +1502,12 @@ "openapiDocs", "swaggerUi" ], - "extends" : "template-cross-jvm-all-main", + "extends" : [ + "template-common-main", + "template-jvm", + "template-cross-jvm-all", + "template-cross-jvm-212-213-main" + ], "folder" : "./../../snapshot-tests-in/tapir/docs/swagger-ui-bundle" }, "swaggerUiBundle-test" : { @@ -1185,7 +1517,12 @@ "sttpClient", "swaggerUiBundle" ], - "extends" : "template-cross-jvm-all-test", + "extends" : [ + "template-jvm", + "template-common-test", + "template-cross-jvm-all", + "template-cross-jvm-212-213-test" + ], "folder" : "./../../snapshot-tests-in/tapir/docs/swagger-ui-bundle" }, "tests" : { @@ -1203,7 +1540,11 @@ "cats", "circeJson" ], - "extends" : "template-cross-all-main", + "extends" : [ + "template-common-main", + "template-cross-all", + "template-cross-jvm-212-213-js-212-213-main" + ], "folder" : "./../../snapshot-tests-in/tapir/tests" }, "tethysJson" : { @@ -1212,7 +1553,11 @@ "com.tethys-json::tethys-jackson:0.25.0" ], "dependsOn" : "core", - "extends" : "template-cross-jvm-212-213-main", + "extends" : [ + "template-common-main", + "template-jvm", + "template-cross-jvm-212-213-main" + ], "folder" : "./../../snapshot-tests-in/tapir/json/tethys" }, "tethysJson-test" : { @@ -1221,13 +1566,21 @@ "org.scalatest::scalatest:3.2.10" ], "dependsOn" : "tethysJson", - "extends" : "template-cross-jvm-212-213-test", + "extends" : [ + "template-jvm", + "template-common-test", + "template-cross-jvm-212-213-test" + ], "folder" : "./../../snapshot-tests-in/tapir/json/tethys" }, "uPickleJson" : { "dependencies" : "com.lihaoyi::upickle:1.4.3", "dependsOn" : "core", - "extends" : "template-cross-jvm-212-213-js-212-213-main", + "extends" : [ + "template-common-main", + "template-cross-jvm-212-213-js-212-213", + "template-cross-jvm-212-213-js-212-213-main" + ], "folder" : "./../../snapshot-tests-in/tapir/json/upickle" }, "uPickleJson-test" : { @@ -1241,7 +1594,11 @@ }, "dependencies" : "org.scalatest::scalatest:3.2.10", "dependsOn" : "uPickleJson", - "extends" : "template-cross-jvm-212-213-js-212-213-test", + "extends" : [ + "template-common-test", + "template-cross-jvm-212-213-js-212-213", + "template-cross-jvm-212-213-js-212-213-test" + ], "folder" : "./../../snapshot-tests-in/tapir/json/upickle" }, "vertxServer" : { @@ -1257,7 +1614,12 @@ "io.vertx:vertx-web:4.2.1" ], "dependsOn" : "core", - "extends" : "template-cross-jvm-all-main", + "extends" : [ + "template-common-main", + "template-jvm", + "template-cross-jvm-all", + "template-cross-jvm-212-213-main" + ], "folder" : "./../../snapshot-tests-in/tapir/server/vertx" }, "vertxServer-test" : { @@ -1276,7 +1638,12 @@ "serverTests", "vertxServer" ], - "extends" : "template-cross-jvm-all-test", + "extends" : [ + "template-jvm", + "template-common-test", + "template-cross-jvm-all", + "template-cross-jvm-212-213-test" + ], "folder" : "./../../snapshot-tests-in/tapir/server/vertx" }, "zio" : { @@ -1286,7 +1653,12 @@ "dev.zio::zio:1.0.12" ], "dependsOn" : "core", - "extends" : "template-cross-jvm-all-main", + "extends" : [ + "template-common-main", + "template-jvm", + "template-cross-jvm-all", + "template-cross-jvm-212-213-main" + ], "folder" : "./../../snapshot-tests-in/tapir/integrations/zio" }, "zio-test" : { @@ -1295,7 +1667,12 @@ "dev.zio::zio-test:1.0.12" ], "dependsOn" : "zio", - "extends" : "template-cross-jvm-all-test", + "extends" : [ + "template-jvm", + "template-common-test", + "template-cross-jvm-all", + "template-cross-jvm-212-213-test" + ], "folder" : "./../../snapshot-tests-in/tapir/integrations/zio", "testFrameworks" : "zio.test.sbt.ZTestFramework" }, @@ -1305,7 +1682,12 @@ "http4sServer", "zio" ], - "extends" : "template-cross-jvm-all-main", + "extends" : [ + "template-common-main", + "template-jvm", + "template-cross-jvm-all", + "template-cross-jvm-212-213-main" + ], "folder" : "./../../snapshot-tests-in/tapir/server/zio-http4s-server" }, "zioHttp4sServer-test" : { @@ -1313,13 +1695,23 @@ "serverTests", "zioHttp4sServer" ], - "extends" : "template-cross-jvm-all-test", + "extends" : [ + "template-jvm", + "template-common-test", + "template-cross-jvm-all", + "template-cross-jvm-212-213-test" + ], "folder" : "./../../snapshot-tests-in/tapir/server/zio-http4s-server" }, "zioHttpServer" : { "dependencies" : "io.d11::zhttp:1.0.0.0-RC17", "dependsOn" : "zio", - "extends" : "template-cross-jvm-all-main", + "extends" : [ + "template-common-main", + "template-jvm", + "template-cross-jvm-all", + "template-cross-jvm-212-213-main" + ], "folder" : "./../../snapshot-tests-in/tapir/server/zio-http-server" }, "zioHttpServer-test" : { @@ -1328,7 +1720,12 @@ "serverTests", "zioHttpServer" ], - "extends" : "template-cross-jvm-all-test", + "extends" : [ + "template-jvm", + "template-common-test", + "template-cross-jvm-all", + "template-cross-jvm-212-213-test" + ], "folder" : "./../../snapshot-tests-in/tapir/server/zio-http-server" }, "zioJson" : { @@ -1337,13 +1734,22 @@ "module" : "dev.zio::zio-json:0.2.0-M3" }, "dependsOn" : "core", - "extends" : "template-cross-jvm-all-js-212-213-main", + "extends" : [ + "template-common-main", + "template-cross-jvm-all-js-212-213", + "template-cross-jvm-212-213-js-212-213-main" + ], "folder" : "./../../snapshot-tests-in/tapir/json/zio" }, "zioJson-test" : { "dependencies" : "org.scalatest::scalatest:3.2.10", "dependsOn" : "zioJson", - "extends" : "template-cross-jvm-all-test", + "extends" : [ + "template-jvm", + "template-common-test", + "template-cross-jvm-all", + "template-cross-jvm-212-213-test" + ], "folder" : "./../../snapshot-tests-in/tapir/json/zio" } }, @@ -1373,206 +1779,108 @@ "sbt-scope" : "test" }, "template-cross-all" : { - "cross" : { - "js3" : { - "extends" : "template-scala-3-js" - } - }, - "extends" : "template-cross-jvm-212-213-js-212-213" - }, - "template-cross-all-main" : { "cross" : { "js3" : { "extends" : [ - "template-common-main", - "template-js" + "template-js", + "template-scala-3", + "template-scala-3-js" ] } }, - "extends" : [ - "template-cross-jvm-all-js-212-213-main", - "template-cross-all" - ] + "extends" : "template-cross-jvm-all-js-212-213" }, "template-cross-jvm-212-213-js-212-213" : { "cross" : { "js212" : { - "extends" : [ - "template-js", - "template-scala-2.12" - ] + "extends" : "template-js" }, "js213" : { - "extends" : [ - "template-js", - "template-scala-2.13" - ] + "extends" : "template-js" + }, + "jvm212" : { + "extends" : "template-jvm" + }, + "jvm213" : { + "extends" : "template-jvm" } } }, "template-cross-jvm-212-213-js-212-213-main" : { "cross" : { "js212" : { - "extends" : [ - "template-common-main", - "template-js", - "template-scala-2.12-main" - ] + "extends" : "template-scala-2.12-main" }, "js213" : { - "extends" : [ - "template-common-main", - "template-js", - "template-scala-2.13-main" - ] + "extends" : "template-scala-2.13-main" } }, - "extends" : [ - "template-cross-jvm-212-213-main", - "template-cross-jvm-212-213-js-212-213" - ] + "extends" : "template-cross-jvm-212-213-main" }, "template-cross-jvm-212-213-js-212-213-test" : { "cross" : { "js212" : { - "extends" : [ - "template-common-test", - "template-js", - "template-scala-2.12-test" - ] + "extends" : "template-scala-2.12-test" }, "js213" : { - "extends" : [ - "template-common-test", - "template-js", - "template-scala-2.13-test" - ] + "extends" : "template-scala-2.13-test" } }, - "extends" : [ - "template-cross-jvm-212-213-test", - "template-cross-jvm-212-213-js-212-213" - ] + "extends" : "template-cross-jvm-212-213-test" }, "template-cross-jvm-212-213-main" : { "cross" : { "jvm212" : { - "extends" : [ - "template-common-main", - "template-jvm", - "template-scala-2.12-main" - ] + "extends" : "template-scala-2.12-main" }, "jvm213" : { - "extends" : [ - "template-common-main", - "template-jvm", - "template-scala-2.13-main" - ] + "extends" : "template-scala-2.13-main" } } }, "template-cross-jvm-212-213-test" : { "cross" : { "jvm212" : { - "extends" : [ - "template-common-test", - "template-jvm", - "template-scala-2.12-test" - ] + "extends" : "template-scala-2.12-test" }, "jvm213" : { - "extends" : [ - "template-common-test", - "template-jvm", - "template-scala-2.13-test" - ] + "extends" : "template-scala-2.13-test" } } }, - "template-cross-jvm-all-js-212-213-main" : { + "template-cross-jvm-all" : { "cross" : { - "js212" : { - "extends" : [ - "template-common-main", - "template-js", - "template-scala-2.12-main" - ] - }, - "js213" : { - "extends" : [ - "template-common-main", - "template-js", - "template-scala-2.13-main" - ] + "jvm3" : { + "extends" : "template-scala-3" + } + } + }, + "template-cross-jvm-all-js-212-213" : { + "cross" : { + "jvm3" : { + "extends" : "template-jvm" } }, "extends" : [ - "template-cross-jvm-all-main", - "template-cross-jvm-212-213-js-212-213" + "template-cross-jvm-212-213-js-212-213", + "template-cross-jvm-all" ] }, "template-cross-jvm-all-js-212-213-test" : { "cross" : { "js212" : { - "dependencies" : "io.github.cquiroz::scala-java-time:2.3.0", - "extends" : [ - "template-common-test", - "template-js", - "template-scala-2.12-test" - ] + "dependencies" : "io.github.cquiroz::scala-java-time:2.3.0" }, "js213" : { - "dependencies" : "io.github.cquiroz::scala-java-time:2.3.0", - "extends" : [ - "template-common-test", - "template-js", - "template-scala-2.13-test" - ] + "dependencies" : "io.github.cquiroz::scala-java-time:2.3.0" }, "js3" : { - "dependencies" : [ - "io.github.cquiroz::scala-java-time:2.3.0", - "org.scala-js:scalajs-test-bridge_2.13:1.8.0" - ], - "extends" : [ - "template-common-test", - "template-js", - "template-scala-3-js" - ] - } - }, - "extends" : [ - "template-cross-jvm-all-test", - "template-cross-jvm-212-213-js-212-213" - ] - }, - "template-cross-jvm-all-main" : { - "cross" : { - "jvm3" : { - "extends" : [ - "template-common-main", - "template-jvm", - "template-scala-3" - ] - } - }, - "extends" : "template-cross-jvm-212-213-main" - }, - "template-cross-jvm-all-test" : { - "cross" : { - "jvm3" : { - "extends" : [ - "template-common-test", - "template-jvm", - "template-scala-3" - ] + "extends" : "template-scala-3-js-test" } }, - "extends" : "template-cross-jvm-212-213-test" + "extends" : "template-cross-jvm-212-213-js-212-213-test" }, "template-js" : { - "extends" : "template-common", "platform" : { "jsEmitSourceMaps" : false, "jsJsdom" : false, @@ -1583,26 +1891,22 @@ } }, "template-jvm" : { - "extends" : "template-common", "platform" : { "name" : "jvm" } }, - "template-scala-2.12" : { - "extends" : "template-common", + "template-scala-2" : { "scala" : { "compilerPlugins" : "org.typelevel:::kind-projector:0.13.2", "options" : [ "-Xcheckinit", "-Xlint:adapted-args", - "-Xlint:by-name-right-associative", "-Xlint:constant", "-Xlint:delayedinit-select", "-Xlint:doc-detached", "-Xlint:inaccessible", "-Xlint:infer-any", "-Xlint:missing-interpolator", - "-Xlint:nullary-override", "-Xlint:nullary-unit", "-Xlint:option-implicit", "-Xlint:package-object-classes", @@ -1610,6 +1914,17 @@ "-Xlint:private-shadow", "-Xlint:stars-align", "-Xlint:type-parameter-shadow", + "-explaintypes", + "-language:existentials" + ] + } + }, + "template-scala-2.12" : { + "extends" : "template-scala-2", + "scala" : { + "options" : [ + "-Xlint:by-name-right-associative", + "-Xlint:nullary-override", "-Xlint:unsound-match", "-Yno-adapted-args", "-Ypartial-unification", @@ -1625,31 +1940,22 @@ "-Ywarn-unused:patvars", "-Ywarn-unused:privates", "-Ywarn-value-discard", - "-deprecation", - "-explaintypes", - "-language:existentials" + "-deprecation" ], "version" : "2.12.15" } }, "template-scala-2.12-main" : { - "extends" : [ - "template-common-main", - "template-scala-2.12" - ], + "extends" : "template-scala-2.12", "sources" : "./src/main/scala-2.13-" }, "template-scala-2.12-test" : { - "extends" : [ - "template-common-test", - "template-scala-2.12" - ], + "extends" : "template-scala-2.12", "sources" : "./src/test/scala-2.13-" }, "template-scala-2.13" : { - "extends" : "template-common", + "extends" : "template-scala-2", "scala" : { - "compilerPlugins" : "org.typelevel:::kind-projector:0.13.2", "options" : [ "-Vimplicits", "-Vtype-diffs", @@ -1666,46 +1972,22 @@ "-Wunused:patvars", "-Wunused:privates", "-Wvalue-discard", - "-Xcheckinit", "-Xlint:-byname-implicit", - "-Xlint:adapted-args", - "-Xlint:constant", - "-Xlint:delayedinit-select", "-Xlint:deprecation", - "-Xlint:doc-detached", - "-Xlint:inaccessible", - "-Xlint:infer-any", - "-Xlint:missing-interpolator", - "-Xlint:nullary-unit", - "-Xlint:option-implicit", - "-Xlint:package-object-classes", - "-Xlint:poly-implicit-overload", - "-Xlint:private-shadow", - "-Xlint:stars-align", - "-Xlint:strict-unsealed-patmat", - "-Xlint:type-parameter-shadow", - "-explaintypes", - "-language:existentials" + "-Xlint:strict-unsealed-patmat" ], "version" : "2.13.6" } }, "template-scala-2.13-main" : { - "extends" : [ - "template-common-main", - "template-scala-2.13" - ], + "extends" : "template-scala-2.13", "sources" : "./src/main/scala-${SCALA_BIN_VERSION}+" }, "template-scala-2.13-test" : { - "extends" : [ - "template-common-test", - "template-scala-2.13" - ], + "extends" : "template-scala-2.13", "sources" : "./src/test/scala-${SCALA_BIN_VERSION}+" }, "template-scala-3" : { - "extends" : "template-common", "scala" : { "options" : [ "-Ykind-projector", @@ -1717,13 +1999,15 @@ } }, "template-scala-3-js" : { - "extends" : [ - "template-js", - "template-scala-3" - ], "scala" : { "options" : "-scala${PLATFORM}" } + }, + "template-scala-3-js-test" : { + "dependencies" : [ + "io.github.cquiroz::scala-java-time:2.3.0", + "org.scala-js:scalajs-test-bridge_2.13:1.8.0" + ] } } } \ No newline at end of file diff --git a/snapshot-tests/templates/common_template.json b/snapshot-tests/templates/common_template.json new file mode 100644 index 000000000..a3f6b9545 --- /dev/null +++ b/snapshot-tests/templates/common_template.json @@ -0,0 +1,21 @@ +{ + "$schema" : "https://raw.githubusercontent.com/oyvindberg/bleep/master/schema.json", + "projects" : { + "a" : { + "extends" : "template-common" + }, + "b" : { + "extends" : "template-common", + "scala" : { + "options" : "foo" + } + } + }, + "templates" : { + "template-common" : { + "scala" : { + "version" : "2.13.6" + } + } + } +} \ No newline at end of file diff --git a/snapshot-tests/templates/common_test_template.json b/snapshot-tests/templates/common_test_template.json new file mode 100644 index 000000000..756c4fe37 --- /dev/null +++ b/snapshot-tests/templates/common_test_template.json @@ -0,0 +1,29 @@ +{ + "$schema" : "https://raw.githubusercontent.com/oyvindberg/bleep/master/schema.json", + "projects" : { + "a" : { + "extends" : "template-common" + }, + "aTest" : { + "extends" : "template-common-test" + }, + "bTest" : { + "extends" : "template-common-test" + } + }, + "templates" : { + "template-common" : { + "scala" : { + "version" : "2.13.6" + } + }, + "template-common-test" : { + "dependsOn" : "a", + "extends" : "template-common", + "isTestProject" : true, + "scala" : { + "options" : "foo" + } + } + } +} \ No newline at end of file diff --git a/snapshot-tests/templates/foo.json b/snapshot-tests/templates/foo.json new file mode 100644 index 000000000..a462f8a37 --- /dev/null +++ b/snapshot-tests/templates/foo.json @@ -0,0 +1,48 @@ +{ + "$schema" : "https://raw.githubusercontent.com/oyvindberg/bleep/master/schema.json", + "projects" : { + "bleep-core" : { + "cross" : { + "jvm212" : { + "extends" : "template-scala-2.12" + }, + "jvm213" : { + "extends" : "template-scala-2.13" + } + }, + "extends" : "template-common-main" + }, + "bleep-tasks" : { + "extends" : [ + "template-common-main", + "template-scala-2.12" + ] + }, + "bleep-test" : { + "extends" : [ + "template-common", + "template-scala-2.13" + ], + "isTestProject" : true + } + }, + "templates" : { + "template-common" : { + "source-layout" : "sbt-matrix" + }, + "template-common-main" : { + "extends" : "template-common", + "sbt-scope" : "main" + }, + "template-scala-2.12" : { + "scala" : { + "version" : "2.12.15" + } + }, + "template-scala-2.13" : { + "scala" : { + "version" : "2.13.8" + } + } + } +} \ No newline at end of file diff --git a/snapshot-tests/templates/template_ignore_b.json b/snapshot-tests/templates/template_ignore_b.json new file mode 100644 index 000000000..dd05fcb8c --- /dev/null +++ b/snapshot-tests/templates/template_ignore_b.json @@ -0,0 +1,26 @@ +{ + "$schema" : "https://raw.githubusercontent.com/oyvindberg/bleep/master/schema.json", + "projects" : { + "a" : { + "extends" : "template-common" + }, + "aTest" : { + "dependsOn" : "a", + "extends" : "template-common", + "isTestProject" : true, + "scala" : { + "options" : "foo" + } + }, + "b" : { + "dependsOn" : "a" + } + }, + "templates" : { + "template-common" : { + "scala" : { + "version" : "2.13.6" + } + } + } +} \ No newline at end of file