sbt / sbt-unidoc

sbt plugin to create a unified Scaladoc or Javadoc API document across multiple subprojects.
Apache License 2.0
124 stars 27 forks source link

<object> is already defined as trait ... #21

Open abrighton opened 9 years ago

abrighton commented 9 years ago

Unidoc is giving me errors when a trait or class has a companion object.

For example: RunId is already defined as object RunId RunId is already defined as case class RunId

The project containing the class is a scala/scala.js shared "crossProject" in a multi-project build (scala-2.11.7) . When I remove the shared project, the unidoc problems go away. This seems to also be a problem with the sbt gh-pages plugin.

julienrf commented 7 years ago

I have the same problem. Is there any known workaround?

taig commented 7 years ago

Explicitly disabling the javascript modules should solve that:

unidocProjectFilter in ( ScalaUnidoc, unidoc ) :=
    inAnyProject -- inProjects( i18nJS, schemaJS )
xerial commented 6 years ago

@Taig Thanks. Explicitly removing JS projects worked for me. But I guess sbt-unidoc is including projects not mentioned in aggregate when building scaladoc.

scottweaver commented 6 years ago

I encountered the same issue whilst using the sbt-scala-crossproject plugin. @Taig's approach works here as well. In this case, by disabling all but one of the versions.

lazy val root = project.in(file("."))
  .settings(
    autoAPIMappings := true,
    unidocProjectFilter in ( ScalaUnidoc, unidoc ) :=
      inAnyProject -- inProjects( models_2_11 )
  )
  .enablePlugins(ScalaUnidocPlugin)
  .aggregate(models_2_12)