typelevel / sbt-typelevel

Let sbt work for you.
https://typelevel.org/sbt-typelevel/
Apache License 2.0
167 stars 47 forks source link

Incorrect scaladoc links to JDK apidocs #592

Open durban opened 1 year ago

durban commented 1 year ago

Links to JDK APIs in the generated scaladoc seem to be incorrect. Two examples:

In theory this can be an sbt/scaladoc bug, but I see some settings here, which seem related, but somehow they're not applied(?).

armanbilge commented 1 year ago

Hmm, maybe we forgot to prefix it with Compile /? 🤔 https://github.com/typelevel/sbt-typelevel/blob/1f6850a0906ffdb47086a24d268e3f51b9a43408/settings/src/main/scala/org/typelevel/sbt/TypelevelSettingsPlugin.scala#L370

armanbilge commented 1 year ago

No, that seems fine. So now I suspect maybe we are not mapping the right thing 🤔

https://github.com/typelevel/sbt-typelevel/blob/1f6850a0906ffdb47086a24d268e3f51b9a43408/settings/src/main/scala/org/typelevel/sbt/TypelevelSettingsPlugin.scala#L388

FTR that's cargo-culted from here. https://github.com/scala-js/scala-js/blob/e0afd0f096c6b096ce7ad17f46c07142ac80c7ef/project/Build.scala#L442-L446

armanbilge commented 1 year ago

I think we should try refreshing our cargo-cult with exactly whats in Scala.js, for example this part seems interesting.

https://github.com/scala-js/scala-js/blob/e0afd0f096c6b096ce7ad17f46c07142ac80c7ef/project/Build.scala#L428-L430

armanbilge commented 1 year ago

Tried fixing this in 4b8962bdb2921a578e9cb66cf89515bf5ecdf09d but it didn't fix Choam 😕 so either we're still not doing it right, or perhaps sbt is overriding us.

durban commented 1 year ago

Thanks for trying! This whole apiMappings setting is very mysterious to me, so I don't have any ideas...

durban commented 1 year ago

Have we seen this setting working anywhere? I see that in the scala-js API it seems to work; I suspect that's because it uses the old (JVM 8) url...

Edit: what I wrote above is incorrect, I still don't understand what's happening.

durban commented 1 year ago

There is a strange interaction with the -release option, but it doesn't seem sbt-typelevel specific, so I've opened https://github.com/scala/bug/issues/12820.

armanbilge commented 1 year ago

Aha, I see, thanks for investigating. But this does illustrate our setting is not really doing anything.