Skip to content
Closed
Changes from all commits
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
9 changes: 8 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
import scala.util.Try

val scala3Version = "3.4.2"
val scala212Version = "2.12.19"
val scala213Version = "2.13.14"

val zioVersion = "2.1.1"
val scalaTestVersion = "3.2.18"

val isCI = Try(sys.env.getOrElse("CI", "false").toBoolean).getOrElse(false)
Copy link
Collaborator

@fwbrasil fwbrasil Jun 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this flag be specific to the workaround instead of CI? Should the workaround be disabled in CI?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question. Having a separate environment variable would work for me as I use direnv so I could have a .envrc file in my worktree that enables the workaround. That being said, it would be hard to discover. I might be able to wrap the command that causes the error to provide the workaround information to users. Ideally the plugin would do this itself. Might be worth submitting a PR for that.

As for it being disabled in CI, yeah, I don't think there is any reason to change the default behaviour in CI as CI never uses worktrees.


val compilerOptions = Seq(
"-encoding",
"utf8",
Expand Down Expand Up @@ -46,7 +50,10 @@ lazy val `kyo-settings` = Seq(
ThisBuild / versionScheme := Some("early-semver"),
scalacOptions ++= Seq("-release:11"),
Test / javaOptions += "--add-opens=java.base/java.lang=ALL-UNNAMED"
)
) ++ {
// Workaround to make it possible to use git worktrees.
if (isCI) Seq.empty else com.github.sbt.git.SbtGit.useReadableConsoleGit
}

lazy val kyo =
crossProject(JVMPlatform)
Expand Down