diff options
author | Jakob Odersky <jakob@odersky.com> | 2016-12-04 00:30:11 -0800 |
---|---|---|
committer | Jakob Odersky <jakob@odersky.com> | 2016-12-04 01:35:16 -0800 |
commit | 5d631ebba2829fa10b66149a8405534cd2143a0d (patch) | |
tree | 42bfed586958cddeb99840ad4e66755742d6e38b /build.sbt | |
parent | 8e42c6f340b2a35bfb5c08df116a1e88de052eb7 (diff) | |
download | akka-serial-5d631ebba2829fa10b66149a8405534cd2143a0d.tar.gz akka-serial-5d631ebba2829fa10b66149a8405534cd2143a0d.tar.bz2 akka-serial-5d631ebba2829fa10b66149a8405534cd2143a0d.zip |
Refactor project to use .sbt build definitions and add continuous deployment script
Diffstat (limited to 'build.sbt')
-rw-r--r-- | build.sbt | 69 |
1 files changed, 60 insertions, 9 deletions
@@ -1,17 +1,69 @@ -import flow.{FlowBuild, Release} +// Build settings +version in ThisBuild := ("git describe --always --dirty=-SNAPSHOT --match v[0-9].*" !!).tail.trim +crossScalaVersions in ThisBuild := List("2.11.8", "2.12.0") +scalaVersion in ThisBuild := crossScalaVersions.value.head +scalacOptions in ThisBuild ++= Seq( + "-deprecation", + "-unchecked", + "-feature", + "-target:jvm-1.8" +) +fork in ThisBuild := true + +// Publishing +organization in ThisBuild := "ch.jodersky" +licenses in ThisBuild := Seq(("BSD New", url("http://opensource.org/licenses/BSD-3-Clause"))) +homepage in ThisBuild := Some(url("https://jodersky.github.io/flow")) +publishMavenStyle in ThisBuild := true +publishTo in ThisBuild := { + val nexus = "https://oss.sonatype.org/" + Some("releases" at nexus + "service/local/staging/deploy/maven2") +} +pomExtra in ThisBuild := { + <scm> + <url>git@github.com:jodersky/flow.git</url> + <connection>scm:git:git@github.com:jodersky/flow.git</connection> + </scm> + <developers> + <developer> + <id>jodersky</id> + <name>Jakob Odersky</name> + </developer> + </developers> +} + +// Project structure +lazy val root = (project in file(".")) + .aggregate(core, native, stream) + +lazy val core = (project in file("flow-core")) + .settings(name := "flow-core") + .dependsOn(native % "test->runtime") + +lazy val native = (project in file("flow-native")) + .settings(name := "flow-native") + +lazy val stream = (project in file("flow-stream")) + .settings(name := "flow-stream") + .dependsOn(core, core % "test->test", native % "test->runtime") + +lazy val samplesTerminal = (project in file("flow-samples") / "terminal") + .dependsOn(core, native % Runtime) -FlowBuild.commonSettings +lazy val samplesTerminalStream = (project in file("flow-samples") / "terminal-stream") + .dependsOn(stream, native % Runtime) -Release.settings +lazy val samplesWatcher = (project in file("flow-samples") / "watcher") + .dependsOn(core, native % Runtime) -/* Settings related to publishing */ +// Root project settings publishArtifact := false publish := () publishLocal := () // make sbt-pgp happy publishTo := Some(Resolver.file("Unused transient repository", target.value / "unusedrepo")) -/* Generate documentation */ +// Generate documentation enablePlugins(PreprocessPlugin) sourceDirectory in Preprocess := (baseDirectory in ThisBuild).value / "Documentation" preprocessVars in Preprocess := Map( @@ -20,7 +72,7 @@ preprocessVars in Preprocess := Map( "native_minor" -> "0" ) -/* Add scaladoc to documentation */ +// Add scaladoc to documentation enablePlugins(SiteScaladocPlugin) unidocSettings scalacOptions in (ScalaUnidoc, doc) ++= Seq( @@ -29,12 +81,11 @@ scalacOptions in (ScalaUnidoc, doc) ++= Seq( "-implicits", // Add methods "inherited" through implicit conversions "-sourcepath", baseDirectory.value.getAbsolutePath ) ++ { - val latestTag: String = "git describe --abbrev=0".!! + val latestTag: String = "git describe --abbrev=0 --match v[0-9].*".!! Opts.doc.sourceUrl( - s"https://github.com/jodersky/flow/blob/$latestTag€{FILE_PATH}.scala" + s"https://github.com/jodersky/flow/blob/$latestTag€{FILE_PATH}.scala" ) } siteMappings ++= (mappings in (ScalaUnidoc, packageDoc)).value.map{ case (file, path) => (file, "api/" + path) } -fork := true |