|
| 1 | +import Dependencies.* |
| 2 | +import sbt.* |
| 3 | + |
| 4 | +ThisBuild / organization := "com.evolution.jgrpc.tools" |
| 5 | +ThisBuild / startYear := Some(2025) |
| 6 | +ThisBuild / homepage := Some(url("https://github.com/evolution-gaming/grpc-java-tools")) |
| 7 | +ThisBuild / licenses := Seq(("MIT", url("https://opensource.org/licenses/MIT"))) |
| 8 | +ThisBuild / organizationName := "Evolution" |
| 9 | +ThisBuild / organizationHomepage := Some(url("https://evolution.com")) |
| 10 | + |
| 11 | +// Maven Central requires <developers> in published pom.xml files |
| 12 | +ThisBuild / developers := List( |
| 13 | + Developer( |
| 14 | + id = "migesok", |
| 15 | + name = "Mikhail Sokolov", |
| 16 | + email = "mikhail.g.sokolov@gmail.com", |
| 17 | + url = url("https://github.com/migesok"), |
| 18 | + ), |
| 19 | +) |
| 20 | + |
| 21 | +ThisBuild / scmInfo := Some(ScmInfo( |
| 22 | + browseUrl = url("https://github.com/evolution-gaming/grpc-java-tools"), |
| 23 | + connection = "git@github.com:evolution-gaming/grpc-java-tools.git", |
| 24 | +)) |
| 25 | + |
| 26 | +// not sure if bincompat check works for Java code, put it here just in case |
| 27 | +ThisBuild / versionPolicyIntention := Compatibility.BinaryCompatible |
| 28 | + |
| 29 | +// this is a Java project, setting a fixed Scala version just in case |
| 30 | +ThisBuild / scalaVersion := "2.13.16" |
| 31 | + |
| 32 | +// setting pure-Java module build settings |
| 33 | +ThisBuild / crossPaths := false // drop off Scala suffix from artifact names. |
| 34 | +ThisBuild / autoScalaLibrary := false // exclude scala-library from dependencies |
| 35 | +ThisBuild / javacOptions := Seq("-source", "17", "-target", "17", "-Werror", "-Xlint:all") |
| 36 | +ThisBuild / doc / javacOptions := Seq("-source", "17", "-Xdoclint:all", "-Werror") |
| 37 | + |
| 38 | +// common test dependencies: |
| 39 | +ThisBuild / libraryDependencies ++= Seq( |
| 40 | + // to be able to run JUnit 5+ tests: |
| 41 | + "com.github.sbt.junit" % "jupiter-interface" % JupiterKeys.jupiterVersion.value, |
| 42 | + Slf4j.simple, |
| 43 | +).map(_ % Test) |
| 44 | + |
| 45 | +// common compile dependencies: |
| 46 | +ThisBuild / libraryDependencies ++= Seq( |
| 47 | + jspecify, // JSpecify null-check annotations |
| 48 | +) |
| 49 | + |
| 50 | +lazy val root = project.in(file(".")) |
| 51 | + .settings( |
| 52 | + name := "grpc-java-tools-root", |
| 53 | + description := "Evolution grpc-java tools - root", |
| 54 | + publish / skip := true, |
| 55 | + ) |
| 56 | + .aggregate( |
| 57 | + k8sDnsNameResolver, |
| 58 | + ) |
| 59 | + |
| 60 | +lazy val k8sDnsNameResolver = project.in(file("k8s-dns-name-resolver")) |
| 61 | + .settings( |
| 62 | + name := "k8s-dns-name-resolver", |
| 63 | + description := "Evolution grpc-java tools - DNS-based name resolver for Kubernetes services", |
| 64 | + libraryDependencies ++= Seq( |
| 65 | + Grpc.api, |
| 66 | + Slf4j.api, |
| 67 | + dnsJava, |
| 68 | + ), |
| 69 | + ) |
| 70 | + |
| 71 | +addCommandAlias("fmt", "all scalafmtAll scalafmtSbt javafmtAll") |
| 72 | +addCommandAlias( |
| 73 | + "build", |
| 74 | + "all scalafmtCheckAll scalafmtSbtCheck javafmtCheckAll versionPolicyCheck Compile/doc test", |
| 75 | +) |
0 commit comments