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

scala-library is getting bundled with libraryDependencies, even if bundleScalaLibrary is set to false #106

Closed
moglideveloper opened this issue May 9, 2021 · 1 comment
Assignees
Labels

Comments

@moglideveloper
Copy link

If any libraryDepencies is used, then scala-library is also get bundled even when bundleScalaLibrary is set to false.

Below is the command that is used to package plugin :-
sbt clean compile packageArtifact

Simplified project to reproduce this issue :-
https://github.com/moglideveloper/SamplePlugin

build.sbt


name := "sample"

scalaVersion := "2.13.2"
ThisBuild / intellijPluginName := "LogicOverCode"
ThisBuild / intellijBuild := "211.7142.13"
ThisBuild / intellijPlatform := intellijPlatform.in(Global).??(IntelliJPlatform.IdeaCommunity).value
ThisBuild / bundleScalaLibrary  := false

intellijPlugins += "org.intellij.scala:2021.1.18".toPlugin

// scala library is coming with this dependency
libraryDependencies += "com.github.pathikrit" %% "better-files" % "3.9.1"

lazy val scalaIntellij = project.in(file("."))
  .enablePlugins(SbtIdeaPlugin)

@mutcianm mutcianm added the bug label May 11, 2021
@mutcianm mutcianm self-assigned this May 11, 2021
@mutcianm
Copy link
Collaborator

This is actually related to sbt/sbt#4632
scala-library is correctly added to "Provided" but still ends up in the "Compile" scope because it's a transitive dependency of "better-files" which is an expected sbt behaviour.
I guess the only reasonable solution is to explicitly filter out all scala-library instances from the resulting classpath.

mutcianm added a commit that referenced this issue May 14, 2021
handles the case when scala-library is filtered out from the classpath
when using "bundleScalaLibrary = false" in IJ plugins that depend
on Scala plugin etc.
mutcianm added a commit that referenced this issue May 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants