Skip to content

Fix OSGI exports #225

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

Closed
wants to merge 1 commit into from
Closed

Fix OSGI exports #225

wants to merge 1 commit into from

Conversation

NthPortal
Copy link
Contributor

@NthPortal NthPortal commented Jun 23, 2019

Fix OSGI exports so scala/jdk classfiles are not removed
from the jar.

Fixes #224.

Fix OSGI exports so `scala/jdk` classfiles are not removed
from the jar.
@NthPortal
Copy link
Contributor Author

It's not clear to me how the version is bumped - is that just done by tagging for release?

@NthPortal NthPortal added the bug Something isn't working label Jun 23, 2019
@NthPortal NthPortal requested review from SethTisue and szeiger June 23, 2019 21:07
Copy link
Member

@lrytz lrytz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the module should export scala.jdk only in the 2.11 / 2.12 versions, something like

      OsgiKeys.exportPackage := {
        if (scalaVersion.value.startsWith("2.13."))
          Seq(s"scala.collection.compat.*;version=${version.value}")
        else
          Seq(s"scala.collection.compat.*;version=${version.value},scala.jdk.*;version=${version.value}")
      },

Copy link
Contributor

@szeiger szeiger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After further investigation I have to retract my approval. It's still broken in major ways.

The imports in the manifest are wrong. We're currently importing from a SemVer range based on the project's own version. I don't know where this default comes from but it is really bad. Aborting with an error would be a much better default.

We have some code to generate the correct version ranges in Slick: https://github.com/slick/slick/blob/master/project/Osgi.scala

That alone is still not enough though. We have to use different OSGi headers for different Scala versions. Scala 2.13 has a scala.jdk package so we must not export it ourselves on 2.13.

I'll submit my own PR with these fixes.

@szeiger szeiger mentioned this pull request Jun 24, 2019
@NthPortal
Copy link
Contributor Author

closing in favour of #226

@NthPortal NthPortal closed this Jun 24, 2019
@NthPortal NthPortal deleted the osgi-fix branch January 9, 2020 22:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

scala.jdk package isn't published
4 participants