From 0cea2a2ba84ed0c616b04941ec0583b32b1c4057 Mon Sep 17 00:00:00 2001 From: Juan Pedro Moreno Date: Mon, 9 Oct 2017 16:37:55 +0200 Subject: [PATCH] Common settings to an sbt autoplugin --- build.sbt | 2 -- project/ProjectPlugin.scala | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 project/ProjectPlugin.scala diff --git a/build.sbt b/build.sbt index f719ec6..20e5733 100644 --- a/build.sbt +++ b/build.sbt @@ -15,7 +15,6 @@ lazy val plugin = project .in(file("plugin")) .dependsOn(core) .settings(sbtPlugin := true) - .settings(crossScalaVersions := Seq(sbtorgpolicies.model.scalac.`2.12`)) .settings(scalacOptions := Seq("-deprecation", "-encoding", "UTF-8", "-feature", "-unchecked")) .settings( orgBadgeListSetting := List( @@ -31,6 +30,5 @@ lazy val plugin = project lazy val core = project .in(file("core")) .settings(moduleName := "frees-protogen-core") - .settings(crossScalaVersions := Seq(sbtorgpolicies.model.scalac.`2.12`)) .settings(scalaMetaSettings: _*) .settings(libraryDependencies += "io.frees" %% "frees-rpc" % "0.0.3") \ No newline at end of file diff --git a/project/ProjectPlugin.scala b/project/ProjectPlugin.scala new file mode 100644 index 0000000..463d57e --- /dev/null +++ b/project/ProjectPlugin.scala @@ -0,0 +1,16 @@ +import freestyle.FreestylePlugin +import sbt.Keys._ +import sbt._ + +object ProjectPlugin extends AutoPlugin { + + override def trigger: PluginTrigger = allRequirements + + override def requires: Plugins = FreestylePlugin + + override def projectSettings: Seq[Def.Setting[_]] = + Seq( + crossScalaVersions := Seq(sbtorgpolicies.model.scalac.`2.12`) + ) + +} \ No newline at end of file