sbt-release
                                
                                 sbt-release copied to clipboard
                                
                                    sbt-release copied to clipboard
                            
                            
                            
                        ReleasePlugin should be disabled when JvmPlugin is disabled
Because ReleasePlugin requires settings like managedClasspath defined in JvmPlugin
Ping @jroper
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.
In order to make these dependencies optional and still keep the same behavior of the current sbt-release, we need the following steps:
- Create a ReleaseCorePlugin, which does not depend onJvmPlugin.
- Let ReleasePlugindepend on bothReleaseCorePluginandJvmPlugin.
- Move those settings that does not require managedClasspathfromReleasePlugintoReleaseCorePlugin.
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.
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.