Skip to content

Commit 35719d8

Browse files
committed
Added monocle.
1 parent ae3f58e commit 35719d8

File tree

4 files changed

+28
-1
lines changed

4 files changed

+28
-1
lines changed

.gitmodules

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,10 @@
184184
[submodule "community-build/community-projects/protoquill"]
185185
path = community-build/community-projects/protoquill
186186
url = https://github.com/dotty-staging/protoquill.git
187+
[submodule "community-build/community-projects/Monocle"]
188+
path = community-build/community-projects/Monocle
189+
url = https://github.com/optics-dev/Monocle.git
190+
branch = scala-3-RC2
187191
[submodule "community-build/community-projects/onnx-scala"]
188192
path = community-build/community-projects/onnx-scala
189193
url = https://github.com/dotty-staging/onnx-scala.git
@@ -196,3 +200,4 @@
196200
[submodule "community-build/community-projects/scalatestplus-testng"]
197201
path = community-build/community-projects/scalatestplus-testng
198202
url = https://github.com/dotty-staging/scalatestplus-testng.git
203+
Submodule Monocle added at 4613aff

community-build/src/scala/dotty/communitybuild/projects.scala

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
package dotty.communitybuild
22

33
import java.nio.file._
4-
import java.io.{PrintWriter, File}
4+
import java.io.{BufferedReader, InputStreamReader, PrintWriter, File}
55
import java.nio.charset.StandardCharsets.UTF_8
6+
import scala.collection.Iterator
67

78
lazy val communitybuildDir: Path = Paths.get(sys.props("user.dir"))
89

@@ -19,6 +20,7 @@ lazy val sbtPluginFilePath: String =
1920
communitybuildDir.resolve("sbt-dotty-sbt").toAbsolutePath().toString()
2021

2122
def log(msg: String) = println(Console.GREEN + msg + Console.RESET)
23+
def error(msg: String) = println(Console.RED + msg + Console.RESET)
2224

2325
/** Executes shell command, returns false in case of error. */
2426
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:
2729
log(command.mkString(" "))
2830
val builder = new ProcessBuilder(command: _*).directory(projectDir.toFile).inheritIO()
2931
builder.environment.putAll(environment.asJava)
32+
3033
val process = builder.start()
3134
val exitCode = process.waitFor()
35+
if (exitCode != 0) {
36+
val errorStream = process.getErrorStream()
37+
val isReader = new InputStreamReader(process.getErrorStream())
38+
val br = new BufferedReader(isReader)
39+
Iterator.continually(br.readLine()).takeWhile(_ != null).foreach(error(_))
40+
br.close()
41+
isReader.close()
42+
errorStream.close()
43+
}
3244
exitCode
3345

3446

@@ -656,6 +668,12 @@ object projects:
656668
dependencies = List(scalatest, scalatestplusJunit, scalatestplusScalacheck)
657669
)
658670

671+
lazy val monocle = SbtCommunityProject(
672+
project = "Monocle",
673+
sbtTestCommand = "monocleJVM/test",
674+
dependencies = List(cats, munit, discipline, disciplineMunit)
675+
)
676+
659677
lazy val protoquill = SbtCommunityProject(
660678
project = "protoquill",
661679
sbtTestCommand = "test",
@@ -746,10 +764,12 @@ def allProjects = List(
746764
projects.izumiReflect,
747765
projects.perspective,
748766
projects.akka,
767+
projects.monocle,
749768
projects.protoquill,
750769
projects.onnxScala,
751770
projects.playJson,
752771
projects.scalatestplusTestNG,
753772
)
754773

755774
lazy val projectMap = allProjects.groupBy(_.project)
775+

community-build/test/scala/dotty/communitybuild/CommunityBuildTest.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ class CommunityBuildTestC extends CommunityBuildTest:
143143
@Test def geny = projects.geny.run()
144144
@Test def intent = projects.intent.run()
145145
@Test def minitest = projects.minitest.run()
146+
@Test def monocle = projects.monocle.run()
146147
@Test def onnxScala = projects.onnxScala.run()
147148
@Test def oslib = projects.oslib.run()
148149
// @Test def oslibWatch = projects.oslibWatch.run()

0 commit comments

Comments
 (0)