Skip to content

Commit 95c6c17

Browse files
Allow sbt-scoverage to work on windows
The -Xplugin option expects a classpath string with multiple paths separated by a semicolon or colon depending on this operating system. However, this currently always uses a colon, which doesn't work on windows. This means scalac cannot find the scoverage plugin jars and leads to errors about "bad options". This modifies the -Xplugin logic to use File.pathSeparator when building the Xplugin classpath, allowing it to work regardless of operating system. Closes #440
1 parent 1e69c10 commit 95c6c17

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@ on:
1111

1212
jobs:
1313
test:
14-
runs-on: ubuntu-latest
14+
runs-on: ${{ matrix.os }}
1515
strategy:
1616
matrix:
1717
java: [ '8', '17' ]
18+
os: [ 'ubuntu-latest', 'windows-latest' ]
1819

1920
steps:
2021
- name: checkout the repo

src/main/scala/scoverage/ScoverageSbtPlugin.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ object ScoverageSbtPlugin extends AutoPlugin {
147147

148148
Seq(
149149
Some(
150-
s"-Xplugin:${pluginPaths.mkString(":")}"
150+
s"-Xplugin:${pluginPaths.mkString(java.io.File.pathSeparator)}"
151151
),
152152
Some(
153153
s"-P:scoverage:dataDir:${coverageDataDir.value.getAbsolutePath}/scoverage-data"

0 commit comments

Comments
 (0)