سؤال

There is a project shared with multiple participants. Some participants installed a global sbteclipse at ~/.sbt/0.13/plugins/plugins.sbt, while other participants didn't.

I want to put some sbt settings in the project's build.sbt, like:

EclipseKeys.createSrc := EclipseCreateSrc.Unmanaged + EclipseCreateSrc.Managed + EclipseCreateSrc.Source

I wish to apply these settings only for those participants who have installed a global sbteclipse, and do not affect others.

How can I achieve that?

هل كانت مفيدة؟

المحلول

I have tried to use some complex settings like:

try {
  Class.forName("com.typesafe.sbteclipse.plugin.EclipsePlugin$EclipseKeys").getMethod("createSrc").invoke(null).asInstanceOf[SettingKey[_]] := ...
catch {
  case e: Exception => Seq.empty : SettingsDefinition
}

I am still looking for a better solution.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top