sbt-release icon indicating copy to clipboard operation
sbt-release copied to clipboard

ReleasePlugin should be disabled when JvmPlugin is disabled

Open Atry opened this issue 9 years ago • 5 comments

Because ReleasePlugin requires settings like managedClasspath defined in JvmPlugin

Atry avatar Jun 01 '16 03:06 Atry

Ping @jroper

Atry avatar Jun 08 '16 07:06 Atry

I think it would be better to make those dependencies optional, ie depend on managedClasspath only if it's set. I don't think release plugin should depend on JvmPlugin, it's conceivable that you may release an sbt project that doesn't use the JVM.

jroper avatar Jul 18 '16 05:07 jroper

In order to make these dependencies optional and still keep the same behavior of the current sbt-release, we need the following steps:

  1. Create a ReleaseCorePlugin, which does not depend on JvmPlugin.
  2. Let ReleasePlugin depend on both ReleaseCorePlugin and JvmPlugin.
  3. Move those settings that does not require managedClasspath from ReleasePlugin to ReleaseCorePlugin.

Atry avatar Jul 18 '16 05:07 Atry

Hi, @jroper ,

Since this PR is a bug fix, could you merge this PR for now?

Without this PR, if some one added sbt-release dependency in /project/plugins.sbt for a multi-project build and disabled JvmPlugin in /non-jvm-subproject/build.sbt for one of these projects, the build would be broken.

Atry avatar Aug 12 '16 07:08 Atry

I'll merge if you update it to make the dependency on managedClasspath optional. You don't need to do the multiple plugins that you suggested, just use the ? operator, eg:

val maybeClasspath: Option[Classpath] = managedClasspath.?.value

Requiring the JvmPlugin to be enabled in order for the ReleasePlugin to work is unnecessary.

Also, I'd like to see a scripted test added to ensure that the bug is fixed and doesn't regress in future.

jroper avatar Aug 14 '16 03:08 jroper