2
0
mirror of https://github.com/VinylDNS/vinyldns synced 2025-08-22 10:10:12 +00:00
vinyldns/build.sbt

409 lines
14 KiB
Plaintext
Raw Normal View History

2018-07-27 10:18:29 -04:00
import CompilerOptions._
import Dependencies._
import Resolvers._
2018-07-27 10:18:29 -04:00
import microsites._
import org.scalafmt.sbt.ScalafmtPlugin._
import sbtrelease.ReleasePlugin.autoImport.ReleaseTransformations._
import scoverage.ScoverageKeys.{coverageFailOnMinimum, coverageMinimum}
2018-07-27 10:18:29 -04:00
import scala.util.Try
2018-07-27 10:18:29 -04:00
resolvers ++= additionalResolvers
lazy val IntegrationTest = config("it").extend(Test)
2018-07-27 10:18:29 -04:00
// settings that should be inherited by all projects
lazy val sharedSettings = Seq(
organization := "vinyldns",
scalaVersion := "2.12.11",
2018-07-27 10:18:29 -04:00
organizationName := "Comcast Cable Communications Management, LLC",
startYear := Some(2018),
licenses += ("Apache-2.0", new URL("https://www.apache.org/licenses/LICENSE-2.0.txt")),
scalacOptions ++= scalacOptionsByV(scalaVersion.value),
scalacOptions in (Compile, doc) += "-no-link-warnings",
2018-07-27 10:18:29 -04:00
// Use wart remover to eliminate code badness
wartremoverErrors := (
if (getPropertyFlagOrDefault("build.lintOnCompile", true))
Seq(
Wart.EitherProjectionPartial,
Wart.IsInstanceOf,
Wart.JavaConversions,
Wart.Return,
Wart.LeakingSealed,
Wart.ExplicitImplicitTypes
)
else Seq.empty
),
2018-07-27 10:18:29 -04:00
// scala format
scalafmtOnCompile := getPropertyFlagOrDefault("build.scalafmtOnCompile", false),
// coverage options
coverageMinimum := 85,
coverageFailOnMinimum := true,
coverageHighlighting := true
2018-07-27 10:18:29 -04:00
)
lazy val testSettings = Seq(
parallelExecution in Test := true,
2018-07-27 10:18:29 -04:00
parallelExecution in IntegrationTest := false,
fork in IntegrationTest := true,
testOptions in Test += Tests.Argument("-oDNCXEPQRMIK", "-l", "SkipCI"),
logBuffered in Test := false,
// Hide stack traces in tests
traceLevel in Test := -1,
traceLevel in IntegrationTest := -1
2018-07-27 10:18:29 -04:00
)
lazy val apiSettings = Seq(
name := "api",
2018-10-19 10:58:39 -04:00
libraryDependencies ++= apiDependencies ++ apiTestDependencies.map(_ % "test, it"),
2018-07-27 10:18:29 -04:00
mainClass := Some("vinyldns.api.Boot"),
javaOptions in reStart ++= Seq(
"-Dlogback.configurationFile=test/logback.xml",
s"""-Dvinyldns.base-version=${(version in ThisBuild).value}"""
),
coverageExcludedPackages := "Boot.*"
2018-07-27 10:18:29 -04:00
)
lazy val apiAssemblySettings = Seq(
assemblyOutputPath in assembly := file("assembly/vinyldns.jar"),
2018-07-27 10:18:29 -04:00
test in assembly := {},
mainClass in assembly := Some("vinyldns.api.Boot"),
mainClass in reStart := Some("vinyldns.api.Boot"),
assemblyMergeStrategy in assembly := {
case PathList("scala", "tools", "nsc", "doc", "html", "resource", "lib", "index.js") =>
MergeStrategy.discard
case PathList("scala", "tools", "nsc", "doc", "html", "resource", "lib", "template.js") =>
MergeStrategy.discard
2018-07-27 10:18:29 -04:00
case x =>
val oldStrategy = (assemblyMergeStrategy in assembly).value
oldStrategy(x)
}
)
lazy val noPublishSettings = Seq(
publish := {},
publishLocal := {},
publishArtifact := false
)
lazy val apiPublishSettings = Seq(
publishArtifact := false,
publishLocal := (publishLocal in Docker).value,
publish := (publish in Docker).value
)
lazy val portalPublishSettings = Seq(
publishArtifact := false,
publishLocal := (publishLocal in Docker).value,
publish := (publish in Docker).value,
// for sbt-native-packager (docker) to exclude local.conf
mappings in Universal ~= (_.filterNot {
case (file, _) => file.getName.equals("local.conf")
}),
// for local.conf to be excluded in jars
mappings in (Compile, packageBin) ~= (_.filterNot {
case (file, _) => file.getName.equals("local.conf")
})
)
2018-07-27 10:18:29 -04:00
lazy val pbSettings = Seq(
PB.targets in Compile := Seq(
PB.gens.java("2.6.1") -> (sourceManaged in Compile).value
),
PB.protocVersion := "-v261"
2018-07-27 10:18:29 -04:00
)
lazy val allApiSettings = Revolver.settings ++ Defaults.itSettings ++
apiSettings ++
sharedSettings ++
apiAssemblySettings ++
testSettings ++
apiPublishSettings
2018-07-27 10:18:29 -04:00
lazy val api = (project in file("modules/api"))
.enablePlugins(JavaAppPackaging, AutomateHeaderPlugin)
2018-07-27 10:18:29 -04:00
.configs(IntegrationTest)
.settings(allApiSettings)
.settings(headerSettings(IntegrationTest))
.settings(inConfig(IntegrationTest)(scalafmtConfigSettings))
.dependsOn(
core % "compile->compile;test->test",
mysql % "compile->compile;it->it",
sqs % "compile->compile;it->it",
r53 % "compile->compile;it->it"
)
2018-07-27 10:18:29 -04:00
lazy val root = (project in file("."))
.enablePlugins(AutomateHeaderPlugin)
2018-07-27 10:18:29 -04:00
.configs(IntegrationTest)
.settings(headerSettings(IntegrationTest))
.settings(sharedSettings)
.settings(
inConfig(IntegrationTest)(scalafmtConfigSettings)
2018-07-27 10:18:29 -04:00
)
.aggregate(core, api, portal, mysql, sqs, r53)
2018-07-27 10:18:29 -04:00
lazy val coreBuildSettings = Seq(
name := "core",
// do not use unused params as NoOpCrypto ignores its constructor, we should provide a way
// to write a crypto plugin so that we fall back to a noarg constructor
scalacOptions ++= scalacOptionsByV(scalaVersion.value).filterNot(_ == "-Ywarn-unused:params")
) ++ pbSettings
2018-07-27 10:18:29 -04:00
lazy val corePublishSettings = Seq(
publishMavenStyle := true,
publishArtifact in Test := false,
pomIncludeRepository := { _ =>
false
},
2018-07-27 10:18:29 -04:00
autoAPIMappings := true,
publish in Docker := {},
mainClass := None,
homepage := Some(url("https://vinyldns.io")),
scmInfo := Some(
ScmInfo(
url("https://github.com/vinyldns/vinyldns"),
"scm:git@github.com:vinyldns/vinyldns.git"
)
),
sonatypeProfileName := "io.vinyldns"
2018-07-27 10:18:29 -04:00
)
lazy val core = (project in file("modules/core"))
.enablePlugins(AutomateHeaderPlugin)
2018-07-27 10:18:29 -04:00
.settings(sharedSettings)
.settings(coreBuildSettings)
.settings(corePublishSettings)
.settings(testSettings)
.settings(libraryDependencies ++= coreDependencies ++ commonTestDependencies.map(_ % "test"))
2018-07-27 10:18:29 -04:00
.settings(
organization := "io.vinyldns"
2018-07-27 10:18:29 -04:00
)
lazy val mysql = (project in file("modules/mysql"))
.enablePlugins(AutomateHeaderPlugin)
.configs(IntegrationTest)
.settings(sharedSettings)
.settings(headerSettings(IntegrationTest))
.settings(inConfig(IntegrationTest)(scalafmtConfigSettings))
.settings(corePublishSettings)
.settings(testSettings)
.settings(Defaults.itSettings)
.settings(libraryDependencies ++= mysqlDependencies ++ commonTestDependencies.map(_ % "test, it"))
.settings(
organization := "io.vinyldns"
)
.dependsOn(core % "compile->compile;test->test")
.settings(name := "mysql")
lazy val sqs = (project in file("modules/sqs"))
.enablePlugins(AutomateHeaderPlugin)
.configs(IntegrationTest)
.settings(sharedSettings)
.settings(headerSettings(IntegrationTest))
.settings(inConfig(IntegrationTest)(scalafmtConfigSettings))
.settings(corePublishSettings)
.settings(testSettings)
.settings(Defaults.itSettings)
.settings(libraryDependencies ++= sqsDependencies ++ commonTestDependencies.map(_ % "test, it"))
.settings(
organization := "io.vinyldns"
)
.dependsOn(core % "compile->compile;test->test")
.settings(name := "sqs")
Add backend provider (#980) Introduces the concept of a `Backend` into VinylDNS. This will allow support for any DNS backend in the future, including AwS Route53 for example. This is consistent with other "provider" things for dynamic loading of classes (Notifier, Repository, Queue, etc.) The initial implementation builds on what we have already, that is when creating a zone one can choose a `backendId` that is configured in the `application.conf`. If no `backendId` is specified, we attempt to map like we do today, so the exact same functionality. We expand that by allowing one to map a `backendId` to a different provider (like aws). After this PR: 1. If someone specifies a zone connection on a zone, it will work exactly like it does today, namely go through the `DnsBackend` to connect. 2. If someone specifies a `backendId` when setting up a zone, the naive mapping will take place to map that zone to the `Backend` implementation that is configured with that `backendId`. For example, if you have configured a backend id `aws` that connects to Route53, and you specify `aws` when connecting the zone, it will connect to it in Route 53 **Note: we still do not support zone create, but that is much closer to reality with this PR, much much** 3. If someone specifies NEITHER, the `defaultBackendId` will be used, which could be on any one of the backend providers configured. To start, there is a new `vinyldns.core.domain.backend` package that contains the main classes for the system. In there you will find the following: - `BackendProvider` - this is to be implemented by each provider. Adds a means of pre-loading zones, and providing connections to zones. - `Backend` - provides connectivity to a particular backend instance. For example, a particular DNS Authoritative server. This is where the real work happens of interacting with whatever backend. For example, `DnsConnection` implements this to send DDNS messages to the DNS system. Consider this the "main" thing to implement, where the rubber meets the road, the meat and potatoes - `BackendProviderLoader` - to be implemented by each provider, knows how to load it's single instance `BackendProvider`, as well as possibly pre-loading configured `Backends` or anything else it needs to do to get ready. It provides a dynamic hook via the `def load` method that is called by the `BackendLoader` to load a specific `Backend` - `BackendResolver` - the main, default, BackendResolver. It holds all `BackendProvider` instances loaded via the `BackendLoader` and provides right now a naive lookup mechanism to find `Backend`s. Really, this is more of a `Router` or `Resolver`, as in the future it could use more advanced techniques to finding connections than right now - `BackendConfigs` - used by the `BackendRegistry` as the entrypoint into configuration for all backends - `BackendProviderConfig` - a single backend provider configuration, specifies a `className` that should be the `BackendProviderLoader` implementation to be loaded, and a `settings` that is passed into the `BackendProvider` to load itself. This is consistent with other providers. - `BackendResponse` - uniform responses across all providers to the rest of the VinylDNS System **Workflow** During initialization of the system: 1. The `BackendResolver` loads the `BackendConfigs` from the application configuration. This contains configuration for ALL backends 2. The `BackendResolver` utilizes the `BackendLoader` to dynamically load each backend individually. If any backend cannot be loaded, it will fail. 3. The `BackendLoader` creates a new instance of each `className` for each `BackendConfig`, this points to the `BackendProviderLoader` implementation which takes care of loading the specific `BackendProvider` provided the configuration 4. The `BackendProviderLoader` does any initialization necessary to ensure it is ready. In the case of `Route53`, it will pre-load and cache all hosted zones that are available for the AWS account that is configured. For Route53, a single `Route53Backend` is setup right now. For `DnsBackend`, a connection (server, port, tsig key) is setup for each DNS Authoritative system to integrate with. During runtime of the system: 1. When anything is needed, the `BackendResolver` is consulted that will determine how to lookup the `Backend` that is needed. This is done right now by naively scanning all `BackendProvider` instances it has to say "can anyone connect to this zone". More intelligent discovery rules can be added in the future 2. Once a `Backend` is obtained, any operation can be performed: 1. `ZoneConnectionValidator` uses `zoneExists` and `loadZone` to validate a zone is usable by VinylDNS 2. `RecordSetChangeHandler` uses `resolve` and `applyChange` to apply changes to the DNS backend 3. `ZoneSyncHandler` and `DnsZoneViewLoader` use `loadZone` in order to load records into VinylDNS **What else is here** - Provided an implementation of a backend provider for DNS via `Backend` - Updated all of VinylDNS to use `Backends` instead of hard coded to DNS - Provided an implementation of a backend provider for AWS Route 53 as an example to follow for other providers **Example configuration** ``` vinyldns { backend { default-backend-id = "r53" backend-providers = [ { class-name = "vinyldns.route53.backend.Route53BackendProviderLoader" settings = { backends = [ { id = "test" access-key = "vinyldnsTest" secret-key = "notNeededForSnsLocal" service-endpoint = "http://127.0.0.1:19009" signing-region = "us-east-1" } ] } } ] } } ```
2020-09-30 09:17:32 -04:00
lazy val r53 = (project in file("modules/r53"))
.enablePlugins(AutomateHeaderPlugin)
.configs(IntegrationTest)
.settings(sharedSettings)
.settings(headerSettings(IntegrationTest))
.settings(inConfig(IntegrationTest)(scalafmtConfigSettings))
.settings(corePublishSettings)
.settings(testSettings)
.settings(Defaults.itSettings)
.settings(libraryDependencies ++= r53Dependencies ++ commonTestDependencies.map(_ % "test, it"))
.settings(
organization := "io.vinyldns",
coverageMinimum := 65
)
.dependsOn(core % "compile->compile;test->test")
Add backend provider (#980) Introduces the concept of a `Backend` into VinylDNS. This will allow support for any DNS backend in the future, including AwS Route53 for example. This is consistent with other "provider" things for dynamic loading of classes (Notifier, Repository, Queue, etc.) The initial implementation builds on what we have already, that is when creating a zone one can choose a `backendId` that is configured in the `application.conf`. If no `backendId` is specified, we attempt to map like we do today, so the exact same functionality. We expand that by allowing one to map a `backendId` to a different provider (like aws). After this PR: 1. If someone specifies a zone connection on a zone, it will work exactly like it does today, namely go through the `DnsBackend` to connect. 2. If someone specifies a `backendId` when setting up a zone, the naive mapping will take place to map that zone to the `Backend` implementation that is configured with that `backendId`. For example, if you have configured a backend id `aws` that connects to Route53, and you specify `aws` when connecting the zone, it will connect to it in Route 53 **Note: we still do not support zone create, but that is much closer to reality with this PR, much much** 3. If someone specifies NEITHER, the `defaultBackendId` will be used, which could be on any one of the backend providers configured. To start, there is a new `vinyldns.core.domain.backend` package that contains the main classes for the system. In there you will find the following: - `BackendProvider` - this is to be implemented by each provider. Adds a means of pre-loading zones, and providing connections to zones. - `Backend` - provides connectivity to a particular backend instance. For example, a particular DNS Authoritative server. This is where the real work happens of interacting with whatever backend. For example, `DnsConnection` implements this to send DDNS messages to the DNS system. Consider this the "main" thing to implement, where the rubber meets the road, the meat and potatoes - `BackendProviderLoader` - to be implemented by each provider, knows how to load it's single instance `BackendProvider`, as well as possibly pre-loading configured `Backends` or anything else it needs to do to get ready. It provides a dynamic hook via the `def load` method that is called by the `BackendLoader` to load a specific `Backend` - `BackendResolver` - the main, default, BackendResolver. It holds all `BackendProvider` instances loaded via the `BackendLoader` and provides right now a naive lookup mechanism to find `Backend`s. Really, this is more of a `Router` or `Resolver`, as in the future it could use more advanced techniques to finding connections than right now - `BackendConfigs` - used by the `BackendRegistry` as the entrypoint into configuration for all backends - `BackendProviderConfig` - a single backend provider configuration, specifies a `className` that should be the `BackendProviderLoader` implementation to be loaded, and a `settings` that is passed into the `BackendProvider` to load itself. This is consistent with other providers. - `BackendResponse` - uniform responses across all providers to the rest of the VinylDNS System **Workflow** During initialization of the system: 1. The `BackendResolver` loads the `BackendConfigs` from the application configuration. This contains configuration for ALL backends 2. The `BackendResolver` utilizes the `BackendLoader` to dynamically load each backend individually. If any backend cannot be loaded, it will fail. 3. The `BackendLoader` creates a new instance of each `className` for each `BackendConfig`, this points to the `BackendProviderLoader` implementation which takes care of loading the specific `BackendProvider` provided the configuration 4. The `BackendProviderLoader` does any initialization necessary to ensure it is ready. In the case of `Route53`, it will pre-load and cache all hosted zones that are available for the AWS account that is configured. For Route53, a single `Route53Backend` is setup right now. For `DnsBackend`, a connection (server, port, tsig key) is setup for each DNS Authoritative system to integrate with. During runtime of the system: 1. When anything is needed, the `BackendResolver` is consulted that will determine how to lookup the `Backend` that is needed. This is done right now by naively scanning all `BackendProvider` instances it has to say "can anyone connect to this zone". More intelligent discovery rules can be added in the future 2. Once a `Backend` is obtained, any operation can be performed: 1. `ZoneConnectionValidator` uses `zoneExists` and `loadZone` to validate a zone is usable by VinylDNS 2. `RecordSetChangeHandler` uses `resolve` and `applyChange` to apply changes to the DNS backend 3. `ZoneSyncHandler` and `DnsZoneViewLoader` use `loadZone` in order to load records into VinylDNS **What else is here** - Provided an implementation of a backend provider for DNS via `Backend` - Updated all of VinylDNS to use `Backends` instead of hard coded to DNS - Provided an implementation of a backend provider for AWS Route 53 as an example to follow for other providers **Example configuration** ``` vinyldns { backend { default-backend-id = "r53" backend-providers = [ { class-name = "vinyldns.route53.backend.Route53BackendProviderLoader" settings = { backends = [ { id = "test" access-key = "vinyldnsTest" secret-key = "notNeededForSnsLocal" service-endpoint = "http://127.0.0.1:19009" signing-region = "us-east-1" } ] } } ] } } ```
2020-09-30 09:17:32 -04:00
.settings(name := "r53")
2018-07-27 10:18:29 -04:00
val preparePortal = TaskKey[Unit]("preparePortal", "Runs NPM to prepare portal for start")
val checkJsHeaders =
TaskKey[Unit]("checkJsHeaders", "Runs script to check for APL 2.0 license headers")
val createJsHeaders =
TaskKey[Unit]("createJsHeaders", "Runs script to prepend APL 2.0 license headers to files")
2018-07-27 10:18:29 -04:00
lazy val portal = (project in file("modules/portal"))
.enablePlugins(PlayScala, AutomateHeaderPlugin)
2018-07-27 10:18:29 -04:00
.settings(sharedSettings)
.settings(testSettings)
.settings(portalPublishSettings)
2018-07-27 10:18:29 -04:00
.settings(
name := "portal",
libraryDependencies ++= portalDependencies,
routesGenerator := InjectedRoutesGenerator,
coverageExcludedPackages := "<empty>;views.html.*;router.*;controllers\\.javascript.*;.*Reverse.*",
2018-07-27 10:18:29 -04:00
javaOptions in Test += "-Dconfig.file=conf/application-test.conf",
// ads the version when working locally with sbt run
PlayKeys.devSettings += "vinyldns.base-version" -> (version in ThisBuild).value,
2018-07-27 10:18:29 -04:00
// adds an extra classpath to the portal loading so we can externalize jars, make sure to create the lib_extra
// directory and lay down any dependencies that are required when deploying
scriptClasspath in bashScriptDefines ~= (cp => cp :+ "lib_extra/*"),
mainClass in reStart := None,
// we need to filter out unused for the portal as the play framework needs a lot of unused things
scalacOptions ~= { opts =>
opts.filterNot(p => p.contains("unused"))
},
2018-07-27 10:18:29 -04:00
// runs our prepare portal process
preparePortal := {
import scala.sys.process._
"./modules/portal/prepare-portal.sh" !
},
checkJsHeaders := {
import scala.sys.process._
"./utils/add-license-headers.sh -d=modules/portal/public/lib -f=js -c" !
2018-07-27 10:18:29 -04:00
},
createJsHeaders := {
import scala.sys.process._
"./utils/add-license-headers.sh -d=modules/portal/public/lib -f=js" !
2018-07-27 10:18:29 -04:00
},
// change the name of the output to portal.zip
packageName in Universal := "portal"
)
.dependsOn(mysql)
2018-07-27 10:18:29 -04:00
lazy val docSettings = Seq(
git.remoteRepo := "https://github.com/vinyldns/vinyldns",
micrositeGithubOwner := "vinyldns",
2018-07-27 10:18:29 -04:00
micrositeGithubRepo := "vinyldns",
micrositeName := "VinylDNS",
micrositeDescription := "DNS Automation and Governance",
2018-07-27 10:18:29 -04:00
micrositeAuthor := "VinylDNS",
micrositeHomepage := "https://vinyldns.io",
micrositeDocumentationUrl := "/api",
micrositeDocumentationLabelDescription := "API Documentation",
micrositeHighlightLanguages ++= Seq("json", "yaml", "bnf", "plaintext"),
micrositeGitterChannel := false,
2018-07-27 10:18:29 -04:00
micrositeExtraMdFiles := Map(
file("CONTRIBUTING.md") -> ExtraMdFileConfig(
"contributing.md",
"page",
Map("title" -> "Contributing", "section" -> "contributing", "position" -> "4")
2018-07-27 10:18:29 -04:00
)
),
micrositePushSiteWith := GitHub4s,
micrositeGithubToken := sys.env.get("SBT_MICROSITES_PUBLISH_TOKEN"),
2018-07-27 10:18:29 -04:00
ghpagesNoJekyll := false,
fork in mdoc := true,
mdocIn := (sourceDirectory in Compile).value / "mdoc",
micrositeFavicons := Seq(
MicrositeFavicon("favicon16x16.png", "16x16"),
MicrositeFavicon("favicon32x32.png", "32x32")
),
micrositeEditButton := Some(
MicrositeEditButton(
"Improve this page",
"/edit/master/modules/docs/src/main/mdoc/{{ page.path }}"
)
),
micrositeFooterText := None,
micrositeHighlightTheme := "hybrid",
includeFilter in makeSite := "*.html" | "*.css" | "*.png" | "*.jpg" | "*.jpeg" | "*.gif" | "*.js" | "*.swf" | "*.md" | "*.webm" | "*.ico" | "CNAME" | "*.yml" | "*.svg" | "*.json" | "*.csv"
2018-07-27 10:18:29 -04:00
)
lazy val docs = (project in file("modules/docs"))
.enablePlugins(MicrositesPlugin, MdocPlugin)
2018-07-27 10:18:29 -04:00
.settings(docSettings)
// release stages
lazy val setSonatypeReleaseSettings = ReleaseStep(action = oldState => {
// sonatype publish target, and sonatype release steps, are different if version is SNAPSHOT
val extracted = Project.extract(oldState)
val v = extracted.get(Keys.version)
val snap = v.endsWith("SNAPSHOT")
if (!snap) {
val publishToSettings =
Some("releases".at("https://oss.sonatype.org/" + "service/local/staging/deploy/maven2"))
val newState =
extracted.appendWithSession(Seq(publishTo in core := publishToSettings), oldState)
// create sonatypeReleaseCommand with releaseSonatype step
val sonatypeCommand = Command.command("sonatypeReleaseCommand") {
"project core" ::
"publish" ::
"sonatypeRelease" ::
_
}
newState.copy(definedCommands = newState.definedCommands :+ sonatypeCommand)
} else {
val publishToSettings =
Some("snapshots".at("https://oss.sonatype.org/" + "content/repositories/snapshots"))
val newState =
extracted.appendWithSession(Seq(publishTo in core := publishToSettings), oldState)
// create sonatypeReleaseCommand without releaseSonatype step
val sonatypeCommand = Command.command("sonatypeReleaseCommand") {
"project core" ::
"publish" ::
_
}
newState.copy(definedCommands = newState.definedCommands :+ sonatypeCommand)
}
})
lazy val sonatypePublishStage = Seq[ReleaseStep](
releaseStepCommandAndRemaining(";sonatypeReleaseCommand")
)
lazy val initReleaseStage = Seq[ReleaseStep](
inquireVersions, // have a developer confirm versions
setReleaseVersion,
setSonatypeReleaseSettings
)
lazy val finalReleaseStage = Seq[ReleaseStep](
releaseStepCommand("project root"), // use version.sbt file from root
commitReleaseVersion,
setNextVersion,
commitNextVersion
)
def getPropertyFlagOrDefault(name: String, value: Boolean): Boolean =
sys.props.get(name).flatMap(propValue => Try(propValue.toBoolean).toOption).getOrElse(value)
releaseProcess :=
initReleaseStage ++
sonatypePublishStage ++
finalReleaseStage
// Let's do things in parallel!
addCommandAlias(
"validate",
"; root/clean; " +
"all core/headerCheck core/test:headerCheck " +
"api/headerCheck api/test:headerCheck api/it:headerCheck " +
"mysql/headerCheck mysql/test:headerCheck mysql/it:headerCheck " +
"r53/headerCheck r53/test:headerCheck r53/it:headerCheck " +
"sqs/headerCheck sqs/test:headerCheck sqs/it:headerCheck " +
"portal/headerCheck portal/test:headerCheck; " +
"portal/createJsHeaders;portal/checkJsHeaders;" +
"root/compile;root/test:compile;root/it:compile"
)
addCommandAlias(
"verify",
"; project root; coverage; " +
"all test it:test; " +
"project root; coverageReport; coverageAggregate"
)
2018-07-27 10:18:29 -04:00
// Build the artifacts for release
addCommandAlias("build-api", ";project api;clean;coverageOff;assembly")
addCommandAlias("build-portal", ";project portal;clean;coverageOff;preparePortal;dist")
2018-07-27 10:18:29 -04:00
addCommandAlias("build", ";build-api;build-portal")