config/build.sbt

96 lines
3.7 KiB
Plaintext
Raw Normal View History

// to release, bump major/minor/micro as appropriate,
// update NEWS, update version in README.md, tag, then
// publishSigned.
// Release tags should follow: http://semver.org/
2018-07-01 22:54:37 +08:00
import scalariform.formatter.preferences._
2011-11-08 04:31:23 +08:00
2016-04-03 03:45:37 +08:00
enablePlugins(GitVersioning)
git.baseVersion := "1.3.0"
2011-11-13 06:45:12 +08:00
organization in GlobalScope := "com.typesafe"
2011-11-13 06:45:12 +08:00
scalacOptions in GlobalScope in Compile := Seq("-unchecked", "-deprecation", "-feature")
scalacOptions in GlobalScope in Test := Seq("-unchecked", "-deprecation", "-feature")
2015-01-27 08:28:04 +08:00
scalaVersion in ThisBuild := "2.10.4"
2017-08-03 17:43:54 +08:00
val sonatype = new PublishToSonatype {
def projectUrl = "https://github.com/lightbend/config"
2017-08-03 17:43:54 +08:00
def developerId = "havocp"
def developerName = "Havoc Pennington"
def developerUrl = "http://ometer.com/"
def scmUrl = "git://github.com/lightbend/config.git"
2017-08-03 17:43:54 +08:00
}
lazy val commonSettings: Seq[Setting[_]] = Def.settings(
2018-07-01 22:54:37 +08:00
unpublished,
scalariformPreferences := scalariformPreferences.value
.setPreference(IndentSpaces, 4)
.setPreference(FirstArgumentOnNewline, Preserve)
2017-08-03 17:43:54 +08:00
)
lazy val root = (project in file("."))
.settings(
commonSettings,
aggregate in doc := false,
doc := (doc in (configLib, Compile)).value,
aggregate in packageDoc := false,
packageDoc := (packageDoc in (configLib, Compile)).value,
aggregate in checkstyle := false,
checkstyle := (checkstyle in (configLib, Compile)).value
)
.aggregate(
testLib, configLib,
simpleLibScala, simpleAppScala, complexAppScala,
simpleLibJava, simpleAppJava, complexAppJava
)
lazy val configLib = Project("config", file("config"))
.settings(
sonatype.settings,
osgiSettings,
OsgiKeys.exportPackage := Seq("com.typesafe.config", "com.typesafe.config.impl"),
publish := sys.error("use publishSigned instead of plain publish"),
publishLocal := sys.error("use publishLocalSigned instead of plain publishLocal"),
packageOptions in (Compile, packageBin) +=
2018-07-01 22:54:37 +08:00
Package.ManifestAttributes("Automatic-Module-Name" -> "typesafe.config" ),
scalariformPreferences := scalariformPreferences.value
.setPreference(IndentSpaces, 4)
.setPreference(FirstArgumentOnNewline, Preserve)
2017-08-03 17:43:54 +08:00
)
.enablePlugins(SbtOsgi)
.dependsOn(testLib % "test->test")
def proj(id: String, base: File) = Project(id, base) settings commonSettings
lazy val testLib = proj("config-test-lib", file("test-lib"))
lazy val simpleLibScala = proj("config-simple-lib-scala", file("examples/scala/simple-lib")) dependsOn configLib
lazy val simpleAppScala = proj("config-simple-app-scala", file("examples/scala/simple-app")) dependsOn simpleLibScala
lazy val complexAppScala = proj("config-complex-app-scala", file("examples/scala/complex-app")) dependsOn simpleLibScala
lazy val simpleLibJava = proj("config-simple-lib-java", file("examples/java/simple-lib")) dependsOn configLib
lazy val simpleAppJava = proj("config-simple-app-java", file("examples/java/simple-app")) dependsOn simpleLibJava
lazy val complexAppJava = proj("config-complex-app-java", file("examples/java/complex-app")) dependsOn simpleLibJava
2016-04-03 03:55:06 +08:00
useGpg := true
2016-04-03 03:55:06 +08:00
aggregate in PgpKeys.publishSigned := false
PgpKeys.publishSigned := (PgpKeys.publishSigned in configLib).value
2016-04-03 03:55:06 +08:00
aggregate in PgpKeys.publishLocalSigned := false
PgpKeys.publishLocalSigned := (PgpKeys.publishLocalSigned in configLib).value
2017-08-03 17:43:54 +08:00
val unpublished = Seq(
// no artifacts in this project
publishArtifact := false,
// make-pom has a more specific publishArtifact setting already
// so needs specific override
publishArtifact in makePom := false,
// no docs to publish
publishArtifact in packageDoc := false,
// can't seem to get rid of ivy files except by no-op'ing the entire publish task
publish := {},
publishLocal := {}
)