Skip to content

Commit

Permalink
Use slash-syntax in sbt files
Browse files Browse the repository at this point in the history
  • Loading branch information
aeons committed Feb 16, 2019
1 parent 2beb52d commit 4713a80
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 42 deletions.
8 changes: 4 additions & 4 deletions build.sbt
Expand Up @@ -428,7 +428,7 @@ lazy val examplesBlaze = exampleProject("examples-blaze")
description := "Examples of http4s server and clients on blaze",
fork := true,
libraryDependencies ++= Seq(alpnBoot, dropwizardMetricsJson),
javaOptions in run ++= addAlpnPath((managedClasspath in Runtime).value)
run / javaOptions ++= addAlpnPath((Runtime / managedClasspath).value)
)
.dependsOn(blazeServer, blazeClient)

Expand Down Expand Up @@ -478,7 +478,7 @@ def http4sProject(name: String) =
.settings(commonSettings)
.settings(
moduleName := s"http4s-$name",
testOptions in Test += Tests.Argument(TestFrameworks.Specs2, "showtimes", "failtrace"),
Test / testOptions += Tests.Argument(TestFrameworks.Specs2, "showtimes", "failtrace"),
initCommands()
)

Expand All @@ -498,10 +498,10 @@ lazy val commonSettings = Seq(
case _ => "1.8"
}
}.value,
scalacOptions in Compile ++= Seq(
Compile / scalacOptions ++= Seq(
s"-target:jvm-${http4sJvmTarget.value}"
),
scalacOptions in (Compile, doc) += "-no-link-warnings",
Compile / doc / scalacOptions += "-no-link-warnings",
javacOptions ++= Seq(
"-source",
http4sJvmTarget.value,
Expand Down
6 changes: 3 additions & 3 deletions project/CentralRequirements.scala
Expand Up @@ -40,9 +40,9 @@ object CentralRequirementsPlugin extends AutoPlugin {
startYear := Some(2013),
publishMavenStyle := true,
pomIncludeRepository := { _ => false },
publishArtifact in (Compile, packageBin) := true,
publishArtifact in (Compile, packageSrc) := true,
publishArtifact in Test := false,
Compile / packageBin / publishArtifact := true,
Compile / packageSrc / publishArtifact := true,
Test / publishArtifact := false,
publishTo := {
val nexus = "https://oss.sonatype.org/"
if (isSnapshot.value)
Expand Down
32 changes: 16 additions & 16 deletions project/Http4sPlugin.scala
Expand Up @@ -42,18 +42,18 @@ object Http4sPlugin extends AutoPlugin {
// Publishing to gh-pages and sonatype only done from select branches and
// never from pull requests.
http4sPublish := {
sys.env.get("TRAVIS") == Some("true") &&
sys.env.get("TRAVIS_PULL_REQUEST") == Some("false") &&
sys.env.get("TRAVIS_REPO_SLUG") == Some("http4s/http4s") &&
sys.env.get("TRAVIS_JDK_VERSION") == Some("oraclejdk8") &&
sys.env.get("TRAVIS").contains("true") &&
sys.env.get("TRAVIS_PULL_REQUEST").contains("false") &&
sys.env.get("TRAVIS_REPO_SLUG").contains("http4s/http4s") &&
sys.env.get("TRAVIS_JDK_VERSION").contains("oraclejdk8") &&
(sys.env.get("TRAVIS_BRANCH") match {
case Some("master") => true
case Some(branch) if branch.startsWith("release-") => true
case _ => false
})
},
http4sMasterBranch := sys.env.get("TRAVIS_BRANCH") == Some("master"),
http4sApiVersion in ThisBuild := (version in ThisBuild).map {
http4sMasterBranch := sys.env.get("TRAVIS_BRANCH").contains("master"),
ThisBuild / http4sApiVersion := (ThisBuild / version).map {
case VersionNumber(Seq(major, minor, _*), _, _) => (major.toInt, minor.toInt)
}.value,
git.remoteRepo := "git@github.com:http4s/http4s.git"
Expand All @@ -68,7 +68,7 @@ object Http4sPlugin extends AutoPlugin {
scalacOptions -= "-Xcheckinit",

// https://github.com/tkawachi/sbt-doctest/issues/102
scalacOptions in (Test, compile) -= "-Ywarn-unused:params",
Test / compile / scalacOptions -= "-Ywarn-unused:params",

scalacOptions ++= {
CrossVersion.partialVersion(scalaVersion.value) match {
Expand All @@ -82,7 +82,7 @@ object Http4sPlugin extends AutoPlugin {
http4sMimaVersion := {
version.value match {
case VersionNumber(Seq(major, minor, patch), _, _) if patch.toInt > 0 =>
Some(s"${major}.${minor}.${patch.toInt - 1}")
Some(s"$major.$minor.${patch.toInt - 1}")
case _ =>
None
}
Expand All @@ -96,14 +96,14 @@ object Http4sPlugin extends AutoPlugin {
addCompilerPlugin("com.olegpy" %% "better-monadic-for" % "0.2.4"),

scalafmtVersion := "1.5.1",
scalafmt in Test := {
(scalafmt in Compile).value
(scalafmt in Test).value
Test / scalafmt := {
(Compile / scalafmt).value
(Test / scalafmt).value
()
},
test in (Test, scalafmt) := {
(test in (Compile, scalafmt)).value
(test in (Test, scalafmt)).value
Test / scalafmt / test := {
(Compile / scalafmt / test).value
(Test / scalafmt / test).value
()
},

Expand All @@ -128,7 +128,7 @@ object Http4sPlugin extends AutoPlugin {
|"argonaut-shapeless_6.2" = "1.2.0-M6"
|
|[releases]
|${releases}
|$releases
""".stripMargin

IO.write(dest, buildData)
Expand All @@ -150,7 +150,7 @@ object Http4sPlugin extends AutoPlugin {
.string
).getOrElse(versionFormatError(ver))
},
releaseTagName := s"v${if (releaseUseGlobalVersion.value) (version in ThisBuild).value else version.value}",
releaseTagName := s"v${if (releaseUseGlobalVersion.value) (ThisBuild / version).value else version.value}",
releasePublishArtifactsAction := Def.taskDyn {
if (isSnapshot.value) publish
else publishSigned
Expand Down
25 changes: 12 additions & 13 deletions project/PrivateProject.scala → project/PrivateProjectPlugin.scala
Expand Up @@ -14,23 +14,22 @@ object PrivateProjectPlugin extends AutoPlugin {

override lazy val projectSettings: Seq[Setting[_]] =
Seq(
skip in publish := true,
publish / skip := true,
publish := (()),
publishSigned := (()),
publishLocal := (()),
publishLocalSigned := (()),
publishArtifact := false,
publishTo := None,
publishArtifact in Test := false,
publishArtifact in Compile := false,
publishArtifact in (Test, packageBin) := false,
publishArtifact in (Test, packageDoc) := false,
publishArtifact in (Test, packageSrc) := false,
publishArtifact in (Compile, packageBin) := false,
publishArtifact in (Compile, packageDoc) := false,
publishArtifact in (Compile, packageSrc) := false,
publishArtifact := false
) ++ Seq(
Test / publishArtifact := false,
Test / packageBin / publishArtifact := false,
Test / packageDoc / publishArtifact := false,
Test / packageSrc / publishArtifact := false,
Compile / publishArtifact := false,
Compile / packageBin / publishArtifact := false,
Compile / packageDoc / publishArtifact := false,
Compile / packageSrc / publishArtifact := false,
mimaPreviousArtifacts := Set.empty,
publishLocalSigned := (()),
publishSigned := (()),
unusedCompileDependenciesTest := (()),
)
}
12 changes: 6 additions & 6 deletions scalafix/build.sbt
Expand Up @@ -50,16 +50,16 @@ lazy val tests = project
.settings(
skip in publish := true,
libraryDependencies += "ch.epfl.scala" % "scalafix-testkit" % V.scalafixVersion % Test cross CrossVersion.full,
compile.in(Compile) :=
compile.in(Compile).dependsOn(compile.in(input, Compile)).value,
Compile / compile :=
(Compile / compile).dependsOn(input / Compile / compile).value,
scalafixTestkitOutputSourceDirectories :=
sourceDirectories.in(output, Compile).value,
(output / Compile / sourceDirectories).value,
scalafixTestkitInputSourceDirectories :=
sourceDirectories.in(input, Compile).value,
(input / Compile / sourceDirectories).value,
scalafixTestkitInputClasspath :=
fullClasspath.in(input, Compile).value,
(input / Compile / fullClasspath).value,
)
.dependsOn(rules)
.enablePlugins(ScalafixTestkitPlugin)

addCommandAlias("ci", ";clean ;test")
addCommandAlias("ci", ";clean ;test")

0 comments on commit 4713a80

Please sign in to comment.