diff options
-rw-r--r-- | build.sbt | 24 | ||||
-rw-r--r-- | project/DriverConfigurations.scala | 105 | ||||
-rw-r--r-- | project/plugins.sbt | 12 |
3 files changed, 4 insertions, 137 deletions
@@ -1,26 +1,10 @@ import sbt._ import Keys._ -import DriverConfigurations._ - - -lazy val compileScalastyle = taskKey[Unit]("compileScalastyle") - -lazy val buildSettings = Defaults.coreDefaultSettings ++ Seq ( - organization := "com.drivergrp", - name := "core", - scalaVersion := "2.11.8", - scalacOptions := Seq("-unchecked", "-deprecation", "-feature", "-Xlint", "-encoding", "utf8", - "-language:higherKinds", "-language:implicitConversions", "-language:postfixOps", - "-Ywarn-infer-any", "-Ywarn-unused", "-Ywarn-unused-import"), - fork in run := true, - compileScalastyle := (scalastyle in Compile).toTask("").value, - (compile in Compile) <<= ((compile in Compile) dependsOn compileScalastyle) -) ++ wartRemoverSettings ++ DriverConfigurations.scalafmtSettings lazy val akkaHttpV = "2.4.8" lazy val core = (project in file(".")). - settings(buildSettings: _*). + settings(name := "core"). settings( libraryDependencies ++= Seq( "com.typesafe.akka" %% "akka-http-core" % akkaHttpV, @@ -35,9 +19,7 @@ lazy val core = (project in file(".")). "com.typesafe.scala-logging" %% "scala-logging" % "3.1.0", "ch.qos.logback" % "logback-classic" % "1.1.3", "org.slf4j" % "slf4j-nop" % "1.6.4", - "org.scalaz" %% "scalaz-core" % "7.2.4", - "com.github.swagger-akka-http" %% "swagger-akka-http" % "0.7.1", - "com.lihaoyi" %% "acyclic" % "0.1.4" % "provided" + "com.github.swagger-akka-http" %% "swagger-akka-http" % "0.7.1" )) .gitPluginConfiguration - .settings(publicationSettings() ++ releaseSettings()) + .settings(publicationSettings ++ releaseSettings) diff --git a/project/DriverConfigurations.scala b/project/DriverConfigurations.scala deleted file mode 100644 index 4044f34..0000000 --- a/project/DriverConfigurations.scala +++ /dev/null @@ -1,105 +0,0 @@ -import com.typesafe.sbt.SbtGit.git -import com.typesafe.sbt.{GitBranchPrompt, GitVersioning} -import org.scalafmt.sbt.ScalaFmtPlugin.autoImport._ -import sbt.Keys._ -import sbt._ -import sbtrelease.{Version, _} -import wartremover.WartRemover.autoImport._ -// we hide the existing definition for setReleaseVersion to replace it with our own -import sbtrelease.ReleasePlugin.autoImport.ReleaseTransformations._ -import sbtrelease.ReleasePlugin.autoImport._ -import sbtrelease.ReleaseStateTransformations.{setReleaseVersion => _} - - -object DriverConfigurations { - - lazy val wartRemoverSettings = Seq( - wartremoverErrors in (Compile, compile) ++= Warts.allBut( - Wart.AsInstanceOf, Wart.Nothing, Wart.Overloading, Wart.DefaultArguments, Wart.Any, - Wart.Option2Iterable, Wart.ExplicitImplicitTypes, Wart.Throw, Wart.ToString, Wart.NoNeedForMonad - ) - ) - - lazy val acyclicSettings = Seq( - autoCompilerPlugins := true, - addCompilerPlugin("com.lihaoyi" %% "acyclic" % "0.1.4") - ) - - lazy val scalafmtSettings = Seq( - scalafmtConfig in ThisBuild := Some(file(".scalafmt")), - testExecution in (Test, test) <<= - (testExecution in (Test, test)) dependsOn (scalafmtTest in Compile, scalafmtTest in Test) - ) - - lazy val compileScalastyle = taskKey[Unit]("compileScalastyle") - - def publicationSettings() = Seq( - publishTo := Some(Resolver.file("file", new File("releases"))) - // publishTo := { // TODO: For actual Driver jar repo - // val nexus = "https://my.artifact.repo.net/" - // if (isSnapshot.value) - // Some("snapshots" at nexus + "content/repositories/snapshots") - // else - // Some("releases" at nexus + "service/local/staging/deploy/maven2") - // } - ) - - def releaseSettings() = { - def setVersionOnly(selectVersion: Versions => String): ReleaseStep = { st: State => - val vs = st.get(ReleaseKeys.versions).getOrElse( - sys.error("No versions are set! Was this release part executed before inquireVersions?")) - val selected = selectVersion(vs) - - st.log.info("Setting version to '%s'." format selected) - val useGlobal = Project.extract(st).get(releaseUseGlobalVersion) - - reapply(Seq( - if (useGlobal) version in ThisBuild := selected else version := selected - ), st) - } - - lazy val setReleaseVersion: ReleaseStep = setVersionOnly(_._1) - - Seq( - releaseIgnoreUntrackedFiles := true, - // Check http://blog.byjean.eu/2015/07/10/painless-release-with-sbt.html for details - releaseVersionBump := sbtrelease.Version.Bump.Minor, - releaseVersion <<= releaseVersionBump(bumper => { - ver => Version(ver) - .map(_.withoutQualifier) - .map(_.bump(bumper).string).getOrElse(versionFormatError) - }), - releaseProcess := Seq[ReleaseStep]( - checkSnapshotDependencies, - inquireVersions, - runTest, // probably, runTest after setReleaseVersion, if tests depend on version - setReleaseVersion, - commitReleaseVersion, // performs the initial git checks - tagRelease, - publishArtifacts, - setNextVersion, - commitNextVersion, - pushChanges // also checks that an upstream branch is properly configured - ) - ) - } - - implicit class driverConfigurations(project: Project) { - - def gitPluginConfiguration: Project = { - val VersionRegex = "v([0-9]+.[0-9]+.[0-9]+)-?(.*)?".r - - project - .enablePlugins(GitVersioning, GitBranchPrompt) - .settings( - git.useGitDescribe := true, - git.baseVersion := "0.0.0", - git.gitTagToVersionNumber := { - case VersionRegex(v, "SNAPSHOT") => Some(s"$v-SNAPSHOT") - case VersionRegex(v, "") => Some(v) - case VersionRegex(v, s) => Some(s"$v-$s-SNAPSHOT") - case _ => None - }) - } - } -}
\ No newline at end of file diff --git a/project/plugins.sbt b/project/plugins.sbt index a3a7fb7..d8c77e4 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,11 +1 @@ -// Code style plugins -addSbtPlugin("com.geirsson" % "sbt-scalafmt" % "0.2.10") -addSbtPlugin("org.wartremover" % "sbt-wartremover" % "1.0.1") -addSbtPlugin("org.scalastyle" %% "scalastyle-sbt-plugin" % "0.8.0") - -// Launch and deploy/release plugins -addSbtPlugin("com.typesafe.sbt" % "sbt-git" % "0.8.5") -addSbtPlugin("com.github.gseitz" % "sbt-release" % "1.0.3") - -// This plugin represents functionality that is to be added to sbt in the future -addSbtPlugin("org.scala-sbt" % "sbt-core-next" % "0.1.1")
\ No newline at end of file +addSbtPlugin("com.drivergrp" % "sbt-settings" % "0.1.0") |