Skip to content

Commit 8483a68

Browse files
committed
Drop sbt-compiler-maven-plugin (it's effectively dead)
1 parent c652406 commit 8483a68

File tree

2 files changed

+7
-33
lines changed

2 files changed

+7
-33
lines changed

README.md

+6-9
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,10 @@ internal mojos:
4545

4646
### Prerequisites / limitations
4747

48-
- The plugin is compatible with two Maven Scala compiler plugins:
49-
50-
- [Scala Maven Plugin](http://davidb.github.io/scala-maven-plugin/) - version `3.0.0` or later required, [addScalacArgs](http://davidb.github.io/scala-maven-plugin/compile-mojo.html#addScalacArgs) and [analysisCacheFile](http://davidb.github.io/scala-maven-plugin/compile-mojo.html#analysisCacheFile) configuration parameters cannot be set directly, use project properties `addScalacArgs` and `analysisCacheFile` instead.
51-
52-
- [SBT Compiler Maven Plugin](https://github.com/sbt-compiler-maven-plugin/sbt-compiler-maven-plugin/) - version `1.0.0-beta5` or later required. Currently it works only with Scoverage Maven Plugin `1.4.11` or earlier.
53-
54-
- Starting with version `2.0.0` the plugin supports Scala `2.12.8+`, `2.13.0+` and `3.2.0+`. For Scala `2.10` and `2.11` support please use version `1.4.11`.
48+
- The plugin is compatible with [Scala Maven Plugin](http://davidb.github.io/scala-maven-plugin/)
49+
- version `3.0.0` or later required
50+
- [addScalacArgs](http://davidb.github.io/scala-maven-plugin/compile-mojo.html#addScalacArgs) and [analysisCacheFile](http://davidb.github.io/scala-maven-plugin/compile-mojo.html#analysisCacheFile) configuration parameters cannot be set directly, use project properties `addScalacArgs` and `analysisCacheFile` instead.
51+
- Starting with version `2.0.0` the plugin supports Scala `2.12.8+`, `2.13.0+` and `3.2.0+`. For Scala `2.12.7` and lower please use version `1.4.11` of the plugin.
5552
- The plugin is not thread-safe, so it should not be used in multi-threaded builds.
5653

5754

@@ -78,7 +75,7 @@ If all the attempts to resolve the Scala version fail, then coverage will not be
7875
```xml
7976
<project>
8077
<properties>
81-
<scala.version>2.13.12</scala.version>
78+
<scala.version>2.13.15</scala.version>
8279
</properties>
8380
</project>
8481
```
@@ -94,7 +91,7 @@ or
9491
<artifactId>scoverage-maven-plugin</artifactId>
9592
<version>${scoverage.plugin.version}</version>
9693
<configuration>
97-
<scalaVersion>2.13.12</scalaVersion>
94+
<scalaVersion>2.13.15</scalaVersion>
9895
<!-- other parameters -->
9996
</configuration>
10097
</plugin>

src/main/java/org/scoverage/plugin/SCoveragePreCompileMojo.java

+1-24
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@
5353
* Supported compiler plugins:
5454
* <ul>
5555
* <li><a href="https://davidb.github.io/scala-maven-plugin/">net.alchim31.maven:scala-maven-plugin</a></li>
56-
* <li><a href="https://sbt-compiler-maven-plugin.github.io/sbt-compiler-maven-plugin/">com.google.code.sbt-compiler-maven-plugin:sbt-compiler-maven-plugin</a></li>
5756
* </ul>
5857
* <br>
5958
* This is internal mojo, executed in forked {@code scoverage} life cycle.
@@ -203,8 +202,7 @@ public void execute() throws MojoExecutionException
203202
Properties projectProperties = project.getProperties();
204203

205204
// for maven-resources-plugin (testResources), maven-compiler-plugin (testCompile),
206-
// sbt-compiler-maven-plugin (testCompile), scala-maven-plugin (testCompile),
207-
// maven-surefire-plugin and scalatest-maven-plugin
205+
// scala-maven-plugin (testCompile), maven-surefire-plugin and scalatest-maven-plugin
208206
setProperty( projectProperties, "maven.test.skip", "true" );
209207
// for scalatest-maven-plugin and specs2-maven-plugin
210208
setProperty( projectProperties, "skipTests", "true" );
@@ -273,23 +271,19 @@ public void execute() throws MojoExecutionException
273271
}
274272

275273
String arg = ( scala2 ? SCALA2_DATA_DIR_OPTION : SCALA3_COVERAGE_OUT_OPTION ) + dataDirectory.getAbsolutePath();
276-
String _scalacOptions = quoteArgument( arg );
277274
String addScalacArgs = arg;
278275

279276
arg = scala2 ? ( SOURCE_ROOT_OPTION + session.getExecutionRootDirectory() ) : "";
280-
_scalacOptions = _scalacOptions + SPACE + quoteArgument( arg );
281277
addScalacArgs = addScalacArgs + PIPE + arg;
282278

283279
if ( !StringUtils.isEmpty( excludedPackages ) )
284280
{
285281
if ( scala2 ) {
286282
arg = SCALA2_EXCLUDED_PACKAGES_OPTION + excludedPackages.replace( "(empty)", "<empty>" );
287-
_scalacOptions = _scalacOptions + SPACE + quoteArgument( arg );
288283
addScalacArgs = addScalacArgs + PIPE + arg;
289284
} else if ( filePackageExclusionSupportingScala3 ) {
290285
String scala3FormatExcludedPackages = excludedPackages.replace( ";", "," );
291286
arg = SCALA3_EXCLUDED_PACKAGES_OPTION + scala3FormatExcludedPackages;
292-
_scalacOptions = _scalacOptions + SPACE + quoteArgument( arg );
293287
addScalacArgs = addScalacArgs + PIPE + arg;
294288
} else {
295289
getLog().warn( "Package exclusion is supported for Scala [3.3.4-3.4.0) or 3.4.2+" );
@@ -300,12 +294,10 @@ public void execute() throws MojoExecutionException
300294
{
301295
if ( scala2 ) {
302296
arg = SCALA2_EXCLUDED_FILES_OPTION + excludedFiles;
303-
_scalacOptions = _scalacOptions + SPACE + quoteArgument( arg );
304297
addScalacArgs = addScalacArgs + PIPE + arg;
305298
} else if ( filePackageExclusionSupportingScala3 ) {
306299
String scala3FormatExcludedFiles = excludedFiles.replace( ";", "," );
307300
arg = SCALA3_EXCLUDED_FILES_OPTION + scala3FormatExcludedFiles;
308-
_scalacOptions = _scalacOptions + SPACE + quoteArgument( arg );
309301
addScalacArgs = addScalacArgs + PIPE + arg;
310302
} else {
311303
getLog().warn( "File exclusion is supported for Scala [3.3.4-3.4.0) or 3.4.2+" );
@@ -314,24 +306,16 @@ public void execute() throws MojoExecutionException
314306

315307
if ( highlighting && scala2 )
316308
{
317-
_scalacOptions = _scalacOptions + SPACE + "-Yrangepos";
318309
addScalacArgs = addScalacArgs + PIPE + "-Yrangepos";
319310
}
320311

321-
String _scalacPlugins = scala2 ? pluginArtifacts.stream()
322-
.map(x -> String.format("%s:%s:%s", x.getGroupId(), x.getArtifactId(), x.getVersion())).collect(Collectors.joining(" ")) : "";
323-
324312
if ( scala2 ) {
325313
arg = PLUGIN_OPTION + pluginArtifacts.stream().map(x -> x.getFile().getAbsolutePath()).collect(Collectors.joining(String.valueOf(java.io.File.pathSeparatorChar)));
326314
addScalacArgs = addScalacArgs + PIPE + arg;
327315
}
328316

329317
Properties projectProperties = project.getProperties();
330318

331-
// for sbt-compiler-maven-plugin (version 1.0.0-beta5+)
332-
setProperty( projectProperties, "sbt._scalacOptions", _scalacOptions );
333-
// for sbt-compiler-maven-plugin (version 1.0.0-beta5+)
334-
setProperty( projectProperties, "sbt._scalacPlugins", _scalacPlugins );
335319
// for scala-maven-plugin (version 3.0.0+)
336320
setProperty( projectProperties, "addScalacArgs", addScalacArgs );
337321
// for scala-maven-plugin (version 3.1.0+)
@@ -371,15 +355,8 @@ public void execute() throws MojoExecutionException
371355
private static final String SCALA3_EXCLUDED_FILES_OPTION = "-coverage-exclude-files:";
372356
private static final String PLUGIN_OPTION = "-Xplugin:";
373357

374-
private static final char DOUBLE_QUOTE = '\"';
375-
private static final char SPACE = ' ';
376358
private static final char PIPE = '|';
377359

378-
private String quoteArgument( String arg )
379-
{
380-
return arg.indexOf( SPACE ) >= 0 ? DOUBLE_QUOTE + arg + DOUBLE_QUOTE : arg;
381-
}
382-
383360
private ScalaVersion resolveScalaVersion()
384361
{
385362
String result = scalaVersion;

0 commit comments

Comments
 (0)