Commit 8ba258c
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 the 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.
Also modifies excludedPackages when on Windows to replace Unix path
separators with Windows path separators (which are escaped because it is
treated as a regular expression). Modifies tests to remove unnecessary
escaping of Unix separators that results in an invalid regex due to this
replacement on Windows.
Note that two tests currently prevent CI from working on Windows:
coverage-off and preserve-set. The reason for these failures on Windows
is not clear, but these changes at least allow the common uses to work
on Windows.1 parent 98c69fb commit 8ba258c
File tree
4 files changed
+13
-4
lines changed- .github/workflows
- src
- main/scala/scoverage
- sbt-test/scoverage
- coverage-excluded-files
- scala3-coverage-excluded-files
4 files changed
+13
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
147 | 148 | | |
148 | 149 | | |
149 | 150 | | |
150 | | - | |
| 151 | + | |
151 | 152 | | |
152 | 153 | | |
153 | 154 | | |
| |||
160 | 161 | | |
161 | 162 | | |
162 | 163 | | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
163 | 171 | | |
164 | 172 | | |
165 | 173 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
0 commit comments