From 35719d82548d626bf753df0b27d5f7bee5b15bdf Mon Sep 17 00:00:00 2001 From: Boris Date: Sat, 10 Apr 2021 14:07:00 +0200 Subject: [PATCH 1/5] Added monocle. --- .gitmodules | 5 +++++ community-build/community-projects/Monocle | 1 + .../scala/dotty/communitybuild/projects.scala | 22 ++++++++++++++++++- .../communitybuild/CommunityBuildTest.scala | 1 + 4 files changed, 28 insertions(+), 1 deletion(-) create mode 160000 community-build/community-projects/Monocle diff --git a/.gitmodules b/.gitmodules index b61a6eaf411f..4293a6e71d8a 100644 --- a/.gitmodules +++ b/.gitmodules @@ -184,6 +184,10 @@ [submodule "community-build/community-projects/protoquill"] path = community-build/community-projects/protoquill url = https://github.com/dotty-staging/protoquill.git +[submodule "community-build/community-projects/Monocle"] + path = community-build/community-projects/Monocle + url = https://github.com/optics-dev/Monocle.git + branch = scala-3-RC2 [submodule "community-build/community-projects/onnx-scala"] path = community-build/community-projects/onnx-scala url = https://github.com/dotty-staging/onnx-scala.git @@ -196,3 +200,4 @@ [submodule "community-build/community-projects/scalatestplus-testng"] path = community-build/community-projects/scalatestplus-testng url = https://github.com/dotty-staging/scalatestplus-testng.git + diff --git a/community-build/community-projects/Monocle b/community-build/community-projects/Monocle new file mode 160000 index 000000000000..4613afff874c --- /dev/null +++ b/community-build/community-projects/Monocle @@ -0,0 +1 @@ +Subproject commit 4613afff874c23d17bde580671ff29c7a13123d0 diff --git a/community-build/src/scala/dotty/communitybuild/projects.scala b/community-build/src/scala/dotty/communitybuild/projects.scala index 106952d1cb2a..aea3a3558ddf 100644 --- a/community-build/src/scala/dotty/communitybuild/projects.scala +++ b/community-build/src/scala/dotty/communitybuild/projects.scala @@ -1,8 +1,9 @@ package dotty.communitybuild import java.nio.file._ -import java.io.{PrintWriter, File} +import java.io.{BufferedReader, InputStreamReader, PrintWriter, File} import java.nio.charset.StandardCharsets.UTF_8 +import scala.collection.Iterator lazy val communitybuildDir: Path = Paths.get(sys.props("user.dir")) @@ -19,6 +20,7 @@ lazy val sbtPluginFilePath: String = communitybuildDir.resolve("sbt-dotty-sbt").toAbsolutePath().toString() def log(msg: String) = println(Console.GREEN + msg + Console.RESET) +def error(msg: String) = println(Console.RED + msg + Console.RESET) /** Executes shell command, returns false in case of error. */ def exec(projectDir: Path, binary: String, arguments: Seq[String], environment: Map[String, String]): Int = @@ -27,8 +29,18 @@ def exec(projectDir: Path, binary: String, arguments: Seq[String], environment: log(command.mkString(" ")) val builder = new ProcessBuilder(command: _*).directory(projectDir.toFile).inheritIO() builder.environment.putAll(environment.asJava) + val process = builder.start() val exitCode = process.waitFor() + if (exitCode != 0) { + val errorStream = process.getErrorStream() + val isReader = new InputStreamReader(process.getErrorStream()) + val br = new BufferedReader(isReader) + Iterator.continually(br.readLine()).takeWhile(_ != null).foreach(error(_)) + br.close() + isReader.close() + errorStream.close() + } exitCode @@ -656,6 +668,12 @@ object projects: dependencies = List(scalatest, scalatestplusJunit, scalatestplusScalacheck) ) + lazy val monocle = SbtCommunityProject( + project = "Monocle", + sbtTestCommand = "monocleJVM/test", + dependencies = List(cats, munit, discipline, disciplineMunit) + ) + lazy val protoquill = SbtCommunityProject( project = "protoquill", sbtTestCommand = "test", @@ -746,6 +764,7 @@ def allProjects = List( projects.izumiReflect, projects.perspective, projects.akka, + projects.monocle, projects.protoquill, projects.onnxScala, projects.playJson, @@ -753,3 +772,4 @@ def allProjects = List( ) lazy val projectMap = allProjects.groupBy(_.project) + diff --git a/community-build/test/scala/dotty/communitybuild/CommunityBuildTest.scala b/community-build/test/scala/dotty/communitybuild/CommunityBuildTest.scala index 5576b95afba5..3575b60ca228 100644 --- a/community-build/test/scala/dotty/communitybuild/CommunityBuildTest.scala +++ b/community-build/test/scala/dotty/communitybuild/CommunityBuildTest.scala @@ -143,6 +143,7 @@ class CommunityBuildTestC extends CommunityBuildTest: @Test def geny = projects.geny.run() @Test def intent = projects.intent.run() @Test def minitest = projects.minitest.run() + @Test def monocle = projects.monocle.run() @Test def onnxScala = projects.onnxScala.run() @Test def oslib = projects.oslib.run() // @Test def oslibWatch = projects.oslibWatch.run() From 10702cad2fccd3595b40b700de285e8a2b9f28e5 Mon Sep 17 00:00:00 2001 From: Boris Date: Wed, 12 May 2021 22:31:15 +0200 Subject: [PATCH 2/5] Update .gitmodules Co-authored-by: Tom Grigg --- .gitmodules | 2 -- 1 file changed, 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index 4293a6e71d8a..10436cc2e261 100644 --- a/.gitmodules +++ b/.gitmodules @@ -187,7 +187,6 @@ [submodule "community-build/community-projects/Monocle"] path = community-build/community-projects/Monocle url = https://github.com/optics-dev/Monocle.git - branch = scala-3-RC2 [submodule "community-build/community-projects/onnx-scala"] path = community-build/community-projects/onnx-scala url = https://github.com/dotty-staging/onnx-scala.git @@ -200,4 +199,3 @@ [submodule "community-build/community-projects/scalatestplus-testng"] path = community-build/community-projects/scalatestplus-testng url = https://github.com/dotty-staging/scalatestplus-testng.git - From d4e083fbee48823d6cde72fa178e4236564cd0d3 Mon Sep 17 00:00:00 2001 From: Boris Date: Wed, 12 May 2021 22:31:31 +0200 Subject: [PATCH 3/5] Update community-build/src/scala/dotty/communitybuild/projects.scala Co-authored-by: Tom Grigg --- community-build/src/scala/dotty/communitybuild/projects.scala | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/community-build/src/scala/dotty/communitybuild/projects.scala b/community-build/src/scala/dotty/communitybuild/projects.scala index aea3a3558ddf..368009f81c36 100644 --- a/community-build/src/scala/dotty/communitybuild/projects.scala +++ b/community-build/src/scala/dotty/communitybuild/projects.scala @@ -670,7 +670,7 @@ object projects: lazy val monocle = SbtCommunityProject( project = "Monocle", - sbtTestCommand = "monocleJVM/test", + sbtTestCommand = "coreJVM/test; macrosJVM/test; testJVM/test", dependencies = List(cats, munit, discipline, disciplineMunit) ) @@ -772,4 +772,3 @@ def allProjects = List( ) lazy val projectMap = allProjects.groupBy(_.project) - From 1d6d78d3fd531c56fcc8e44a26a55584d0dd821c Mon Sep 17 00:00:00 2001 From: Boris Date: Wed, 12 May 2021 22:38:51 +0200 Subject: [PATCH 4/5] code review comments. --- .../src/scala/dotty/communitybuild/projects.scala | 13 +------------ .../dotty/communitybuild/CommunityBuildTest.scala | 2 +- 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/community-build/src/scala/dotty/communitybuild/projects.scala b/community-build/src/scala/dotty/communitybuild/projects.scala index 368009f81c36..0393fe21706d 100644 --- a/community-build/src/scala/dotty/communitybuild/projects.scala +++ b/community-build/src/scala/dotty/communitybuild/projects.scala @@ -1,9 +1,8 @@ package dotty.communitybuild import java.nio.file._ -import java.io.{BufferedReader, InputStreamReader, PrintWriter, File} +import java.io.{PrintWriter, File} import java.nio.charset.StandardCharsets.UTF_8 -import scala.collection.Iterator lazy val communitybuildDir: Path = Paths.get(sys.props("user.dir")) @@ -20,7 +19,6 @@ lazy val sbtPluginFilePath: String = communitybuildDir.resolve("sbt-dotty-sbt").toAbsolutePath().toString() def log(msg: String) = println(Console.GREEN + msg + Console.RESET) -def error(msg: String) = println(Console.RED + msg + Console.RESET) /** Executes shell command, returns false in case of error. */ def exec(projectDir: Path, binary: String, arguments: Seq[String], environment: Map[String, String]): Int = @@ -32,15 +30,6 @@ def exec(projectDir: Path, binary: String, arguments: Seq[String], environment: val process = builder.start() val exitCode = process.waitFor() - if (exitCode != 0) { - val errorStream = process.getErrorStream() - val isReader = new InputStreamReader(process.getErrorStream()) - val br = new BufferedReader(isReader) - Iterator.continually(br.readLine()).takeWhile(_ != null).foreach(error(_)) - br.close() - isReader.close() - errorStream.close() - } exitCode diff --git a/community-build/test/scala/dotty/communitybuild/CommunityBuildTest.scala b/community-build/test/scala/dotty/communitybuild/CommunityBuildTest.scala index 3575b60ca228..966d8ba99b8a 100644 --- a/community-build/test/scala/dotty/communitybuild/CommunityBuildTest.scala +++ b/community-build/test/scala/dotty/communitybuild/CommunityBuildTest.scala @@ -125,6 +125,7 @@ class CommunityBuildTestB extends CommunityBuildTest: @Test def perspective = projects.perspective.run() @Test def scodec = projects.scodec.run() @Test def scodecBits = projects.scodecBits.run() + @Test def monocle = projects.monocle.run() @Test def simulacrumScalafixAnnotations = projects.simulacrumScalafixAnnotations.run() end CommunityBuildTestB @@ -143,7 +144,6 @@ class CommunityBuildTestC extends CommunityBuildTest: @Test def geny = projects.geny.run() @Test def intent = projects.intent.run() @Test def minitest = projects.minitest.run() - @Test def monocle = projects.monocle.run() @Test def onnxScala = projects.onnxScala.run() @Test def oslib = projects.oslib.run() // @Test def oslibWatch = projects.oslibWatch.run() From 9be17bc038dc659c37eb757ab6fba4907684833d Mon Sep 17 00:00:00 2001 From: Tom Grigg Date: Fri, 16 Jul 2021 09:57:39 -0700 Subject: [PATCH 5/5] use dotty-staging fork --- .gitmodules | 2 +- community-build/src/scala/dotty/communitybuild/projects.scala | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index 10436cc2e261..9c81a7d2449d 100644 --- a/.gitmodules +++ b/.gitmodules @@ -186,7 +186,7 @@ url = https://github.com/dotty-staging/protoquill.git [submodule "community-build/community-projects/Monocle"] path = community-build/community-projects/Monocle - url = https://github.com/optics-dev/Monocle.git + url = https://github.com/dotty-staging/Monocle.git [submodule "community-build/community-projects/onnx-scala"] path = community-build/community-projects/onnx-scala url = https://github.com/dotty-staging/onnx-scala.git diff --git a/community-build/src/scala/dotty/communitybuild/projects.scala b/community-build/src/scala/dotty/communitybuild/projects.scala index 0393fe21706d..2369079a6936 100644 --- a/community-build/src/scala/dotty/communitybuild/projects.scala +++ b/community-build/src/scala/dotty/communitybuild/projects.scala @@ -27,7 +27,6 @@ def exec(projectDir: Path, binary: String, arguments: Seq[String], environment: log(command.mkString(" ")) val builder = new ProcessBuilder(command: _*).directory(projectDir.toFile).inheritIO() builder.environment.putAll(environment.asJava) - val process = builder.start() val exitCode = process.waitFor() exitCode