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

Scripted adds a library dependency on every project #3917

Closed
jvican opened this issue Feb 2, 2018 · 5 comments
Closed

Scripted adds a library dependency on every project #3917

jvican opened this issue Feb 2, 2018 · 5 comments
Labels
Milestone

Comments

@jvican
Copy link
Member

jvican commented Feb 2, 2018

steps

  1. Clone https://github.com/jvican/sbt-library-deps-bug-scripted.
  2. Run show libraryDependencies.

problem

Sbt-scripted, which is added as a plugin, add a library dependency to my project?

expectation

Sbt-scripted does not add anything to my projects' library dependencies. Note that my project is not an sbt plugin.

notes

sbt version: all 1.x series.

@jvican
Copy link
Member Author

jvican commented Feb 2, 2018

sbt @ test > show libraryDependencies
[info] example / libraryDependencies
[info] 	List(org.scala-lang:scala-library:2.12.4, org.scala-sbt:scripted-sbt:1.1.0:scripted-sbt, org.scala-sbt:sbt-launch:1.1.0:scripted-sbt-launch)
[info] libraryDependencies
[info] 	List(org.scala-lang:scala-library:2.12.4, org.scala-sbt:scripted-sbt:1.1.0:scripted-sbt, org.scala-sbt:sbt-launch:1.1.0:scripted-sbt-launch)

@eed3si9n
Copy link
Member

eed3si9n commented Feb 2, 2018

It makes sense:

https://github.com/sbt/sbt/blob/v1.1.0/scripted/plugin/src/main/scala/sbt/ScriptedPlugin.scala#L43-L54

    libraryDependencies ++= (partialVersion(scriptedSbt.value) match {
      case Some((0, 13)) =>
        Seq(
          "org.scala-sbt" % "scripted-sbt" % scriptedSbt.value % ScriptedConf,
          "org.scala-sbt" % "sbt-launch" % scriptedSbt.value % ScriptedLaunchConf
        )
      case Some((1, _)) =>
        Seq(
          "org.scala-sbt" %% "scripted-sbt" % scriptedSbt.value % ScriptedConf,
          "org.scala-sbt" % "sbt-launch" % scriptedSbt.value % ScriptedLaunchConf
        )
    }),

combined with #3514.

@jvican
Copy link
Member Author

jvican commented Feb 3, 2018

I don't understand, is this the expected behaviour? This should only happen for those projects that are sbt plugins, not for all my projects.

@eed3si9n
Copy link
Member

eed3si9n commented Feb 8, 2018

This should only happen for those projects that are sbt plugins, not for all my projects.

Right. This behavior is now considered a bug (#3514), and it's now fixed via #3875, so hopefully you won't see this in 1.2.0.
In the mean time, you'd have to disable the plugin on each subprojects.

@eed3si9n eed3si9n added the Bug label Feb 8, 2018
@dwijnand dwijnand added this to the 1.2.0 milestone Feb 8, 2018
@dwijnand
Copy link
Member

dwijnand commented Feb 8, 2018

fixed via #3875

closing

@dwijnand dwijnand closed this as completed Feb 8, 2018
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

3 participants