Skip to content
Browse files

Merge pull request #309 from jroper/support-disabled-plugin

Ensure Eclipse plugin works when disabled
  • Loading branch information...
2 parents 5b83f59 + af3bc44 commit b87f1efb58fcb46b30976427d84f2f4055963cfa @dragos dragos committed
View
6 src/main/scala/com/typesafe/sbteclipse/core/EclipsePlugin.scala
@@ -75,7 +75,11 @@ object EclipsePlugin {
def buildEclipseSettings: Seq[Setting[_]] = {
import EclipseKeys._
Seq(
- skipParents := true
+ skipParents := true,
+ // Typically, this will be overridden for each project by the project level default of false. However, if a
+ // project disables the EclipsePlugin, the project level default won't be set, and so it will fall back to this
+ // build level setting, which means the project will be skipped.
+ skipProject := true
)
}
View
3 src/sbt-test/sbteclipse/07-disabled-plugin/build.sbt
@@ -0,0 +1,3 @@
+lazy val projectA = project in file("a")
+lazy val projectB = (project in file("b"))
+ .disablePlugins(EclipsePlugin)
View
7 src/sbt-test/sbteclipse/07-disabled-plugin/project/plugins.sbt
@@ -0,0 +1,7 @@
+{
+ val pluginVersion = System.getProperty("plugin.version")
+ if(pluginVersion == null)
+ throw new RuntimeException("""|The system property 'plugin.version' is not defined.
+ |Specify this property using the scriptedLaunchOpts -D.""".stripMargin)
+ else addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % pluginVersion)
+}
View
3 src/sbt-test/sbteclipse/07-disabled-plugin/test
@@ -0,0 +1,3 @@
+> eclipse
+$ exists a/.classpath
+-$ exists b/.classpath

0 comments on commit b87f1ef

Please sign in to comment.
Something went wrong with that request. Please try again.