Skip to content

Commit c28f9db

Browse files
committed
#47 - Allow Scala binary (short form) version as Scala version.
1 parent 57f3c80 commit c28f9db

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

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

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,10 @@ public class SCoveragePreCompileMojo
7373
/**
7474
* Scala version used for compiler plugin artifact resolution.
7575
* <ul>
76-
* <li>if specified, and starts with {@code 2.10.} - <b>{@code scalac-scoverage-plugin_2.10}</b> will be used</li>
77-
* <li>if specified, and starts with {@code 2.11.} - <b>{@code scalac-scoverage-plugin_2.11}</b> will be used</li>
78-
* <li>if specified, and starts with {@code 2.12.} - <b>{@code scalac-scoverage-plugin_2.12}</b> will be used</li>
79-
* <li>if specified, but does not start with {@code 2.10.}, {@code 2.11.} or {@code 2.12.} or is not specified - plugin execution will be skipped</li>
76+
* <li>if specified, and equals {@code 2.10} or starts with {@code 2.10.} - <b>{@code scalac-scoverage-plugin_2.10}</b> will be used</li>
77+
* <li>if specified, and equals {@code 2.11} or starts with {@code 2.11.} - <b>{@code scalac-scoverage-plugin_2.11}</b> will be used</li>
78+
* <li>if specified, and equals {@code 2.12} or starts with {@code 2.12.} - <b>{@code scalac-scoverage-plugin_2.12}</b> will be used</li>
79+
* <li>if specified, but does not meet any of the above conditions or if not specified - plugin execution will be skipped</li>
8080
* </ul>
8181
*
8282
* @since 1.0.0
@@ -211,21 +211,21 @@ public void execute() throws MojoExecutionException
211211

212212
long ts = System.currentTimeMillis();
213213

214-
String scalaMainVersion = null;
214+
String scalaBinaryVersion = null;
215215
String resolvedScalaVersion = resolveScalaVersion();
216216
if ( resolvedScalaVersion != null )
217217
{
218-
if ( resolvedScalaVersion.startsWith( "2.10." ) )
218+
if ( "2.10".equals( resolvedScalaVersion ) || resolvedScalaVersion.startsWith( "2.10." ) )
219219
{
220-
scalaMainVersion = "2.10";
220+
scalaBinaryVersion = "2.10";
221221
}
222-
else if ( resolvedScalaVersion.startsWith( "2.11." ) )
222+
else if ( "2.11".equals( resolvedScalaVersion ) || resolvedScalaVersion.startsWith( "2.11." ) )
223223
{
224-
scalaMainVersion = "2.11";
224+
scalaBinaryVersion = "2.11";
225225
}
226-
else if ( resolvedScalaVersion.startsWith( "2.12." ) )
226+
else if ( "2.12".equals( resolvedScalaVersion ) || resolvedScalaVersion.startsWith( "2.12." ) )
227227
{
228-
scalaMainVersion = "2.12";
228+
scalaBinaryVersion = "2.12";
229229
}
230230
else
231231
{
@@ -244,8 +244,8 @@ else if ( resolvedScalaVersion.startsWith( "2.12." ) )
244244

245245
try
246246
{
247-
Artifact pluginArtifact = getScalaScoveragePluginArtifact( scalaMainVersion );
248-
Artifact runtimeArtifact = getScalaScoverageRuntimeArtifact( scalaMainVersion );
247+
Artifact pluginArtifact = getScalaScoveragePluginArtifact( scalaBinaryVersion );
248+
Artifact runtimeArtifact = getScalaScoverageRuntimeArtifact( scalaBinaryVersion );
249249

250250
if ( pluginArtifact == null )
251251
{

0 commit comments

Comments
 (0)