Skip to content

Added monocle. #11468

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jul 16, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

1 change: 1 addition & 0 deletions community-build/community-projects/Monocle
Submodule Monocle added at 4613af
22 changes: 21 additions & 1 deletion community-build/src/scala/dotty/communitybuild/projects.scala
Original file line number Diff line number Diff line change
@@ -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"))

Expand All @@ -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 =
Expand All @@ -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


Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -746,10 +764,12 @@ def allProjects = List(
projects.izumiReflect,
projects.perspective,
projects.akka,
projects.monocle,
projects.protoquill,
projects.onnxScala,
projects.playJson,
projects.scalatestplusTestNG,
)

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

Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down