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

Duplicate symbols when referring to a project that uses cross-build JVM / JS #82

Open
Sciss opened this issue Nov 22, 2020 · 1 comment

Comments

@Sciss
Copy link

Sciss commented Nov 22, 2020

https://github.com/Sciss/UnidocCrossProblem

val audioFileURI = uri("https://github.com/Sciss/AudioFile.git#v2.3.1")
val lAudioFile   = ProjectRef(audioFileURI, "rootJVM")

val root = project.in(file("."))
  .enablePlugins(ScalaUnidocPlugin)
  .aggregate(lAudioFile)

When running sbt ++2.13.4! unidoc, basically I am just getting error as if every symbol was already found:

[info] Main Scala API documentation to /data/temp/UnidocCrossProblem/target/scala-2.13/unidoc...
[error] /home/hhrutz/.sbt/1.0/staging/a9131e4c8070a18aff25/audiofile/jvm/src/main/scala/de/sciss/audiofile/AudioFilePlatform.scala:23:7: AudioFilePlatform is already defined as trait AudioFilePlatform
[error] trait AudioFilePlatform {
[error]       ^
[error] /home/hhrutz/.sbt/1.0/staging/a9131e4c8070a18aff25/audiofile/jvm/src/main/scala/de/sciss/audiofile/AudioFileTypePlatform.scala:21:7: AudioFileTypePlatform is already defined as trait AudioFileTypePlatform | => root / Scalaunidoc / doc 1s
[error] trait AudioFileTypePlatform {
[error]       ^
[error] /home/hhrutz/.sbt/1.0/staging/a9131e4c8070a18aff25/audiofile/jvm/src/main/scala/de/sciss/audiofile/ReaderFactoryPlatform.scala:19:7: ReaderFactoryPlatform is already defined as trait ReaderFactoryPlatform | => root / Scalaunidoc / doc 1s
[error] trait ReaderFactoryPlatform {
[error]       ^
[error] /home/hhrutz/.sbt/1.0/staging/a9131e4c8070a18aff25/audiofile/jvm/target/scala-2.13/src_managed/main/sbt-buildinfo/BuildInfo.scala:7:13: BuildInfo is already defined as case class BuildInfo
[error] case object BuildInfo {
[error]             ^
[error] /home/hhrutz/.sbt/1.0/staging/a9131e4c8070a18aff25/audiofile/shared/src/main/scala/de/sciss/audiofile/AsyncAudioFile.scala:21:7: AsyncAudioFile is already defined as trait AsyncAudioFile
[error] trait AsyncAudioFile extends AudioFileBase with AsyncChannel {
[error]       ^
[error] /home/hhrutz/.sbt/1.0/staging/a9131e4c8070a18aff25/audiofile/shared/src/main/scala/de/sciss/audiofile/AsyncBufferHandler.scala:26:26: AsyncBufferHandler is already defined as trait AsyncBufferHandler
[error] private[audiofile] trait AsyncBufferHandler extends BufferHandler {
[error]                          ^
[error] /home/hhrutz/.sbt/1.0/staging/a9131e4c8070a18aff25/audiofile/shared/src/main/scala/de/sciss/audiofile/AsyncBufferHandler.scala:30:26: AsyncBufferReader is already defined as trait AsyncBufferReader
[error] private[audiofile] trait AsyncBufferReader extends AsyncBufferHandler {
[error]                          ^

etc.

I don't know where this comes from. Why does scaladoc/unidoc say all these symbols were already defined? Is there a workaround?

@Sciss
Copy link
Author

Sciss commented Nov 22, 2020

Ok. Despite aggregate only containing the JVM projects, it seems that the JS projects are still referred to. If they are explicitly removed, it seems to work:

val audioFileURI = uri("https://github.com/Sciss/AudioFile.git#v2.3.1")
val lAudioFile   = ProjectRef(audioFileURI, "rootJVM")
val xAudioFile   = ProjectRef(audioFileURI, "rootJS")

val root = project.in(file("."))
  .enablePlugins(ScalaUnidocPlugin)
  .aggregate(lAudioFile)
  .settings(
    scalaVersion := "2.13.4",
    unidocProjectFilter in (ScalaUnidoc, unidoc) := inAnyProject -- inProjects(xAudioFile)  // !
  )

Should this be documented?

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

No branches or pull requests

1 participant