Skip to content

Commit a9354ca

Browse files
committed
Added monocle.
1 parent 73bfead commit a9354ca

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,9 +184,14 @@
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
190194
[submodule "community-build/community-projects/cask"]
191195
path = community-build/community-projects/cask
192196
url = https://github.com/dotty-staging/cask.git
197+
Submodule Monocle added at 6cea46f

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,14 +20,25 @@ 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: String*): Int =
2527
val command = binary +: arguments
2628
log(command.mkString(" "))
2729
val builder = new ProcessBuilder(command: _*).directory(projectDir.toFile).inheritIO()
30+
2831
val process = builder.start()
2932
val exitCode = process.waitFor()
33+
if (exitCode != 0) {
34+
val errorStream = process.getErrorStream()
35+
val isReader = new InputStreamReader(process.getErrorStream())
36+
val br = new BufferedReader(isReader)
37+
Iterator.continually(br.readLine()).takeWhile(_ != null).foreach(error(_))
38+
br.close()
39+
isReader.close()
40+
errorStream.close()
41+
}
3042
exitCode
3143

3244

@@ -639,6 +651,12 @@ object projects:
639651
dependencies = List(scalatest, scalatestplusJunit, scalatestplusScalacheck)
640652
)
641653

654+
lazy val monocle = SbtCommunityProject(
655+
project = "Monocle",
656+
sbtTestCommand = "monocleJVM/test",
657+
dependencies = List(cats, munit, discipline, disciplineMunit)
658+
)
659+
642660
lazy val protoquill = SbtCommunityProject(
643661
project = "protoquill",
644662
sbtTestCommand = "test",
@@ -722,8 +740,10 @@ def allProjects = List(
722740
projects.izumiReflect,
723741
projects.perspective,
724742
projects.akka,
743+
projects.monocle,
725744
projects.protoquill,
726745
projects.onnxScala,
727746
)
728747

729748
lazy val projectMap = allProjects.groupBy(_.project)
749+

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ class CommunityBuildTestC extends CommunityBuildTest:
141141
@Test def geny = projects.geny.run()
142142
@Test def intent = projects.intent.run()
143143
@Test def minitest = projects.minitest.run()
144+
@Test def monocle = projects.monocle.run()
144145
@Test def onnxScala = projects.onnxScala.run()
145146
@Test def oslib = projects.oslib.run()
146147
// @Test def oslibWatch = projects.oslibWatch.run()

0 commit comments

Comments
 (0)