Skip to content
New issue

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

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

Already on GitHub? # to your account

Scoverage: xmlCoberturaReportAll can not be found. #3136

Closed
WeissP opened this issue Apr 29, 2024 · 8 comments · Fixed by #3137
Closed

Scoverage: xmlCoberturaReportAll can not be found. #3136

WeissP opened this issue Apr 29, 2024 · 8 comments · Fixed by #3137
Milestone

Comments

@WeissP
Copy link

WeissP commented Apr 29, 2024

I am trying to generate XML scoverage report in Cobertura format via command xmlCoberturaReportAll, however it can not be found, which contradicts the information provided in the documentation.

To reproduce:

  1. download example 1-simple-scala
  2. change build.sc to
import $ivy.`com.lihaoyi::mill-contrib-scoverage:`
import mill.contrib.scoverage.ScoverageModule
import mill._, scalalib._

object foo extends RootModule with ScalaModule with ScoverageModule {
  def scalaVersion = "2.13.11"
  def scoverageVersion = "2.0.10"
  def ivyDeps = Agg(
    ivy"com.lihaoyi::scalatags:0.12.0",
    ivy"com.lihaoyi::mainargs:0.6.2"
  )

  object test extends ScalaTests with ScoverageTests {
    def ivyDeps = Agg(ivy"com.lihaoyi::utest:0.7.11")
    def testFramework = "utest.runner.Framework"
  }
}
  1. run mill test
  2. run mill scoverage.xmlCoberturaReportAll

The following is the result of mill resolve scoverage._, note that xmlReport and htmlReport can be found. Does this mean I need to install extra dependencies?

scoverage.allIvyDeps
scoverage.allScalacOptions
scoverage.allSourceFiles
scoverage.allSources
scoverage.ammoniteReplClasspath
scoverage.ammoniteVersion
scoverage.artifactId
scoverage.artifactName
scoverage.artifactNameParts
scoverage.artifactScalaVersion
scoverage.artifactSuffix
scoverage.assembly
scoverage.bspCompileClassesPath
scoverage.bspCompileClasspath
scoverage.bspCompiledClassesAndSemanticDbFiles
scoverage.bspLocalClasspath
scoverage.bspTransitiveCompileClasspath
scoverage.bspTransitiveLocalClasspath
scoverage.compile
scoverage.compileClasspath
scoverage.compileIvyDeps
scoverage.compileResources
scoverage.compiledClassesAndSemanticDbFiles
scoverage.console
scoverage.consoleReport
scoverage.crossFullScalaVersion
scoverage.data
scoverage.docJar
scoverage.docJarUseArgsFile
scoverage.docResources
scoverage.docSources
scoverage.finalMainClass
scoverage.finalMainClassOpt
scoverage.forkArgs
scoverage.forkEnv
scoverage.forkWorkingDir
scoverage.generatedSources
scoverage.htmlReport
scoverage.ideaCompileOutput
scoverage.ivyDeps
scoverage.ivyDepsTree
scoverage.jar
scoverage.javacOptions
scoverage.javadocOptions
scoverage.launcher
scoverage.localClasspath
scoverage.localCompileClasspath
scoverage.mainClass
scoverage.mandatoryIvyDeps
scoverage.mandatoryScalacOptions
scoverage.manifest
scoverage.platformSuffix
scoverage.prepareOffline
scoverage.prependShellScript
scoverage.repl
scoverage.resolvedAmmoniteReplIvyDeps
scoverage.resolvedIvyDeps
scoverage.resolvedRunIvyDeps
scoverage.resolvedSemanticDbJavaPluginIvyDeps
scoverage.resources
scoverage.run
scoverage.runBackground
scoverage.runClasspath
scoverage.runIvyDeps
scoverage.runLocal
scoverage.runMain
scoverage.runMainBackground
scoverage.runMainLocal
scoverage.runUseArgsFile
scoverage.scalaCompilerClasspath
scoverage.scalaDocClasspath
scoverage.scalaDocOptions
scoverage.scalaDocPluginClasspath
scoverage.scalaDocPluginIvyDeps
scoverage.scalaLibraryIvyDeps
scoverage.scalaOrganization
scoverage.scalaVersion
scoverage.scalacOptions
scoverage.scalacPluginClasspath
scoverage.scalacPluginIvyDeps
scoverage.semanticDbData
scoverage.semanticDbEnablePluginScalacOptions
scoverage.semanticDbJavaVersion
scoverage.semanticDbPluginClasspath
scoverage.semanticDbPluginIvyDeps
scoverage.semanticDbScalaVersion
scoverage.semanticDbVersion
scoverage.showModuleDeps
scoverage.sourceJar
scoverage.sources
scoverage.transitiveCompileClasspath
scoverage.transitiveCompileIvyDeps
scoverage.transitiveIvyDeps
scoverage.transitiveLocalClasspath
scoverage.unmanagedClasspath
scoverage.upstreamAssembly
scoverage.upstreamAssemblyClasspath
scoverage.upstreamCompileOutput
scoverage.xmlReport
scoverage.zincReportCachedProblems
@lefou
Copy link
Member

lefou commented Apr 30, 2024

You discovered a typo in the documentation. The target is xmlCoberturaReport, not xmlCoberturaReportAll.

Also, please compare the version of the documentation with the Mill version you use locally. This is a pretty recent addition, so make sure to use a recent Mill version. E..g the latest current Mill snapshot release is 0.11.7-70-654f58.

@WeissP
Copy link
Author

WeissP commented Apr 30, 2024

I have updated mill to 0.11.7, but the command still can't be found.

mill --version
Mill Build Tool version 0.11.7
Java version: 11.0.19, vendor: Oracle Corporation, runtime: /nix/store/n17ckjsgngxyyz6x900w589d92kpn116-openjdk-11.0.19+7/lib/openjdk
Default locale: en_US, platform encoding: UTF-8
OS name: "Linux", version: 6.6.28, arch: amd64

Then I have invoked following commands

mill clean
mill test
mill scoverage.xmlCoberturaReport

The result was the same as before.

@lefou
Copy link
Member

lefou commented Apr 30, 2024

As said before, you may need to use the version which the documentation is referring to. This is currently 0.11.7-70-654f58.

image

@lefou
Copy link
Member

lefou commented Apr 30, 2024

The Cobertura support was added after 0.11.7.

@WeissP
Copy link
Author

WeissP commented Apr 30, 2024

Oh sorry, I just realized how new this feature is. I guess I will wait until the provided bootstrap script is updated to include this feature (unless there is a fairly simple way to install mill in such a version, even in Ci?).

For now I will close the issue, if it still doesn't work after being updated, I will reopen it. Thanks a lot for you help!

@WeissP WeissP closed this as completed Apr 30, 2024
@lefou
Copy link
Member

lefou commented Apr 30, 2024

Oh, since you already use a bootstrap script, using a specific version is fairly easy. https://mill-build.com/mill/Installation_IDE_Support.html#_overriding_mill_versions

@lefou
Copy link
Member

lefou commented Apr 30, 2024

Reopening, since the documentation is wrong and needs to be fixed.

@lefou lefou reopened this Apr 30, 2024
@WeissP
Copy link
Author

WeissP commented Apr 30, 2024

Oh, since you already use a bootstrap script, using a specific version is fairly easy. https://mill-build.com/mill/Installation_IDE_Support.html#_overriding_mill_versions

Oh I didn't know mill can be updated so easily, now it works. Thanks!

lefou added a commit that referenced this issue May 3, 2024
@lefou lefou added this to the 0.11.8 milestone May 3, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants