From 3e2ccf3718a91b5040d301a8fe88e568cfa300cd Mon Sep 17 00:00:00 2001 From: Carlos Quiroz <3615303+cquiroz@users.noreply.github.com> Date: Wed, 8 May 2024 12:11:56 -0400 Subject: [PATCH] Run tests on scala 3 --- .envrc | 3 + .gitignore | 1 + build.sbt | 2 +- flake.lock | 156 ++++++++++++++++++ flake.nix | 28 ++++ sbt-tzdb/src/sbt-test/sbt-tzdb/jvm/build.sbt | 8 +- .../sbt-test/sbt-tzdb/jvm/project/plugins.sbt | 2 +- .../sbt-test/sbt-tzdb/no-filtering/build.sbt | 6 +- .../sbt-tzdb/no-filtering/project/plugins.sbt | 2 +- 9 files changed, 198 insertions(+), 10 deletions(-) create mode 100644 .envrc create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..4cb3cbf --- /dev/null +++ b/.envrc @@ -0,0 +1,3 @@ +use flake +layout node +eval "$shellHook" diff --git a/.gitignore b/.gitignore index 6e2caf5..4a7bdc0 100644 --- a/.gitignore +++ b/.gitignore @@ -33,3 +33,4 @@ tzdb/js/src/main/resources/ /threetenbp.iml .metaserver/ project/metals.sbt +.direnv/ diff --git a/build.sbt b/build.sbt index 3411846..8b0ccfc 100644 --- a/build.sbt +++ b/build.sbt @@ -45,7 +45,7 @@ lazy val sbt_tzdb = project .settings( name := "sbt-tzdb", libraryDependencies ++= Seq( - "io.github.cquiroz" %% "kuyfi" % "1.5.2", + "io.github.cquiroz" %% "kuyfi" % "1.5.3", "org.apache.commons" % "commons-compress" % "1.24.0", "com.eed3si9n" %% "gigahorse-okhttp" % "0.7.0", "org.typelevel" %% "cats-core" % "2.10.0", diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..80c450b --- /dev/null +++ b/flake.lock @@ -0,0 +1,156 @@ +{ + "nodes": { + "devshell": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1708939976, + "narHash": "sha256-O5+nFozxz2Vubpdl1YZtPrilcIXPcRAjqNdNE8oCRoA=", + "owner": "numtide", + "repo": "devshell", + "rev": "5ddecd67edbd568ebe0a55905273e56cc82aabe3", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "devshell", + "type": "github" + } + }, + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1701680307, + "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "4022d587cbbfd70fe950c1e2083a02621806a725", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_2": { + "inputs": { + "systems": "systems_2" + }, + "locked": { + "lastModified": 1709126324, + "narHash": "sha256-q6EQdSeUZOG26WelxqkmR7kArjgWCdw5sfJVHPH/7j8=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "d465f4819400de7c8d874d50b982301f28a84605", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1704161960, + "narHash": "sha256-QGua89Pmq+FBAro8NriTuoO/wNaUtugt29/qqA8zeeM=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "63143ac2c9186be6d9da6035fa22620018c85932", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1710097495, + "narHash": "sha256-B7Ea7q7hU7SE8wOPJ9oXEBjvB89yl2csaLjf5v/7jr8=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "d40e866b1f98698d454dad8f592fe7616ff705a4", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": [ + "typelevel-nix", + "flake-utils" + ], + "nixpkgs": [ + "typelevel-nix", + "nixpkgs" + ], + "typelevel-nix": "typelevel-nix" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_2": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "typelevel-nix": { + "inputs": { + "devshell": "devshell", + "flake-utils": "flake-utils_2", + "nixpkgs": "nixpkgs_2" + }, + "locked": { + "lastModified": 1710188850, + "narHash": "sha256-KbNmyxEvcnq5h/wfeL1ZxO9RwoNRjJ0IgYlUZpdSlLo=", + "owner": "typelevel", + "repo": "typelevel-nix", + "rev": "60c3868688cb8f5f7ebc781f6e122c061ae35d4d", + "type": "github" + }, + "original": { + "owner": "typelevel", + "repo": "typelevel-nix", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..331c0e5 --- /dev/null +++ b/flake.nix @@ -0,0 +1,28 @@ +{ + inputs = { + typelevel-nix.url = "github:typelevel/typelevel-nix"; + nixpkgs.follows = "typelevel-nix/nixpkgs"; + flake-utils.follows = "typelevel-nix/flake-utils"; + }; + + outputs = { self, nixpkgs, flake-utils, typelevel-nix }: + flake-utils.lib.eachDefaultSystem (system: + let + pkgs-x86_64 = import nixpkgs { system = "x86_64-darwin"; }; + scala-cli-overlay = final: prev: { scala-cli = pkgs-x86_64.scala-cli; }; + pkgs = import nixpkgs { + inherit system; + overlays = [ typelevel-nix.overlay scala-cli-overlay ]; + }; + in { + devShell = pkgs.devshell.mkShell { + imports = [ typelevel-nix.typelevelShell ]; + typelevelShell = { + nodejs.enable = true; + jdk.package = pkgs.jdk8; + }; + }; + } + + ); +} diff --git a/sbt-tzdb/src/sbt-test/sbt-tzdb/jvm/build.sbt b/sbt-tzdb/src/sbt-test/sbt-tzdb/jvm/build.sbt index a50fff0..e142a86 100644 --- a/sbt-tzdb/src/sbt-test/sbt-tzdb/jvm/build.sbt +++ b/sbt-tzdb/src/sbt-test/sbt-tzdb/jvm/build.sbt @@ -3,9 +3,9 @@ name := "tzdb" enablePlugins(TzdbPlugin) enablePlugins(ScalaJSPlugin) -scalaVersion := "2.13.1" +scalaVersion := "2.13.14" -crossScalaVersions := Seq("2.13.1", "2.12.10") +crossScalaVersions := Seq("2.13.14", "2.12.10", "3.4.1") tzdbPlatform := TzdbPlugin.Platform.Jvm @@ -20,6 +20,6 @@ lazy val commonSettings = Seq( ) libraryDependencies ++= Seq( - "org.portable-scala" %%% "portable-scala-reflect" % "1.0.0", - "io.github.cquiroz" %%% "scala-java-time" % "2.0.0-RC3" + ("org.portable-scala" %%% "portable-scala-reflect" % "1.1.2").cross(CrossVersion.for3Use2_13), + "io.github.cquiroz" %%% "scala-java-time" % "2.5.0" ) diff --git a/sbt-tzdb/src/sbt-test/sbt-tzdb/jvm/project/plugins.sbt b/sbt-tzdb/src/sbt-test/sbt-tzdb/jvm/project/plugins.sbt index 14fbf32..c22ef8a 100644 --- a/sbt-tzdb/src/sbt-test/sbt-tzdb/jvm/project/plugins.sbt +++ b/sbt-tzdb/src/sbt-test/sbt-tzdb/jvm/project/plugins.sbt @@ -1,3 +1,3 @@ addSbtPlugin("io.github.cquiroz" % "sbt-tzdb" % sys.props.getOrElse("plugin.version", sys.error("'plugin.version' environment variable is not set"))) -addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.32") +addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.16.0") diff --git a/sbt-tzdb/src/sbt-test/sbt-tzdb/no-filtering/build.sbt b/sbt-tzdb/src/sbt-test/sbt-tzdb/no-filtering/build.sbt index 9483d7b..fdabed0 100644 --- a/sbt-tzdb/src/sbt-test/sbt-tzdb/no-filtering/build.sbt +++ b/sbt-tzdb/src/sbt-test/sbt-tzdb/no-filtering/build.sbt @@ -3,9 +3,9 @@ name := "tzdb" enablePlugins(TzdbPlugin) enablePlugins(ScalaJSPlugin) -scalaVersion := "2.13.1" +scalaVersion := "2.13.14" -crossScalaVersions := Seq("2.13.1", "2.12.10") +crossScalaVersions := Seq("2.13.14", "2.12.10", "3.4.1") val zonesFilterFn = {(z: String) => z == "America/Santiago" || z == "Pacific/Honolulu"} @@ -22,5 +22,5 @@ lazy val commonSettings = Seq( ) libraryDependencies ++= Seq( - "io.github.cquiroz" %%% "scala-java-time" % "2.0.0-RC3" + "io.github.cquiroz" %%% "scala-java-time" % "2.5.0" ) diff --git a/sbt-tzdb/src/sbt-test/sbt-tzdb/no-filtering/project/plugins.sbt b/sbt-tzdb/src/sbt-test/sbt-tzdb/no-filtering/project/plugins.sbt index 14fbf32..c22ef8a 100644 --- a/sbt-tzdb/src/sbt-test/sbt-tzdb/no-filtering/project/plugins.sbt +++ b/sbt-tzdb/src/sbt-test/sbt-tzdb/no-filtering/project/plugins.sbt @@ -1,3 +1,3 @@ addSbtPlugin("io.github.cquiroz" % "sbt-tzdb" % sys.props.getOrElse("plugin.version", sys.error("'plugin.version' environment variable is not set"))) -addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.32") +addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.16.0")