Skip to content

Commit

Permalink
build: fix publish settings
Browse files Browse the repository at this point in the history
  • Loading branch information
hseeberger committed Feb 7, 2022
1 parent 4dd923b commit 5bb3166
Showing 1 changed file with 58 additions and 46 deletions.
104 changes: 58 additions & 46 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,3 +1,42 @@
// *****************************************************************************
// Build settings
// *****************************************************************************

inThisBuild(
Seq(
organization := "de.heikoseeberger",
organizationName := "Heiko Seeberger",
startYear := Some(2015),
licenses += ("Apache-2.0", url("http://www.apache.org/licenses/LICENSE-2.0")),
homepage := Some(url("https://github.com/sbt/sbt-header")),
scmInfo := Some(
ScmInfo(
url("https://github.com/sbt/sbt-header"),
"[email protected]:sbt/sbt-header.git"
)
),
developers := List(
Developer(
"hseeberger",
"Heiko Seeberger",
"[email protected]",
url("https://github.com/hseeberger")
)
),
// scalaVersion defined by sbt
scalacOptions ++= Seq(
"-unchecked",
"-deprecation",
"-language:_",
"-encoding",
"UTF-8",
"-Ywarn-unused:imports",
),
scalafmtOnCompile := true,
dynverSeparator := "_", // the default `+` is not compatible with docker tags
)
)

// *****************************************************************************
// Projects
// *****************************************************************************
Expand All @@ -6,13 +45,30 @@ lazy val `sbt-header` =
project
.in(file("."))
.enablePlugins(AutomateHeaderPlugin, SbtPlugin)
.settings(settings)
.settings(commonSettings)
.settings(
libraryDependencies ++= Seq(
library.scalaTest % Test,
)
),
scriptedLaunchOpts ++= Seq(
"-Xmx1024M",
s"-Dplugin.version=${version.value}",
),
)

// *****************************************************************************
// Project settings
// *****************************************************************************

lazy val commonSettings =
Seq(
// Also (automatically) format build definition together with sources
Compile / scalafmt := {
val _ = (Compile / scalafmtSbt).value
(Compile / scalafmt).value
},
)

// *****************************************************************************
// Library dependencies
// *****************************************************************************
Expand All @@ -24,47 +80,3 @@ lazy val library =
}
val scalaTest = "org.scalatest" %% "scalatest" % Version.scalaTest
}

// *****************************************************************************
// Settings
// ***************************************************************************** |

lazy val settings =
commonSettings ++
scalafmtSettings ++
sbtScriptedSettings

lazy val commonSettings =
Seq(
// scalaVersion from .travis.yml via sbt-travisci
// scalaVersion := "2.12.3",
organization := "de.heikoseeberger",
organizationName := "Heiko Seeberger",
startYear := Some(2015),
licenses += ("Apache-2.0", url("http://www.apache.org/licenses/LICENSE-2.0")),
scalacOptions ++= Seq(
"-unchecked",
"-deprecation",
"-language:_",
"-target:jvm-1.8",
"-encoding",
"UTF-8",
"-Ywarn-unused:imports",
),
Compile / unmanagedSourceDirectories := Seq((Compile / scalaSource).value),
Test / unmanagedSourceDirectories := Seq((Test / scalaSource).value),
)

lazy val scalafmtSettings =
Seq(
scalafmtOnCompile := true,
)

lazy val sbtScriptedSettings =
Seq(
scriptedLaunchOpts ++= Seq(
"-Xmx1024M",
s"-Dplugin.version=${version.value}",
),
scriptedBufferLog := false,
)

0 comments on commit 5bb3166

Please sign in to comment.