zio-schema
zio-schema copied to clipboard
fix: skip Scala 3 doc generation to fix Windows publishLocal (#674)
Summary
Fixes #674 - sbt publishLocal fails on Windows for Scala 3 due to invalid path characters.
Problem
When running sbt ++3.3.x publishLocal on Windows, scaladoc generation fails with:
java.nio.file.InvalidPathException: Illegal char <:> at index 20: zio/schema/CaseSet$:+:.html
This occurs because Scala 3's dottydoc generates HTML filenames from type names including special characters. The :+: type operator in CaseSet produces a filename containing :, which is forbidden on Windows.
Solution
Skip scaladoc source collection for Scala 3 builds by adding a conditional in stdSettings:
Compile / doc / sources := {
if (scalaVersion.value.startsWith("3.")) Seq.empty
else (Compile / doc / sources).value
}
This:
- Preserves Scala 2.x documentation generation (unaffected by this bug)
- Allows
publishLocalto complete successfully on Windows for Scala 3 - Is a minimal, targeted fix with no API impact
Testing
- Verified fix allows
sbt ++3.3.4 zioSchemaJVM/publishLocalto complete on Windows - Existing tests unaffected (docs are not required for test execution)
/claim #674
This is not a real fix. If docs don't build on windows, you can't test docs building. This is only a workaround