Merge pull request #229 from eed3si9n/wip/nohouse

in-source sbt-houserules
This commit is contained in:
eugene yokota 2019-10-19 19:28:13 -04:00 committed by GitHub
commit f5358db783
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 82 additions and 18 deletions

View File

@ -1,15 +1,15 @@
language: scala
scala:
- 2.12.8
- 2.13.0
- 2.12.10
- 2.13.1
env:
global: ADOPTOPENJDK=11
matrix:
include:
- scala: 2.12.8
- scala: 2.12.10
env:
- ADOPTOPENJDK=8
- secure: JzxepvrNQIem+7MS8pBfBkcWDgt/oNKOreI3GJMJDN9P7lxCmrW0UVhpSftscjRzz9gXGQleqZ8t/I0hqysY9nO/DlxDQil6FKpsqrEKALdIsez8TjtbOlV69enDl6SBCXpg1B/rTQ/dL9mpV3WMvNkmDOhcNmbNyfO9Uk8wAAEvGQNKyE02s0gjZf6IgfOHXInBB2o3+uQFiWCABFHDWInN4t0QZVEhF/3P3iDKEfauWGwugf/YKLrwUUzNyN+J1i1goYEWZvviP+KCNbPlEsVN60In8F0t+jYuBJb0ePNcl3waT/4xBKQRidB4XRbhOXrZIATdpHLnzKzk2TPf3GxijNEscKYGdq3v6nWd128rfHGYz528pRSZ8bNOdQJotB/bJTmIEOnk5P9zU0z4z2cawMF6EyBJka7kXnC9Vz6TpifvyXDpzfmRzAkBrD6PC+diGPbyy5+4zvhpZuv31MRjMckohyNb76pR9qq70yDlomn+nVNoZ1fpp7dCqwjIxm9h2UjCWzXWY4xSByI8/CaPibq6Ma7RWHQE+4NGG2CCLQrqN4NB+BFsH3R0l5Js9khvDuEUYJkgSmJMFluXranWRV+pp/YMxk1IT4rOEPOc/hIqlQTrxasp/QxeyAfRk9OPzoz9L2kR0RH4ch3KuaARUv03WFNarfQ/ISz3P/s=

View File

@ -2,16 +2,25 @@ import Dependencies._
import Util._
import com.typesafe.tools.mima.core._, ProblemFilters._
ThisBuild / git.baseVersion := "1.3.0"
ThisBuild / version := {
val old = (ThisBuild / version).value
nightlyVersion match {
case Some(v) => v
case _ =>
if (old contains "SNAPSHOT") git.baseVersion.value + "-SNAPSHOT"
else old
case _ => old
}
}
ThisBuild / organization := "org.scala-sbt"
ThisBuild / bintrayPackage := "util"
ThisBuild / homepage := Some(url("https://github.com/sbt/util"))
ThisBuild / description := "Util modules for sbt"
ThisBuild / scmInfo := Some(ScmInfo(url("https://github.com/sbt/util"), "git@github.com:sbt/util.git"))
ThisBuild / licenses := List(("Apache-2.0", url("https://www.apache.org/licenses/LICENSE-2.0")))
ThisBuild / scalafmtOnCompile := true
ThisBuild / developers := List(
Developer("harrah", "Mark Harrah", "@harrah", url("https://github.com/harrah")),
Developer("eed3si9n", "Eugene Yokota", "@eed3si9n", url("http://eed3si9n.com/")),
Developer("dwijnand", "Dale Wijnand", "@dwijnand", url("https://github.com/dwijnand")),
)
def internalPath = file("internal")
@ -54,16 +63,10 @@ lazy val utilRoot: Project = (project in file("."))
utilScripted
)
.settings(
inThisBuild(
Seq(
bintrayPackage := "util",
homepage := Some(url("https://github.com/sbt/util")),
description := "Util module for sbt",
scmInfo := Some(ScmInfo(url("https://github.com/sbt/util"), "git@github.com:sbt/util.git")),
)),
commonSettings,
name := "Util Root",
publish / skip := true,
mimaPreviousArtifacts := Set.empty,
customCommands
)

