-
Notifications
You must be signed in to change notification settings - Fork 29
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
Scala library is not bundled when the plugin is defined as a nested project #133
Comments
Hi there, thanks for the report. sbt-idea-plugin/packaging/src/main/scala/org/jetbrains/sbtidea/packaging/PackagingKeysInit.scala Line 23 in 08613ec
You can experiment with setting packageLibraryMappings := Seq.empty , or adjusting the default values. Mapping to None means that the library dependency will be ignored in the final output.
|
It seems to me many things do not work when I try to build a plugin in a subproject instead of root project. To start, it seems many settings need to be placed in I was not able to make even this working: lazy val myPlugin = project.enablePlugins(SbtIdeaPlugin) This works fine: lazy val myPlugin = project.in(file(".")).enablePlugins(SbtIdeaPlugin) The result of the plugin build was incomplete, done partly in If one wants to publish the plugin from a repository which also builds and publishes other things, it seems to me the only workable solution at the moment is to create a branch or a fork with completely different and independent build.sbt dedicated just to a plugin. Maybe there are some settings how to make this work, but my impression is the only really supported scenario is when the whole build.sbt is dedicated to the plugin which is located at the build root? |
I can confirm it with 100% certainty, but my impression is the same. It might be helpful to improve it. |
Thanks. It is not a big issue, the dedicated build.sbt is workable. I am hitting more serious issues anyway, e.g. difficulties with using native OpenGL and LWJGL library. The whole process is quite complicated and when anything goes wrong, one does not get much useful information, e.g. why some particular jars are missing. |
Steps to reproduce
sbt clean packageArtifact
.myAwesomePlugin/target/plugin
directory. It will contain the JAR with the plugin code (and the dependency JARs if you add any), but thescala-library
dependency will be missing.sbt runIDE
and open any project. You will get a classloader error. The message can sometimes be quite obscure, but it is always caused by the missing Scala library..
(this can be done by uncommenting a few lines inbuild.sbt
. After runningsbt clean packageArtifact
, observe that thetarget/plugin
directory contains both the plugin JAR and the Scala library.Adding
ThisBuild / bundleScalaLibrary := true
doesn't seem to have any effect.This issue might be related to #106.
The text was updated successfully, but these errors were encountered: