From afef326b089ea4b992ef54e8d4e3a8bf67a88185 Mon Sep 17 00:00:00 2001 From: James Santucci Date: Fri, 4 Feb 2022 12:44:04 -0700 Subject: [PATCH 01/37] Run release workflow on this branch --- .github/workflows/release.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3a90ef3..f8cbc42 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,7 +8,9 @@ on: release: types: [published] push: - branches: main + branches: + - main + - test/js/release-on-this-branch jobs: release: From b3ae53db2bd6db8aaaaab800453a9d0f71a0fb2a Mon Sep 17 00:00:00 2001 From: James Santucci Date: Fri, 4 Feb 2022 12:46:17 -0700 Subject: [PATCH 02/37] Show developers in ci-publish --- build.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index d99869b..5830b73 100755 --- a/build.sbt +++ b/build.sbt @@ -9,7 +9,7 @@ addCommandAlias( ";scalafmtCheckAll; scalafmtSbtCheck; +test; +publishLocal; sbt-exercise/scripted" ) addCommandAlias("ci-docs", ";github; mdoc; headerCreateAll") -addCommandAlias("ci-publish", ";github; ci-release") +addCommandAlias("ci-publish", "show developers; github; show develoeprs; ci-release") lazy val V = new { val cats: String = "2.7.0" From c39e46989bd87ffc2e327255103ec1206e4ba80c Mon Sep 17 00:00:00 2001 From: James Santucci Date: Fri, 4 Feb 2022 12:49:19 -0700 Subject: [PATCH 03/37] spelling --- build.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index 5830b73..d6500e4 100755 --- a/build.sbt +++ b/build.sbt @@ -9,7 +9,7 @@ addCommandAlias( ";scalafmtCheckAll; scalafmtSbtCheck; +test; +publishLocal; sbt-exercise/scripted" ) addCommandAlias("ci-docs", ";github; mdoc; headerCreateAll") -addCommandAlias("ci-publish", "show developers; github; show develoeprs; ci-release") +addCommandAlias("ci-publish", "show developers; github; show developers; ci-release") lazy val V = new { val cats: String = "2.7.0" From 54400bbad072d76acd66b12537351fbf7228eb46 Mon Sep 17 00:00:00 2001 From: James Santucci Date: Fri, 4 Feb 2022 13:02:23 -0700 Subject: [PATCH 04/37] turn on debug --- build.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index d6500e4..bb9609c 100755 --- a/build.sbt +++ b/build.sbt @@ -9,7 +9,7 @@ addCommandAlias( ";scalafmtCheckAll; scalafmtSbtCheck; +test; +publishLocal; sbt-exercise/scripted" ) addCommandAlias("ci-docs", ";github; mdoc; headerCreateAll") -addCommandAlias("ci-publish", "show developers; github; show developers; ci-release") +addCommandAlias("ci-publish", "debug; show developers; github; show developers; ci-release") lazy val V = new { val cats: String = "2.7.0" From 81468214103389e6404f466ff8a97a334a9bcf06 Mon Sep 17 00:00:00 2001 From: James Santucci Date: Fri, 4 Feb 2022 13:10:20 -0700 Subject: [PATCH 05/37] less debug somehow i lost a bunch of logs in the GHA run --- build.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index bb9609c..55c2c52 100755 --- a/build.sbt +++ b/build.sbt @@ -9,7 +9,7 @@ addCommandAlias( ";scalafmtCheckAll; scalafmtSbtCheck; +test; +publishLocal; sbt-exercise/scripted" ) addCommandAlias("ci-docs", ";github; mdoc; headerCreateAll") -addCommandAlias("ci-publish", "debug; show developers; github; show developers; ci-release") +addCommandAlias("ci-publish", "show developers; debug; github; debug; show developers; ci-release") lazy val V = new { val cats: String = "2.7.0" From a1183f74bbec98052bf3cf49b4d5e718e908f499 Mon Sep 17 00:00:00 2001 From: James Santucci Date: Fri, 4 Feb 2022 13:15:28 -0700 Subject: [PATCH 06/37] don't actually need to do the release now that i know developers isn't getting set i just want logs for the github action please --- build.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index 55c2c52..16f94b0 100755 --- a/build.sbt +++ b/build.sbt @@ -9,7 +9,7 @@ addCommandAlias( ";scalafmtCheckAll; scalafmtSbtCheck; +test; +publishLocal; sbt-exercise/scripted" ) addCommandAlias("ci-docs", ";github; mdoc; headerCreateAll") -addCommandAlias("ci-publish", "show developers; debug; github; debug; show developers; ci-release") +addCommandAlias("ci-publish", "show developers; debug; github; show developers") lazy val V = new { val cats: String = "2.7.0" From 09dce551e311c8995f7837a89842251676daa479 Mon Sep 17 00:00:00 2001 From: James Santucci Date: Fri, 4 Feb 2022 13:18:08 -0700 Subject: [PATCH 07/37] is debug the problem? does it hate it? --- build.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index 16f94b0..aaa723a 100755 --- a/build.sbt +++ b/build.sbt @@ -9,7 +9,7 @@ addCommandAlias( ";scalafmtCheckAll; scalafmtSbtCheck; +test; +publishLocal; sbt-exercise/scripted" ) addCommandAlias("ci-docs", ";github; mdoc; headerCreateAll") -addCommandAlias("ci-publish", "show developers; debug; github; show developers") +addCommandAlias("ci-publish", "show developers; github; show developers") lazy val V = new { val cats: String = "2.7.0" From 07f3d9754e6dfb51cc06b1815b91c13b41c9c36b Mon Sep 17 00:00:00 2001 From: James Santucci Date: Fri, 4 Feb 2022 13:23:31 -0700 Subject: [PATCH 08/37] more debug printing --- build.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index aaa723a..7600d61 100755 --- a/build.sbt +++ b/build.sbt @@ -9,7 +9,7 @@ addCommandAlias( ";scalafmtCheckAll; scalafmtSbtCheck; +test; +publishLocal; sbt-exercise/scripted" ) addCommandAlias("ci-docs", ";github; mdoc; headerCreateAll") -addCommandAlias("ci-publish", "show developers; github; show developers") +addCommandAlias("ci-publish", "show developers; github; show ThisBuild / githubEnabled; show ThisBuild / collaborators; show developers") lazy val V = new { val cats: String = "2.7.0" From 77b177ade6c1143b0803e27e1cee9fb3ca9da54c Mon Sep 17 00:00:00 2001 From: Juan Pedro Moreno <4879373+juanpedromoreno@users.noreply.github.com> Date: Mon, 7 Feb 2022 09:46:10 +0100 Subject: [PATCH 09/37] Adds at least one developer (#200) --- build.sbt | 1 + 1 file changed, 1 insertion(+) diff --git a/build.sbt b/build.sbt index 7600d61..cc14f03 100755 --- a/build.sbt +++ b/build.sbt @@ -3,6 +3,7 @@ ThisBuild / githubOrganization := "47degrees" ThisBuild / scalaVersion := V.scala212 publish / skip := true +ThisBuild / extraCollaborators += Collaborator.github("47erbot") addCommandAlias( "ci-test", From 63047853947f70e8c4540a1b2f138fefb98c002a Mon Sep 17 00:00:00 2001 From: juanpedromoreno Date: Mon, 7 Feb 2022 08:48:08 +0000 Subject: [PATCH 10/37] Update documentation, and other files [skip ci] --- AUTHORS.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/AUTHORS.md b/AUTHORS.md index 7198300..b013b48 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -8,7 +8,7 @@ The maintainers of the project are: - +- [![47erbot](https://avatars.githubusercontent.com/u/24799081?v=4&s=20) **47erbot**](https://github.com/47erbot) ## Contributors @@ -16,4 +16,5 @@ These are the people that have contributed to the _sbt-exercise_ project: - [![47erbot](https://avatars.githubusercontent.com/u/24799081?v=4&s=20) **47erbot**](https://github.com/47erbot) - [![juanpedromoreno](https://avatars.githubusercontent.com/u/4879373?v=4&s=20) **juanpedromoreno**](https://github.com/juanpedromoreno) -- [![fedefernandez](https://avatars.githubusercontent.com/u/720923?v=4&s=20) **fedefernandez**](https://github.com/fedefernandez) \ No newline at end of file +- [![fedefernandez](https://avatars.githubusercontent.com/u/720923?v=4&s=20) **fedefernandez**](https://github.com/fedefernandez) +- [![jisantuc](https://avatars.githubusercontent.com/u/5702984?v=4&s=20) **jisantuc**](https://github.com/jisantuc) \ No newline at end of file From 73156d7deb909977d054dee6538b4c4fb27873d8 Mon Sep 17 00:00:00 2001 From: James Santucci Date: Tue, 8 Feb 2022 10:16:35 -0700 Subject: [PATCH 11/37] Upgrade scalatest --- build.sbt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/build.sbt b/build.sbt index cc14f03..e8a41ca 100755 --- a/build.sbt +++ b/build.sbt @@ -10,7 +10,12 @@ addCommandAlias( ";scalafmtCheckAll; scalafmtSbtCheck; +test; +publishLocal; sbt-exercise/scripted" ) addCommandAlias("ci-docs", ";github; mdoc; headerCreateAll") -addCommandAlias("ci-publish", "show developers; github; show ThisBuild / githubEnabled; show ThisBuild / collaborators; show developers") +addCommandAlias("ci-publish", ";github; ci-release") + +// Required to prevent errors for eviction from binary incompatible dependency +// resolutions. +// See also: https://github.com/scala-exercises/exercises-cats/pull/267 +ThisBuild / libraryDependencySchemes += "org.scala-lang.modules" %% "scala-xml" % "always" lazy val V = new { val cats: String = "2.7.0" @@ -24,7 +29,7 @@ lazy val V = new { val scalacheckShapeless: String = "1.3.0" val scalamacros: String = "2.1.1" val scalariform: String = "0.2.10" - val scalatest: String = "3.2.10" + val scalatest: String = "3.2.11" } lazy val definitions = (project in file("definitions")) From a1dbc19036519f1f9d315d0979048d0862b5852c Mon Sep 17 00:00:00 2001 From: James Santucci Date: Tue, 8 Feb 2022 10:21:40 -0700 Subject: [PATCH 12/37] Add dependency scheme to sbt-test projects --- sbt-exercise/src/sbt-test/sbt-exercise/basic/build.sbt | 5 +++++ sbt-exercise/src/sbt-test/sbt-exercise/scalariform/build.sbt | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/sbt-exercise/src/sbt-test/sbt-exercise/basic/build.sbt b/sbt-exercise/src/sbt-test/sbt-exercise/basic/build.sbt index 252be70..428d4b5 100644 --- a/sbt-exercise/src/sbt-test/sbt-exercise/basic/build.sbt +++ b/sbt-exercise/src/sbt-test/sbt-exercise/basic/build.sbt @@ -2,6 +2,11 @@ import org.scalaexercises.plugin.sbtexercise.ExerciseCompilerPlugin val pluginVersion = System.getProperty("plugin.version") +// Required to prevent errors for eviction from binary incompatible dependency +// resolutions. +// See also: https://github.com/scala-exercises/exercises-cats/pull/267 +ThisBuild / libraryDependencySchemes += "org.scala-lang.modules" %% "scala-xml" % "always" + lazy val content = (project in file("content")) .enablePlugins(ExerciseCompilerPlugin) .settings( diff --git a/sbt-exercise/src/sbt-test/sbt-exercise/scalariform/build.sbt b/sbt-exercise/src/sbt-test/sbt-exercise/scalariform/build.sbt index 2ccb721..dfe4030 100644 --- a/sbt-exercise/src/sbt-test/sbt-exercise/scalariform/build.sbt +++ b/sbt-exercise/src/sbt-test/sbt-exercise/scalariform/build.sbt @@ -1,5 +1,10 @@ val pluginVersion = System.getProperty("plugin.version") +// Required to prevent errors for eviction from binary incompatible dependency +// resolutions. +// See also: https://github.com/scala-exercises/exercises-cats/pull/267 +ThisBuild / libraryDependencySchemes += "org.scala-lang.modules" %% "scala-xml" % "always" + lazy val root = (project in file(".")) .settings( scalaVersion := "2.12.15", From 64b65704afeb71b643eff548b55067bdfeac699e Mon Sep 17 00:00:00 2001 From: James Santucci Date: Wed, 9 Feb 2022 12:58:03 -0700 Subject: [PATCH 13/37] Exclude updated scala-xml dep --- build.sbt | 23 +++++++++++------------ project/plugins.sbt | 1 + 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/build.sbt b/build.sbt index e8a41ca..2d2b489 100755 --- a/build.sbt +++ b/build.sbt @@ -12,11 +12,6 @@ addCommandAlias( addCommandAlias("ci-docs", ";github; mdoc; headerCreateAll") addCommandAlias("ci-publish", ";github; ci-release") -// Required to prevent errors for eviction from binary incompatible dependency -// resolutions. -// See also: https://github.com/scala-exercises/exercises-cats/pull/267 -ThisBuild / libraryDependencySchemes += "org.scala-lang.modules" %% "scala-xml" % "always" - lazy val V = new { val cats: String = "2.7.0" val collectioncompat: String = "2.6.0" @@ -37,10 +32,12 @@ lazy val definitions = (project in file("definitions")) .settings( crossScalaVersions := Seq(V.scala212, V.scala), libraryDependencies ++= Seq( + "org.scala-lang.modules" %% "scala-xml" % "1.2.0", "org.typelevel" %% "cats-core" % V.cats, - "org.scalatest" %% "scalatest" % V.scalatest, "org.scalacheck" %% "scalacheck" % V.scalacheck, - "com.github.alexarchambault" %% "scalacheck-shapeless_1.15" % V.scalacheckShapeless + "com.github.alexarchambault" %% "scalacheck-shapeless_1.15" % V.scalacheckShapeless, + "org.scalatest" %% "scalatest-core" % V.scalatest exclude ("org.scala-lang.modules", "scala-xml_2.12") exclude ("org.scala-lang.modules", "scala-xml_2.13"), + "org.scalatest" %% "scalatest" % V.scalatest exclude ("org.scala-lang.modules", "scala-xml_2.12") exclude ("org.scala-lang.modules", "scala-xml_2.13") ) ) @@ -51,16 +48,18 @@ lazy val compiler = (project in file("compiler")) crossScalaVersions := Seq(V.scala212, V.scala), scalacOptions -= "-Xfatal-warnings", libraryDependencies ++= Seq( + "org.scala-lang.modules" %% "scala-xml" % "1.2.0", "org.scala-exercises" %% "runtime" % V.runtime exclude ("org.scala-lang.modules", "scala-collection-compat"), - "org.scala-lang" % "scala-compiler" % scalaVersion.value, + "org.scala-lang" % "scala-compiler" % scalaVersion.value exclude ("org.scala-lang.modules", "scala-xml"), "org.scala-lang.modules" %% "scala-collection-compat" % V.collectioncompat, - "org.typelevel" %% "cats-core" % V.cats % Compile, + "org.typelevel" %% "cats-core" % V.cats % Compile, "org.http4s" %% "http4s-blaze-client" % V.http4s, "org.http4s" %% "http4s-circe" % V.http4s, "com.47deg" %% "github4s" % V.github4s, - "org.scalariform" %% "scalariform" % V.scalariform, - "org.typelevel" %% "cats-laws" % V.cats % Test, - "org.scalatest" %% "scalatest" % V.scalatest % Test + "org.scalariform" %% "scalariform" % V.scalariform exclude ("org.scala-lang.modules", "scala-xml"), + "org.typelevel" %% "cats-laws" % V.cats % Test, + "org.scalatest" %% "scalatest-core" % V.scalatest % Test exclude ("org.scala-lang.modules", "scala-xml_2.12"), + "org.scalatest" %% "scalatest" % V.scalatest % Test exclude ("org.scala-lang.modules", "scala-xml_2.12") ) ) .dependsOn(definitions) diff --git a/project/plugins.sbt b/project/plugins.sbt index a11878f..d9ab657 100755 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -8,3 +8,4 @@ addSbtPlugin("com.alejandrohdezma" % "sbt-github-header" % "0.11.2" addSbtPlugin("com.alejandrohdezma" % "sbt-github-mdoc" % "0.11.2") addSbtPlugin("com.alejandrohdezma" % "sbt-remove-test-from-pom" % "0.1.0") addSbtPlugin("io.github.davidgregory084" % "sbt-tpolecat" % "0.1.20") +addDependencyTreePlugin From 56629c5c7f4a7c8404fd69879af24addc36afa5b Mon Sep 17 00:00:00 2001 From: James Santucci Date: Wed, 9 Feb 2022 13:08:14 -0700 Subject: [PATCH 14/37] Remove library schema setting from scripted tests --- sbt-exercise/src/sbt-test/sbt-exercise/basic/build.sbt | 5 ----- sbt-exercise/src/sbt-test/sbt-exercise/scalariform/build.sbt | 5 ----- 2 files changed, 10 deletions(-) diff --git a/sbt-exercise/src/sbt-test/sbt-exercise/basic/build.sbt b/sbt-exercise/src/sbt-test/sbt-exercise/basic/build.sbt index 428d4b5..252be70 100644 --- a/sbt-exercise/src/sbt-test/sbt-exercise/basic/build.sbt +++ b/sbt-exercise/src/sbt-test/sbt-exercise/basic/build.sbt @@ -2,11 +2,6 @@ import org.scalaexercises.plugin.sbtexercise.ExerciseCompilerPlugin val pluginVersion = System.getProperty("plugin.version") -// Required to prevent errors for eviction from binary incompatible dependency -// resolutions. -// See also: https://github.com/scala-exercises/exercises-cats/pull/267 -ThisBuild / libraryDependencySchemes += "org.scala-lang.modules" %% "scala-xml" % "always" - lazy val content = (project in file("content")) .enablePlugins(ExerciseCompilerPlugin) .settings( diff --git a/sbt-exercise/src/sbt-test/sbt-exercise/scalariform/build.sbt b/sbt-exercise/src/sbt-test/sbt-exercise/scalariform/build.sbt index dfe4030..2ccb721 100644 --- a/sbt-exercise/src/sbt-test/sbt-exercise/scalariform/build.sbt +++ b/sbt-exercise/src/sbt-test/sbt-exercise/scalariform/build.sbt @@ -1,10 +1,5 @@ val pluginVersion = System.getProperty("plugin.version") -// Required to prevent errors for eviction from binary incompatible dependency -// resolutions. -// See also: https://github.com/scala-exercises/exercises-cats/pull/267 -ThisBuild / libraryDependencySchemes += "org.scala-lang.modules" %% "scala-xml" % "always" - lazy val root = (project in file(".")) .settings( scalaVersion := "2.12.15", From 3c9099f1e63fc05802ac796a8b5734850267b8d3 Mon Sep 17 00:00:00 2001 From: James Santucci Date: Wed, 9 Feb 2022 13:12:40 -0700 Subject: [PATCH 15/37] restore release yml to prior (managed) state --- .github/workflows/release.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f8cbc42..3a90ef3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,9 +8,7 @@ on: release: types: [published] push: - branches: - - main - - test/js/release-on-this-branch + branches: main jobs: release: From 2db957bf2ef9e8bc6c756ea2b7b15076eb51fd38 Mon Sep 17 00:00:00 2001 From: James Santucci Date: Wed, 9 Feb 2022 13:17:24 -0700 Subject: [PATCH 16/37] Remove dependency tree plugin --- project/plugins.sbt | 1 - 1 file changed, 1 deletion(-) diff --git a/project/plugins.sbt b/project/plugins.sbt index d9ab657..a11878f 100755 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -8,4 +8,3 @@ addSbtPlugin("com.alejandrohdezma" % "sbt-github-header" % "0.11.2" addSbtPlugin("com.alejandrohdezma" % "sbt-github-mdoc" % "0.11.2") addSbtPlugin("com.alejandrohdezma" % "sbt-remove-test-from-pom" % "0.1.0") addSbtPlugin("io.github.davidgregory084" % "sbt-tpolecat" % "0.1.20") -addDependencyTreePlugin From af86dadde14c34c9169c11023bb6981b12b0feaf Mon Sep 17 00:00:00 2001 From: James Santucci Date: Thu, 10 Feb 2022 13:28:20 -0700 Subject: [PATCH 17/37] wip --- build.sbt | 28 +++++++++++-------- project/build.properties | 2 +- project/plugins.sbt | 3 ++ .../sbtexercise/ExerciseCompilerPlugin.scala | 24 +++++----------- .../src/sbt-test/sbt-exercise/basic/build.sbt | 4 +-- 5 files changed, 30 insertions(+), 31 deletions(-) diff --git a/build.sbt b/build.sbt index 2d2b489..d81d16f 100755 --- a/build.sbt +++ b/build.sbt @@ -12,6 +12,12 @@ addCommandAlias( addCommandAlias("ci-docs", ";github; mdoc; headerCreateAll") addCommandAlias("ci-publish", ";github; ci-release") +def scalaVersionSuffix(scalaVersion: String) = CrossVersion.partialVersion(scalaVersion) match { + case Some((2, 12)) => "2.12" + case Some((2, 13)) => "2.13" + case s => throw new Exception("$s") +} + lazy val V = new { val cats: String = "2.7.0" val collectioncompat: String = "2.6.0" @@ -32,13 +38,13 @@ lazy val definitions = (project in file("definitions")) .settings( crossScalaVersions := Seq(V.scala212, V.scala), libraryDependencies ++= Seq( - "org.scala-lang.modules" %% "scala-xml" % "1.2.0", "org.typelevel" %% "cats-core" % V.cats, "org.scalacheck" %% "scalacheck" % V.scalacheck, "com.github.alexarchambault" %% "scalacheck-shapeless_1.15" % V.scalacheckShapeless, - "org.scalatest" %% "scalatest-core" % V.scalatest exclude ("org.scala-lang.modules", "scala-xml_2.12") exclude ("org.scala-lang.modules", "scala-xml_2.13"), - "org.scalatest" %% "scalatest" % V.scalatest exclude ("org.scala-lang.modules", "scala-xml_2.12") exclude ("org.scala-lang.modules", "scala-xml_2.13") - ) + "org.scalatest" %% "scalatest-core" % V.scalatest, + "org.scalatest" %% "scalatest" % V.scalatest + ), + dependencyOverrides += "org.scala-lang.modules" %% "scala-xml" % "2.0.1" ) lazy val compiler = (project in file("compiler")) @@ -48,19 +54,19 @@ lazy val compiler = (project in file("compiler")) crossScalaVersions := Seq(V.scala212, V.scala), scalacOptions -= "-Xfatal-warnings", libraryDependencies ++= Seq( - "org.scala-lang.modules" %% "scala-xml" % "1.2.0", "org.scala-exercises" %% "runtime" % V.runtime exclude ("org.scala-lang.modules", "scala-collection-compat"), - "org.scala-lang" % "scala-compiler" % scalaVersion.value exclude ("org.scala-lang.modules", "scala-xml"), + "org.scala-lang" % "scala-compiler" % scalaVersion.value, "org.scala-lang.modules" %% "scala-collection-compat" % V.collectioncompat, "org.typelevel" %% "cats-core" % V.cats % Compile, "org.http4s" %% "http4s-blaze-client" % V.http4s, "org.http4s" %% "http4s-circe" % V.http4s, "com.47deg" %% "github4s" % V.github4s, - "org.scalariform" %% "scalariform" % V.scalariform exclude ("org.scala-lang.modules", "scala-xml"), - "org.typelevel" %% "cats-laws" % V.cats % Test, - "org.scalatest" %% "scalatest-core" % V.scalatest % Test exclude ("org.scala-lang.modules", "scala-xml_2.12"), - "org.scalatest" %% "scalatest" % V.scalatest % Test exclude ("org.scala-lang.modules", "scala-xml_2.12") - ) + "org.scalariform" %% "scalariform" % V.scalariform, + "org.typelevel" %% "cats-laws" % V.cats % Test, + "org.scalatest" %% "scalatest-core" % V.scalatest % Test, + "org.scalatest" %% "scalatest" % V.scalatest % Test + ), + dependencyOverrides += "org.scala-lang.modules" %% "scala-xml" % "2.0.1" ) .dependsOn(definitions) diff --git a/project/build.properties b/project/build.properties index 3161d21..e018b89 100755 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=1.6.1 +sbt.version=1.3.3 \ No newline at end of file diff --git a/project/plugins.sbt b/project/plugins.sbt index a11878f..908703b 100755 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -8,3 +8,6 @@ addSbtPlugin("com.alejandrohdezma" % "sbt-github-header" % "0.11.2" addSbtPlugin("com.alejandrohdezma" % "sbt-github-mdoc" % "0.11.2") addSbtPlugin("com.alejandrohdezma" % "sbt-remove-test-from-pom" % "0.1.0") addSbtPlugin("io.github.davidgregory084" % "sbt-tpolecat" % "0.1.20") +addSbtPlugin("ch.epfl.scala" % "sbt-missinglink" % "0.3.3") + +libraryDependencies += "com.spotify" % "missinglink-core" % "0.2.5" diff --git a/sbt-exercise/src/main/scala/org/scalaexercises/exercises/sbtexercise/ExerciseCompilerPlugin.scala b/sbt-exercise/src/main/scala/org/scalaexercises/exercises/sbtexercise/ExerciseCompilerPlugin.scala index 323d22c..5217620 100644 --- a/sbt-exercise/src/main/scala/org/scalaexercises/exercises/sbtexercise/ExerciseCompilerPlugin.scala +++ b/sbt-exercise/src/main/scala/org/scalaexercises/exercises/sbtexercise/ExerciseCompilerPlugin.scala @@ -26,16 +26,14 @@ import java.io.PrintStream import sbt.{`package` => _, _} import sbt.Keys._ import xsbt.api.Discovery -import java.nio.file.Paths import cats.{`package` => _} import cats.data.Ior import cats.implicits._ import sbt.internal.inc.Analysis -import sbt.internal.inc.classpath.ClasspathUtil +import sbt.internal.inc.classpath.ClasspathUtilities import sbtbuildinfo.BuildInfoPlugin import sbtbuildinfo.BuildInfoPlugin.autoImport._ import xsbti.compile.CompileAnalysis -import _root_.java.nio.file.Paths /** The exercise compiler SBT auto plugin */ object ExerciseCompilerPlugin extends AutoPlugin { @@ -167,12 +165,12 @@ object ExerciseCompilerPlugin extends AutoPlugin { val libraryClasspath = Attributed.data((Compile / fullClasspath).value) val classpath = (Meta.compilerClasspath ++ libraryClasspath).distinct - val loader = ClasspathUtil.toLoader( - classpath.map(file => Paths.get(file.getAbsolutePath())), + val loader = ClasspathUtilities.toLoader( + classpath, null, - ClasspathUtil.createClasspathResources( - appPaths = Meta.compilerClasspath.map(file => Paths.get(file.getAbsolutePath())), - bootPaths = scalaInstance.value.allJars.map(file => Paths.get(file.getAbsolutePath())) + ClasspathUtilities.createClasspathResources( + appPaths = Meta.compilerClasspath, + bootPaths = scalaInstance.value.allJars ) ) @@ -212,15 +210,7 @@ object ExerciseCompilerPlugin extends AutoPlugin { .flatMap(analysisIn match { case analysis: Analysis => analysis.relations.definesClass }) - .map { file => - ( - file.name(), - IO.read( - new File( - (baseDir.getParentFile() +: file.names().tail).mkString("/") - ) - ) - ) + .map { file => (file.getPath, IO.read(file)) } captureStdStreams( diff --git a/sbt-exercise/src/sbt-test/sbt-exercise/basic/build.sbt b/sbt-exercise/src/sbt-test/sbt-exercise/basic/build.sbt index 252be70..541c18f 100644 --- a/sbt-exercise/src/sbt-test/sbt-exercise/basic/build.sbt +++ b/sbt-exercise/src/sbt-test/sbt-exercise/basic/build.sbt @@ -11,7 +11,7 @@ lazy val content = (project in file("content")) Resolver.defaultLocal ), libraryDependencies ++= Seq( - "org.scala-exercises" %% "runtime" % "0.6.0", + "org.scala-exercises" %% "runtime" % "0.7.0", "org.scala-exercises" %% "exercise-compiler" % pluginVersion changing (), "org.scala-exercises" %% "definitions" % pluginVersion changing () ) @@ -26,7 +26,7 @@ lazy val contentInPackages = (project in file("contentinpackages")) Resolver.defaultLocal ), libraryDependencies ++= Seq( - "org.scala-exercises" %% "runtime" % "0.6.0", + "org.scala-exercises" %% "runtime" % "0.7.0", "org.scala-exercises" %% "exercise-compiler" % pluginVersion changing (), "org.scala-exercises" %% "definitions" % pluginVersion changing () ) From da82008cf899cb05746f48afded9e571f65d7974 Mon Sep 17 00:00:00 2001 From: James Santucci Date: Thu, 10 Feb 2022 13:43:39 -0700 Subject: [PATCH 18/37] Back to 1.6.1 --- project/build.properties | 2 +- .../sbtexercise/ExerciseCompilerPlugin.scala | 24 +++++++++++++------ 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/project/build.properties b/project/build.properties index e018b89..203e3dc 100755 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=1.3.3 \ No newline at end of file +sbt.version=1.6.1 \ No newline at end of file diff --git a/sbt-exercise/src/main/scala/org/scalaexercises/exercises/sbtexercise/ExerciseCompilerPlugin.scala b/sbt-exercise/src/main/scala/org/scalaexercises/exercises/sbtexercise/ExerciseCompilerPlugin.scala index 5217620..323d22c 100644 --- a/sbt-exercise/src/main/scala/org/scalaexercises/exercises/sbtexercise/ExerciseCompilerPlugin.scala +++ b/sbt-exercise/src/main/scala/org/scalaexercises/exercises/sbtexercise/ExerciseCompilerPlugin.scala @@ -26,14 +26,16 @@ import java.io.PrintStream import sbt.{`package` => _, _} import sbt.Keys._ import xsbt.api.Discovery +import java.nio.file.Paths import cats.{`package` => _} import cats.data.Ior import cats.implicits._ import sbt.internal.inc.Analysis -import sbt.internal.inc.classpath.ClasspathUtilities +import sbt.internal.inc.classpath.ClasspathUtil import sbtbuildinfo.BuildInfoPlugin import sbtbuildinfo.BuildInfoPlugin.autoImport._ import xsbti.compile.CompileAnalysis +import _root_.java.nio.file.Paths /** The exercise compiler SBT auto plugin */ object ExerciseCompilerPlugin extends AutoPlugin { @@ -165,12 +167,12 @@ object ExerciseCompilerPlugin extends AutoPlugin { val libraryClasspath = Attributed.data((Compile / fullClasspath).value) val classpath = (Meta.compilerClasspath ++ libraryClasspath).distinct - val loader = ClasspathUtilities.toLoader( - classpath, + val loader = ClasspathUtil.toLoader( + classpath.map(file => Paths.get(file.getAbsolutePath())), null, - ClasspathUtilities.createClasspathResources( - appPaths = Meta.compilerClasspath, - bootPaths = scalaInstance.value.allJars + ClasspathUtil.createClasspathResources( + appPaths = Meta.compilerClasspath.map(file => Paths.get(file.getAbsolutePath())), + bootPaths = scalaInstance.value.allJars.map(file => Paths.get(file.getAbsolutePath())) ) ) @@ -210,7 +212,15 @@ object ExerciseCompilerPlugin extends AutoPlugin { .flatMap(analysisIn match { case analysis: Analysis => analysis.relations.definesClass }) - .map { file => (file.getPath, IO.read(file)) + .map { file => + ( + file.name(), + IO.read( + new File( + (baseDir.getParentFile() +: file.names().tail).mkString("/") + ) + ) + ) } captureStdStreams( From 846f9e97e27937ebaaf30ea647e634f7cf156270 Mon Sep 17 00:00:00 2001 From: James Santucci Date: Thu, 10 Feb 2022 14:12:43 -0700 Subject: [PATCH 19/37] Wait is collection-compat GOOD actually --- build.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index d81d16f..ad75b49 100755 --- a/build.sbt +++ b/build.sbt @@ -54,7 +54,7 @@ lazy val compiler = (project in file("compiler")) crossScalaVersions := Seq(V.scala212, V.scala), scalacOptions -= "-Xfatal-warnings", libraryDependencies ++= Seq( - "org.scala-exercises" %% "runtime" % V.runtime exclude ("org.scala-lang.modules", "scala-collection-compat"), + "org.scala-exercises" %% "runtime" % V.runtime, "org.scala-lang" % "scala-compiler" % scalaVersion.value, "org.scala-lang.modules" %% "scala-collection-compat" % V.collectioncompat, "org.typelevel" %% "cats-core" % V.cats % Compile, From 89e7c04081c534c64dba32b377ac01256339a247 Mon Sep 17 00:00:00 2001 From: James Santucci Date: Thu, 10 Feb 2022 14:15:16 -0700 Subject: [PATCH 20/37] Remove explicit collection-compat dep --- build.sbt | 1 - 1 file changed, 1 deletion(-) diff --git a/build.sbt b/build.sbt index ad75b49..921591e 100755 --- a/build.sbt +++ b/build.sbt @@ -56,7 +56,6 @@ lazy val compiler = (project in file("compiler")) libraryDependencies ++= Seq( "org.scala-exercises" %% "runtime" % V.runtime, "org.scala-lang" % "scala-compiler" % scalaVersion.value, - "org.scala-lang.modules" %% "scala-collection-compat" % V.collectioncompat, "org.typelevel" %% "cats-core" % V.cats % Compile, "org.http4s" %% "http4s-blaze-client" % V.http4s, "org.http4s" %% "http4s-circe" % V.http4s, From 1cdc8b7ced1ecd2b501a05795be27b325deaeeb8 Mon Sep 17 00:00:00 2001 From: James Santucci Date: Thu, 10 Feb 2022 14:55:32 -0700 Subject: [PATCH 21/37] Declare all dependencies --- build.sbt | 60 ++++++++++++++----- .../compiler/SourceTextExtraction.scala | 3 +- project/plugins.sbt | 3 + 3 files changed, 48 insertions(+), 18 deletions(-) diff --git a/build.sbt b/build.sbt index 921591e..db2651d 100755 --- a/build.sbt +++ b/build.sbt @@ -20,10 +20,12 @@ def scalaVersionSuffix(scalaVersion: String) = CrossVersion.partialVersion(scala lazy val V = new { val cats: String = "2.7.0" + val catsEffect: String = "3.3.4" val collectioncompat: String = "2.6.0" val github4s: String = "0.30.0" val http4s: String = "0.23.8" val runtime: String = "0.7.0" + val sbtIO = "1.6.0" val scala: String = "2.13.8" val scala212: String = "2.12.15" val scalacheck: String = "1.15.4" @@ -31,18 +33,20 @@ lazy val V = new { val scalamacros: String = "2.1.1" val scalariform: String = "0.2.10" val scalatest: String = "3.2.11" + val scalaXml: String = "2.0.1" + val shapeless: String = "2.3.7" } lazy val definitions = (project in file("definitions")) .settings(name := "definitions") .settings( - crossScalaVersions := Seq(V.scala212, V.scala), + crossScalaVersions := Seq(V.scala), libraryDependencies ++= Seq( "org.typelevel" %% "cats-core" % V.cats, "org.scalacheck" %% "scalacheck" % V.scalacheck, "com.github.alexarchambault" %% "scalacheck-shapeless_1.15" % V.scalacheckShapeless, "org.scalatest" %% "scalatest-core" % V.scalatest, - "org.scalatest" %% "scalatest" % V.scalatest + "com.chuusai" %% "shapeless" % V.shapeless ), dependencyOverrides += "org.scala-lang.modules" %% "scala-xml" % "2.0.1" ) @@ -51,21 +55,27 @@ lazy val compiler = (project in file("compiler")) .settings(name := "exercise-compiler") .settings( exportJars := true, - crossScalaVersions := Seq(V.scala212, V.scala), + crossScalaVersions := Seq(V.scala), scalacOptions -= "-Xfatal-warnings", libraryDependencies ++= Seq( - "org.scala-exercises" %% "runtime" % V.runtime, - "org.scala-lang" % "scala-compiler" % scalaVersion.value, - "org.typelevel" %% "cats-core" % V.cats % Compile, - "org.http4s" %% "http4s-blaze-client" % V.http4s, - "org.http4s" %% "http4s-circe" % V.http4s, - "com.47deg" %% "github4s" % V.github4s, - "org.scalariform" %% "scalariform" % V.scalariform, - "org.typelevel" %% "cats-laws" % V.cats % Test, - "org.scalatest" %% "scalatest-core" % V.scalatest % Test, - "org.scalatest" %% "scalatest" % V.scalatest % Test + "org.scala-exercises" %% "runtime" % V.runtime, + "org.scala-lang" % "scala-compiler" % scalaVersion.value, + "org.scala-lang" % "scala-reflect" % scalaVersion.value, + "org.scala-lang.modules" %% "scala-xml" % V.scalaXml, + "org.typelevel" %% "cats-core" % V.cats % Compile, + "org.http4s" %% "http4s-blaze-client" % V.http4s, + "org.http4s" %% "http4s-client" % V.http4s, + "com.47deg" %% "github4s" % V.github4s, + "org.scalariform" %% "scalariform" % V.scalariform, + "org.typelevel" %% "cats-kernel" % V.cats, + "org.typelevel" %% "cats-laws" % V.cats % Test, + "org.typelevel" %% "cats-effect" % V.catsEffect, + "org.typelevel" %% "cats-effect-kernel" % V.catsEffect, + "org.scalatest" %% "scalatest-core" % V.scalatest % Test, + "org.scalatest" %% "scalatest" % V.scalatest % Test ), - dependencyOverrides += "org.scala-lang.modules" %% "scala-xml" % "2.0.1" + dependencyOverrides += "org.scala-lang.modules" %% "scala-xml" % "2.0.1", + unusedCompileDependenciesFilter -= moduleFilter("org.scala-lang", "scala-compiler") ) .dependsOn(definitions) @@ -76,8 +86,26 @@ lazy val `sbt-exercise` = (project in file("sbt-exercise")) .settings( scalacOptions -= "-Xfatal-warnings", scalacOptions += "-Ypartial-unification", - libraryDependencies += "org.typelevel" %% "cats-core" % V.cats % Compile, - addCompilerPlugin("org.scalamacros" % "paradise" % V.scalamacros cross CrossVersion.full), + libraryDependencies ++= Seq( + "org.scala-sbt" %% "actions" % sbtVersion.value, + "org.scala-sbt" %% "collections" % sbtVersion.value, + "org.scala-sbt" % "compiler-interface" % sbtVersion.value, + "org.scala-sbt" %% "core-macros" % sbtVersion.value, + "org.scala-sbt" %% "io" % V.sbtIO, + "org.scala-sbt" %% "librarymanagement-core" % sbtVersion.value, + "org.scala-sbt" %% "main" % sbtVersion.value, + "org.scala-sbt" %% "main-settings" % sbtVersion.value, + "org.scala-sbt" % "sbt" % sbtVersion.value, + "org.scala-sbt" %% "task-system" % sbtVersion.value, + "org.scala-sbt" %% "util-logging" % sbtVersion.value, + "org.scala-sbt" %% "util-position" % sbtVersion.value, + "org.scala-sbt" %% "zinc-apiinfo" % sbtVersion.value, + "org.scala-sbt" %% "zinc-classpath" % sbtVersion.value, + "org.scala-sbt" %% "zinc-core" % sbtVersion.value, + "org.typelevel" %% "cats-core" % V.cats, + "org.typelevel" %% "cats-kernel" % V.cats + ), + // addCompilerPlugin("org.scalamacros" % "paradise" % V.scalamacros cross CrossVersion.full), // Leverage build info to populate compiler classpath-- compilerClasspath := { (compiler / Compile / fullClasspath) }.value, buildInfoObject := "Meta", diff --git a/compiler/src/main/scala/org/scalaexercises/exercises/compiler/SourceTextExtraction.scala b/compiler/src/main/scala/org/scalaexercises/exercises/compiler/SourceTextExtraction.scala index 3c89a05..526cf50 100644 --- a/compiler/src/main/scala/org/scalaexercises/exercises/compiler/SourceTextExtraction.scala +++ b/compiler/src/main/scala/org/scalaexercises/exercises/compiler/SourceTextExtraction.scala @@ -21,7 +21,6 @@ import java.io.File import org.scalaexercises.exercises.compiler.CompilerSettings import scala.annotation.tailrec -import scala.collection.compat._ import scala.reflect.internal.util.BatchSourceFile import scala.tools.nsc._ import scala.tools.nsc.doc.{Settings => _, _} @@ -91,7 +90,7 @@ class SourceTextExtraction { val rawImports = extraction.imports val paths = rawImports.map(expandPath) - val imports = paths.groupBy(_._1).view.mapValues(_.map(_._2)).toMap + val imports = paths.groupBy(_._1).mapValues(_.map(_._2)).toMap val methods = extraction.methods.map(expandPath).map { case (k, v) => lazy val methodImports = k diff --git a/project/plugins.sbt b/project/plugins.sbt index 908703b..9ad9b19 100755 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -9,5 +9,8 @@ addSbtPlugin("com.alejandrohdezma" % "sbt-github-mdoc" % "0.11.2" addSbtPlugin("com.alejandrohdezma" % "sbt-remove-test-from-pom" % "0.1.0") addSbtPlugin("io.github.davidgregory084" % "sbt-tpolecat" % "0.1.20") addSbtPlugin("ch.epfl.scala" % "sbt-missinglink" % "0.3.3") +addSbtPlugin("com.github.cb372" % "sbt-explicit-dependencies" % "0.2.16") libraryDependencies += "com.spotify" % "missinglink-core" % "0.2.5" + +addDependencyTreePlugin From e6bf356e40e2f88e1ee8c3496fd4645900a21252 Mon Sep 17 00:00:00 2001 From: James Santucci Date: Thu, 10 Feb 2022 15:11:28 -0700 Subject: [PATCH 22/37] don't tail??? --- .../exercises/sbtexercise/ExerciseCompilerPlugin.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbt-exercise/src/main/scala/org/scalaexercises/exercises/sbtexercise/ExerciseCompilerPlugin.scala b/sbt-exercise/src/main/scala/org/scalaexercises/exercises/sbtexercise/ExerciseCompilerPlugin.scala index 323d22c..4f26549 100644 --- a/sbt-exercise/src/main/scala/org/scalaexercises/exercises/sbtexercise/ExerciseCompilerPlugin.scala +++ b/sbt-exercise/src/main/scala/org/scalaexercises/exercises/sbtexercise/ExerciseCompilerPlugin.scala @@ -217,7 +217,7 @@ object ExerciseCompilerPlugin extends AutoPlugin { file.name(), IO.read( new File( - (baseDir.getParentFile() +: file.names().tail).mkString("/") + (baseDir.getParentFile() +: file.names()).mkString("/") ) ) ) From a3ad2f8b80d9605c6075e3f117fe6da8628356d2 Mon Sep 17 00:00:00 2001 From: James Santucci Date: Thu, 10 Feb 2022 15:35:35 -0700 Subject: [PATCH 23/37] include basedir name --- .../exercises/sbtexercise/ExerciseCompilerPlugin.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbt-exercise/src/main/scala/org/scalaexercises/exercises/sbtexercise/ExerciseCompilerPlugin.scala b/sbt-exercise/src/main/scala/org/scalaexercises/exercises/sbtexercise/ExerciseCompilerPlugin.scala index 4f26549..3d6f96a 100644 --- a/sbt-exercise/src/main/scala/org/scalaexercises/exercises/sbtexercise/ExerciseCompilerPlugin.scala +++ b/sbt-exercise/src/main/scala/org/scalaexercises/exercises/sbtexercise/ExerciseCompilerPlugin.scala @@ -217,7 +217,7 @@ object ExerciseCompilerPlugin extends AutoPlugin { file.name(), IO.read( new File( - (baseDir.getParentFile() +: file.names()).mkString("/") + (baseDir.getParentFile() +: baseDir.name +: file.names().tail).mkString("/") ) ) ) From 2c725374849b77191cd504a140f80ed02371dbbe Mon Sep 17 00:00:00 2001 From: James Santucci Date: Thu, 10 Feb 2022 15:39:12 -0700 Subject: [PATCH 24/37] Add sbt-explicit-dependencies and sbt-missinglink --- project/plugins.sbt | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/project/plugins.sbt b/project/plugins.sbt index 9ad9b19..4f4a51e 100755 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,15 +1,15 @@ -addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.10.0") -addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.2.24") -addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.6") -addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.10") -addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.6.0") -addSbtPlugin("com.alejandrohdezma" % "sbt-github" % "0.11.2") -addSbtPlugin("com.alejandrohdezma" % "sbt-github-header" % "0.11.2") -addSbtPlugin("com.alejandrohdezma" % "sbt-github-mdoc" % "0.11.2") -addSbtPlugin("com.alejandrohdezma" % "sbt-remove-test-from-pom" % "0.1.0") -addSbtPlugin("io.github.davidgregory084" % "sbt-tpolecat" % "0.1.20") -addSbtPlugin("ch.epfl.scala" % "sbt-missinglink" % "0.3.3") -addSbtPlugin("com.github.cb372" % "sbt-explicit-dependencies" % "0.2.16") +addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.10.0") +addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.2.24") +addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.6") +addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.10") +addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.6.0") +addSbtPlugin("com.alejandrohdezma" % "sbt-github" % "0.11.2") +addSbtPlugin("com.alejandrohdezma" % "sbt-github-header" % "0.11.2") +addSbtPlugin("com.alejandrohdezma" % "sbt-github-mdoc" % "0.11.2") +addSbtPlugin("com.alejandrohdezma" % "sbt-remove-test-from-pom" % "0.1.0") +addSbtPlugin("io.github.davidgregory084" % "sbt-tpolecat" % "0.1.20") +addSbtPlugin("ch.epfl.scala" % "sbt-missinglink" % "0.3.3") +addSbtPlugin("com.github.cb372" % "sbt-explicit-dependencies" % "0.2.16") libraryDependencies += "com.spotify" % "missinglink-core" % "0.2.5" From 0e7c1c7e52ae820465dc37a97a109da195486e4a Mon Sep 17 00:00:00 2001 From: James Santucci Date: Thu, 10 Feb 2022 15:42:41 -0700 Subject: [PATCH 25/37] Remove dependency tree plugin --- project/plugins.sbt | 2 -- 1 file changed, 2 deletions(-) diff --git a/project/plugins.sbt b/project/plugins.sbt index 4f4a51e..939a060 100755 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -12,5 +12,3 @@ addSbtPlugin("ch.epfl.scala" % "sbt-missinglink" % "0.3.3" addSbtPlugin("com.github.cb372" % "sbt-explicit-dependencies" % "0.2.16") libraryDependencies += "com.spotify" % "missinglink-core" % "0.2.5" - -addDependencyTreePlugin From 14ca1e937425123a960aa4eeced03ae8efd0d45b Mon Sep 17 00:00:00 2001 From: James Santucci Date: Thu, 10 Feb 2022 15:47:34 -0700 Subject: [PATCH 26/37] Add dependency override to test projects --- sbt-exercise/src/sbt-test/sbt-exercise/basic/build.sbt | 6 ++++-- .../src/sbt-test/sbt-exercise/scalariform/build.sbt | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/sbt-exercise/src/sbt-test/sbt-exercise/basic/build.sbt b/sbt-exercise/src/sbt-test/sbt-exercise/basic/build.sbt index 541c18f..396a731 100644 --- a/sbt-exercise/src/sbt-test/sbt-exercise/basic/build.sbt +++ b/sbt-exercise/src/sbt-test/sbt-exercise/basic/build.sbt @@ -14,7 +14,8 @@ lazy val content = (project in file("content")) "org.scala-exercises" %% "runtime" % "0.7.0", "org.scala-exercises" %% "exercise-compiler" % pluginVersion changing (), "org.scala-exercises" %% "definitions" % pluginVersion changing () - ) + ), + dependencyOverrides += "org.scala-lang.modules" %% "scala-xml" % "2.0.1" ) lazy val contentInPackages = (project in file("contentinpackages")) @@ -29,7 +30,8 @@ lazy val contentInPackages = (project in file("contentinpackages")) "org.scala-exercises" %% "runtime" % "0.7.0", "org.scala-exercises" %% "exercise-compiler" % pluginVersion changing (), "org.scala-exercises" %% "definitions" % pluginVersion changing () - ) + ), + dependencyOverrides += "org.scala-lang.modules" %% "scala-xml" % "2.0.1" ) lazy val check = (project in file("check")) diff --git a/sbt-exercise/src/sbt-test/sbt-exercise/scalariform/build.sbt b/sbt-exercise/src/sbt-test/sbt-exercise/scalariform/build.sbt index 2ccb721..42dba38 100644 --- a/sbt-exercise/src/sbt-test/sbt-exercise/scalariform/build.sbt +++ b/sbt-exercise/src/sbt-test/sbt-exercise/scalariform/build.sbt @@ -9,6 +9,7 @@ lazy val root = (project in file(".")) ), libraryDependencies ++= Seq( "org.scala-exercises" %% "exercise-compiler" % pluginVersion changing () - ) + ), + dependencyOverrides += "org.scala-lang.modules" %% "scala-xml" % "2.0.1" ) .enablePlugins(ExerciseCompilerPlugin) From ed1631ed495390d2cb813ca1186e13dfd9783e48 Mon Sep 17 00:00:00 2001 From: James Santucci Date: Thu, 10 Feb 2022 16:03:04 -0700 Subject: [PATCH 27/37] test in macos to verify filesystem differences --- .github/workflows/ci.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8ec8a0b..f3ba12b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,10 @@ on: jobs: test: if: "!contains(github.event.head_commit.message, 'skip ci')" - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [macos-latest, ubuntu-latest] steps: - name: Checkout project (pull-request) if: github.event_name == 'pull_request' From faea8c30cf798ae45738ae7771300b3cfed1021e Mon Sep 17 00:00:00 2001 From: James Santucci Date: Thu, 10 Feb 2022 16:11:27 -0700 Subject: [PATCH 28/37] Revert "test in macos to verify filesystem differences" This reverts commit ed1631ed495390d2cb813ca1186e13dfd9783e48. See https://github.com/47degrees/.github/issues/109 --- .github/workflows/ci.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f3ba12b..8ec8a0b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,10 +12,7 @@ on: jobs: test: if: "!contains(github.event.head_commit.message, 'skip ci')" - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [macos-latest, ubuntu-latest] + runs-on: ubuntu-latest steps: - name: Checkout project (pull-request) if: github.event_name == 'pull_request' From b37046adaed09b48ff9c771cc4e62f967926c915 Mon Sep 17 00:00:00 2001 From: James Santucci Date: Thu, 10 Feb 2022 16:12:04 -0700 Subject: [PATCH 29/37] confirm this would be fine if filesystems agreed --- .../exercises/sbtexercise/ExerciseCompilerPlugin.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbt-exercise/src/main/scala/org/scalaexercises/exercises/sbtexercise/ExerciseCompilerPlugin.scala b/sbt-exercise/src/main/scala/org/scalaexercises/exercises/sbtexercise/ExerciseCompilerPlugin.scala index 3d6f96a..323d22c 100644 --- a/sbt-exercise/src/main/scala/org/scalaexercises/exercises/sbtexercise/ExerciseCompilerPlugin.scala +++ b/sbt-exercise/src/main/scala/org/scalaexercises/exercises/sbtexercise/ExerciseCompilerPlugin.scala @@ -217,7 +217,7 @@ object ExerciseCompilerPlugin extends AutoPlugin { file.name(), IO.read( new File( - (baseDir.getParentFile() +: baseDir.name +: file.names().tail).mkString("/") + (baseDir.getParentFile() +: file.names().tail).mkString("/") ) ) ) From 9bf6675a05d92ac5b8973f0ceda129c09895ca53 Mon Sep 17 00:00:00 2001 From: James Santucci Date: Thu, 10 Feb 2022 16:16:23 -0700 Subject: [PATCH 30/37] Add just one more dependency override to test projects --- sbt-exercise/src/sbt-test/sbt-exercise/basic/build.sbt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sbt-exercise/src/sbt-test/sbt-exercise/basic/build.sbt b/sbt-exercise/src/sbt-test/sbt-exercise/basic/build.sbt index 396a731..9ddb18f 100644 --- a/sbt-exercise/src/sbt-test/sbt-exercise/basic/build.sbt +++ b/sbt-exercise/src/sbt-test/sbt-exercise/basic/build.sbt @@ -41,5 +41,6 @@ lazy val check = (project in file("check")) resolvers ++= Seq( Resolver.sonatypeRepo("snapshots"), Resolver.defaultLocal - ) + ), + dependencyOverrides += "org.scala-lang.modules" %% "scala-xml" % "2.0.1" ) From 6c100ac0e508e77dc6745ebdb759892a578e087e Mon Sep 17 00:00:00 2001 From: James Santucci Date: Fri, 11 Feb 2022 11:13:39 -0700 Subject: [PATCH 31/37] remove unused --- build.sbt | 7 ------- 1 file changed, 7 deletions(-) diff --git a/build.sbt b/build.sbt index db2651d..2f904e6 100755 --- a/build.sbt +++ b/build.sbt @@ -12,16 +12,9 @@ addCommandAlias( addCommandAlias("ci-docs", ";github; mdoc; headerCreateAll") addCommandAlias("ci-publish", ";github; ci-release") -def scalaVersionSuffix(scalaVersion: String) = CrossVersion.partialVersion(scalaVersion) match { - case Some((2, 12)) => "2.12" - case Some((2, 13)) => "2.13" - case s => throw new Exception("$s") -} - lazy val V = new { val cats: String = "2.7.0" val catsEffect: String = "3.3.4" - val collectioncompat: String = "2.6.0" val github4s: String = "0.30.0" val http4s: String = "0.23.8" val runtime: String = "0.7.0" From 7ddc52bed60d9287a52c6933d4ca4489b042fc10 Mon Sep 17 00:00:00 2001 From: James Santucci Date: Fri, 11 Feb 2022 11:18:07 -0700 Subject: [PATCH 32/37] restore lib x-publication for scala 212 --- build.sbt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.sbt b/build.sbt index 2f904e6..e11685e 100755 --- a/build.sbt +++ b/build.sbt @@ -33,7 +33,7 @@ lazy val V = new { lazy val definitions = (project in file("definitions")) .settings(name := "definitions") .settings( - crossScalaVersions := Seq(V.scala), + crossScalaVersions := Seq(V.scala, V.scala212), libraryDependencies ++= Seq( "org.typelevel" %% "cats-core" % V.cats, "org.scalacheck" %% "scalacheck" % V.scalacheck, @@ -48,7 +48,7 @@ lazy val compiler = (project in file("compiler")) .settings(name := "exercise-compiler") .settings( exportJars := true, - crossScalaVersions := Seq(V.scala), + crossScalaVersions := Seq(V.scala, V.scala212), scalacOptions -= "-Xfatal-warnings", libraryDependencies ++= Seq( "org.scala-exercises" %% "runtime" % V.runtime, From 7c1e48e1548b4a336a9a265556a82b5b420a457f Mon Sep 17 00:00:00 2001 From: James Santucci Date: Fri, 11 Feb 2022 11:18:36 -0700 Subject: [PATCH 33/37] add scala-xml dep override to plugin project --- build.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index e11685e..d7dee98 100755 --- a/build.sbt +++ b/build.sbt @@ -98,7 +98,7 @@ lazy val `sbt-exercise` = (project in file("sbt-exercise")) "org.typelevel" %% "cats-core" % V.cats, "org.typelevel" %% "cats-kernel" % V.cats ), - // addCompilerPlugin("org.scalamacros" % "paradise" % V.scalamacros cross CrossVersion.full), + dependencyOverrides += "org.scala-lang.modules" %% "scala-xml" % "1.0.6", // Leverage build info to populate compiler classpath-- compilerClasspath := { (compiler / Compile / fullClasspath) }.value, buildInfoObject := "Meta", From 23116313e687920a178b731a2e6a7acd401dae6b Mon Sep 17 00:00:00 2001 From: James Santucci Date: Mon, 14 Feb 2022 14:03:00 -0700 Subject: [PATCH 34/37] remove commented tail of deps --- .../scala/org/scalaexercises/exercises/compiler/Compiler.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/src/main/scala/org/scalaexercises/exercises/compiler/Compiler.scala b/compiler/src/main/scala/org/scalaexercises/exercises/compiler/Compiler.scala index 27f2012..75b07eb 100644 --- a/compiler/src/main/scala/org/scalaexercises/exercises/compiler/Compiler.scala +++ b/compiler/src/main/scala/org/scalaexercises/exercises/compiler/Compiler.scala @@ -290,7 +290,7 @@ case class Compiler() { val libraryAsDependency = s"${buildMetaInfo.organization}:${buildMetaInfo.name}_${buildMetaInfo.scalaVersion .substring(0, 4)}:${buildMetaInfo.version}" - List(libraryAsDependency) // :: buildMetaInfo.libraryDependencies.toList + libraryAsDependency :: buildMetaInfo.libraryDependencies.toList // Evaluator can resolve transitive dependencies, the reason of only passing the library as a dependency } From ee35a770ffe627aacdc6d9354248c6276d0e75df Mon Sep 17 00:00:00 2001 From: James Santucci Date: Mon, 14 Feb 2022 14:10:49 -0700 Subject: [PATCH 35/37] actually jsut remove that if it doesn't do anything --- .../scala/org/scalaexercises/exercises/compiler/Compiler.scala | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/compiler/src/main/scala/org/scalaexercises/exercises/compiler/Compiler.scala b/compiler/src/main/scala/org/scalaexercises/exercises/compiler/Compiler.scala index 75b07eb..6c16998 100644 --- a/compiler/src/main/scala/org/scalaexercises/exercises/compiler/Compiler.scala +++ b/compiler/src/main/scala/org/scalaexercises/exercises/compiler/Compiler.scala @@ -290,8 +290,7 @@ case class Compiler() { val libraryAsDependency = s"${buildMetaInfo.organization}:${buildMetaInfo.name}_${buildMetaInfo.scalaVersion .substring(0, 4)}:${buildMetaInfo.version}" - libraryAsDependency :: buildMetaInfo.libraryDependencies.toList - // Evaluator can resolve transitive dependencies, the reason of only passing the library as a dependency + List(libraryAsDependency) } val (buildInfoTerm, buildInfoTree) = From ae8efdca8ef354fae4b2f6242255f584da4651db Mon Sep 17 00:00:00 2001 From: James Santucci Date: Mon, 21 Feb 2022 13:39:55 -0700 Subject: [PATCH 36/37] wip -- stashing to compare with main --- build.sbt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/build.sbt b/build.sbt index d7dee98..d4c0465 100755 --- a/build.sbt +++ b/build.sbt @@ -9,6 +9,7 @@ addCommandAlias( "ci-test", ";scalafmtCheckAll; scalafmtSbtCheck; +test; +publishLocal; sbt-exercise/scripted" ) + addCommandAlias("ci-docs", ";github; mdoc; headerCreateAll") addCommandAlias("ci-publish", ";github; ci-release") @@ -51,9 +52,8 @@ lazy val compiler = (project in file("compiler")) crossScalaVersions := Seq(V.scala, V.scala212), scalacOptions -= "-Xfatal-warnings", libraryDependencies ++= Seq( - "org.scala-exercises" %% "runtime" % V.runtime, + "org.scala-exercises" %% "runtime" % V.runtime exclude ("org.scala-lang.modules", "scala-collection-compat"), "org.scala-lang" % "scala-compiler" % scalaVersion.value, - "org.scala-lang" % "scala-reflect" % scalaVersion.value, "org.scala-lang.modules" %% "scala-xml" % V.scalaXml, "org.typelevel" %% "cats-core" % V.cats % Compile, "org.http4s" %% "http4s-blaze-client" % V.http4s, @@ -66,7 +66,9 @@ lazy val compiler = (project in file("compiler")) "org.typelevel" %% "cats-effect-kernel" % V.catsEffect, "org.scalatest" %% "scalatest-core" % V.scalatest % Test, "org.scalatest" %% "scalatest" % V.scalatest % Test - ), + ) ++ (if (scalaVersion.value == V.scala) + Seq("org.scala-lang" % "scala-reflect" % scalaVersion.value) + else Seq.empty), dependencyOverrides += "org.scala-lang.modules" %% "scala-xml" % "2.0.1", unusedCompileDependenciesFilter -= moduleFilter("org.scala-lang", "scala-compiler") ) From 869164de8930ba55aa058f1474e9a0950b33caf5 Mon Sep 17 00:00:00 2001 From: James Santucci Date: Mon, 7 Mar 2022 08:34:11 -0700 Subject: [PATCH 37/37] pin to lower scala-xml --- build.sbt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build.sbt b/build.sbt index d4c0465..0693245 100755 --- a/build.sbt +++ b/build.sbt @@ -42,7 +42,7 @@ lazy val definitions = (project in file("definitions")) "org.scalatest" %% "scalatest-core" % V.scalatest, "com.chuusai" %% "shapeless" % V.shapeless ), - dependencyOverrides += "org.scala-lang.modules" %% "scala-xml" % "2.0.1" + dependencyOverrides += "org.scala-lang.modules" %% "scala-xml" % "1.3.0" ) lazy val compiler = (project in file("compiler")) @@ -69,7 +69,7 @@ lazy val compiler = (project in file("compiler")) ) ++ (if (scalaVersion.value == V.scala) Seq("org.scala-lang" % "scala-reflect" % scalaVersion.value) else Seq.empty), - dependencyOverrides += "org.scala-lang.modules" %% "scala-xml" % "2.0.1", + dependencyOverrides += "org.scala-lang.modules" %% "scala-xml" % "1.3.0", unusedCompileDependenciesFilter -= moduleFilter("org.scala-lang", "scala-compiler") ) .dependsOn(definitions) @@ -100,7 +100,7 @@ lazy val `sbt-exercise` = (project in file("sbt-exercise")) "org.typelevel" %% "cats-core" % V.cats, "org.typelevel" %% "cats-kernel" % V.cats ), - dependencyOverrides += "org.scala-lang.modules" %% "scala-xml" % "1.0.6", + dependencyOverrides += "org.scala-lang.modules" %% "scala-xml" % "1.3.0", // Leverage build info to populate compiler classpath-- compilerClasspath := { (compiler / Compile / fullClasspath) }.value, buildInfoObject := "Meta",