Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use full scala version suffix for scalac-scoverage-... dependencies #152

Closed
maslovalex opened this issue Apr 29, 2021 · 8 comments · Fixed by #155
Closed

use full scala version suffix for scalac-scoverage-... dependencies #152

maslovalex opened this issue Apr 29, 2021 · 8 comments · Fixed by #155

Comments

@maslovalex
Copy link

maslovalex commented Apr 29, 2021

scalac-scoverage-plugin and scalac-scoverage-runtime from version 1.4.2 publish artifacts with specific scala version suffix.

see https://search.maven.org/search?q=scalac-scoverage-runtime

ATM, it is possible to use by setting scoverageScalaVersion like this.

scoverage {
  scoverageScalaVersion = '2.12.13'
}

But in case scoverageScalaVersion resolved from the scala-library dependency only major part is taken:

def scalaVersion = fullScalaVersion.substring(0, fullScalaVersion.lastIndexOf("."))

scoverage("org.scoverage:scalac-scoverage-plugin_$fullScoverageVersion")

@tnielens
Copy link

tnielens commented May 3, 2021

Same here, this prevents using latest scala versions due to
scoverage/scalac-scoverage-plugin#305

@maiflai
Copy link
Contributor

maiflai commented May 3, 2021

Sorry - does this really prevent the use of the latest scala versions?

It's less convenient than before, but you should be able to set

scoverage {
  scoverageVersion = '1.4.4'
  scoverageScalaVersion = '2.12.13'
}

I think this is required because the publishing of the upstream compiler plugin has changed.

@tnielens
Copy link

tnielens commented May 3, 2021

@maiflai your snippet will not work I think because as of version 1.4.3, the scoverage scala plugin is published against full scala versions only (2.12.12, 2.12.13, etc) and no shorter binary versions (2.12, 2.13) anymore. See https://mvnrepository.com/artifact/org.scoverage/scalac-scoverage-plugin .

@maiflai
Copy link
Contributor

maiflai commented May 3, 2021

It seems to work for me.

Perhaps you could provide a reproduction of the issue?

@maslovalex
Copy link
Author

I think that should work (as I mentioned it my 1st message).

It will not work if you omit setting scoverageScalaVersion and expect plugin to set it based on the scala-library version from dependencies.

@maiflai
Copy link
Contributor

maiflai commented May 3, 2021

Thanks for confirming.

Unfortunately what looked like a trivial fix isn't working quite as expected.

I'd prefer to concentrate on the --parallel issue rather than this as it appears to have a valid workaround.

@tnielens
Copy link

tnielens commented May 3, 2021

Alright I'm probably wrong. I'll check if I can come up with a repro or if the issue is on my build. Thanks!

@tnielens
Copy link

tnielens commented Jun 2, 2021

back here :)
I'm currently trying with

{
    scoverageVersion = '1.4.8'
    scoverageScalaVersion = '2.12.14'
}

scoverage-plugin seems to be published with full scala version whereas scoverage-runtime with binary version only. So setting scoverageScalaVersion to 2.12 (resp. 2.12.14) will fail to resolve scoverage-plugin (resp. scoverage-runtime)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants