Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

sbt test:doc Could not find any member to link

I'm attempting to run sbt test:doc and I'm seeing a number of warnings similar to below:

[warn] /Users/tleese/code/my/stuff/src/test/scala/com/my/stuff/common/tests/util/NumberExtractorsSpecs.scala:9: Could not find any member to link for "com.my.stuff.common.util.IntExtractor".

The problem appears to be that Scaladoc references from test sources to main sources are not able to link correctly. Any idea what I might be doing wrong or need to configure?

Below are the relevant sections of my Build.scala:

val docScalacOptions = Seq("-groups", "-implicits", "-external-urls:[urls]")

scalacOptions in (Compile, doc) ++= docScalacOptions
scalacOptions in (Test, doc) ++= docScalacOptions
autoAPIMappings := true
like image 264
Taylor Leese Avatar asked Apr 17 '14 01:04

Taylor Leese


1 Answers

Not sure if this is a satisfactory solution, but...

Scaladoc currently expects pairs of jar and URL to get the external linking to work. You can force sbt to link internal dependencies using JARs using exportJars. Compare the value of

$ show test:fullClasspath

before and after setting exportJars. Next, grab the name of the JAR that's being used and link it to the URL you'll be uploading it to.

scalaVersion := "2.11.0"

autoAPIMappings := true

exportJars := true

scalacOptions in (Test, doc) ++= Opts.doc.externalAPI((
  file(s"${(packageBin in Compile).value}") -> url("http://example.com/")) :: Nil)

Now I see that test:doc a Scaladoc with links to http://example.com/index.html#foo.IntExtractor from my foo.IntExtractor.

like image 95
Eugene Yokota Avatar answered Oct 04 '22 04:10

Eugene Yokota