View File

@ -3,8 +3,8 @@ import Keys._
import sbt.contraband.ContrabandPlugin.autoImport._
object Dependencies {
val scala212 = "2.12.8"
val scala213 = "2.13.0"
val scala212 = "2.12.10"
val scala213 = "2.13.1"
def nightlyVersion: Option[String] = sys.props.get("sbt.build.version")

View File

@ -0,0 +1,58 @@
import sbt._
import Keys._
import bintray.BintrayPlugin
import bintray.BintrayPlugin.autoImport._
object HouseRulesPlugin extends AutoPlugin {
override def requires = plugins.JvmPlugin && BintrayPlugin
override def trigger = allRequirements
override def buildSettings: Seq[Def.Setting[_]] = baseBuildSettings
override def projectSettings: Seq[Def.Setting[_]] = baseSettings
lazy val baseBuildSettings: Seq[Def.Setting[_]] = Seq(
bintrayOrganization := Some("sbt"),
bintrayRepository := "maven-releases",
)
lazy val baseSettings: Seq[Def.Setting[_]] = Seq(
bintrayPackage := (ThisBuild / bintrayPackage).value,
bintrayRepository := (ThisBuild / bintrayRepository).value,
scalacOptions ++= Seq("-encoding", "utf8"),
scalacOptions ++= Seq("-deprecation", "-feature", "-unchecked", "-Xlint"),
scalacOptions += "-language:higherKinds",
scalacOptions += "-language:implicitConversions",
scalacOptions ++= "-Xfuture".ifScala213OrMinus.value.toList,
scalacOptions += "-Xlint",
scalacOptions ++= "-Xfatal-warnings"
.ifScala(v => {
sys.props.get("sbt.build.fatal") match {
case Some(_) => java.lang.Boolean.getBoolean("sbt.build.fatal")
case _ => v == 12
}
})
.value
.toList,
scalacOptions ++= "-Yinline-warnings".ifScala211OrMinus.value.toList,
scalacOptions ++= "-Yno-adapted-args".ifScala212OrMinus.value.toList,
scalacOptions += "-Ywarn-dead-code",
scalacOptions += "-Ywarn-numeric-widen",
scalacOptions += "-Ywarn-value-discard",
scalacOptions ++= "-Ywarn-unused-import".ifScala(v => 11 <= v && v <= 12).value.toList
) ++ Seq(Compile, Test).flatMap(
c => scalacOptions in (c, console) --= Seq("-Ywarn-unused-import", "-Xlint")
)
private def scalaPartV = Def setting (CrossVersion partialVersion scalaVersion.value)
private implicit final class AnyWithIfScala[A](val __x: A) {
def ifScala(p: Long => Boolean) =
Def setting (scalaPartV.value collect { case (2, y) if p(y) => __x })
def ifScalaLte(v: Long) = ifScala(_ <= v)
def ifScalaGte(v: Long) = ifScala(_ >= v)
def ifScala211OrMinus = ifScalaLte(11)
def ifScala211OrPlus = ifScalaGte(11)
def ifScala212OrMinus = ifScalaLte(12)
def ifScala213OrMinus = ifScalaLte(13)
}
}

View File

@ -1 +1 @@
sbt.version=1.3.0
sbt.version=1.3.3

View File

@ -1,4 +1,7 @@
addSbtPlugin("org.scala-sbt" % "sbt-houserules" % "0.3.9")
addSbtPlugin("com.dwijnand" % "sbt-dynver" % "4.0.0")
addSbtPlugin("org.foundweekends" % "sbt-bintray" % "0.5.5")
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "2.0.0")
addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "0.6.1")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.0.3")
addSbtPlugin("org.scala-sbt" % "sbt-contraband" % "0.4.4")
addSbtPlugin("com.lightbend" % "sbt-whitesource" % "0.1.16")