Skip to content

Commit 88d043d

Browse files
committed
Added monocle.
1 parent 71cf2c2 commit 88d043d

File tree

4 files changed

+28
-1
lines changed

4 files changed

+28
-1
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,3 +184,6 @@
184184
[submodule "community-build/community-projects/akka"]
185185
path = community-build/community-projects/akka
186186
url = https://github.com/dotty-staging/akka.git
187+
[submodule "community-build/community-projects/Monocle"]
188+
path = community-build/community-projects/Monocle
189+
url = https://github.com/optics-dev/Monocle.git
Submodule Monocle added at a5bec44

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

@@ -16,14 +17,25 @@ lazy val sbtPluginFilePath: String =
1617
communitybuildDir.resolve("sbt-dotty-sbt").toAbsolutePath().toString()
1718

1819
def log(msg: String) = println(Console.GREEN + msg + Console.RESET)
20+
def error(msg: String) = println(Console.RED + msg + Console.RESET)
1921

2022
/** Executes shell command, returns false in case of error. */
2123
def exec(projectDir: Path, binary: String, arguments: String*): Int =
2224
val command = binary +: arguments
2325
log(command.mkString(" "))
2426
val builder = new ProcessBuilder(command: _*).directory(projectDir.toFile).inheritIO()
27+
2528
val process = builder.start()
2629
val exitCode = process.waitFor()
30+
if (exitCode != 0) {
31+
val errorStream = process.getErrorStream()
32+
val isReader = new InputStreamReader(process.getErrorStream())
33+
val br = new BufferedReader(isReader)
34+
Iterator.continually(br.readLine()).takeWhile(_ != null).foreach(error(_))
35+
br.close()
36+
isReader.close()
37+
errorStream.close()
38+
}
2739
exitCode
2840

2941

@@ -660,6 +672,13 @@ object projects:
660672
dependencies = List(scalatest, scalatestplusJunit, scalatestplusScalacheck)
661673
)
662674

675+
lazy val monocle = SbtCommunityProject(
676+
project = "Monocle",
677+
sbtTestCommand = "monocleJVM/test",
678+
dependencies = List(cats, shapeless, munit, discipline, disciplineMunit)
679+
)
680+
681+
663682
end projects
664683

665684
def allProjects = List(
@@ -725,6 +744,7 @@ def allProjects = List(
725744
projects.izumiReflect,
726745
projects.perspective,
727746
projects.akka,
747+
projects.monocle,
728748
)
729749

730750
lazy val projectMap = allProjects.groupBy(_.project)

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@ class CommunityBuildTestA extends CommunityBuildTest:
9292
@Test def fastparse = projects.fastparse.run()
9393
@Test def geny = projects.geny.run()
9494
@Test def izumiReflect = projects.izumiReflect.run()
95+
96+
@Test def monocle = projects.monocle.run()
9597
@Test def oslib = projects.oslib.run()
9698
// @Test def oslibWatch = projects.oslibWatch.run()
9799
@Test def pprint = projects.pprint.run()
@@ -158,3 +160,4 @@ class CommunityBuildTestB extends CommunityBuildTest:
158160
end CommunityBuildTestB
159161

160162
class TestCategory
163+

0 commit comments

Comments
 (0)