本文整理汇总了Scala中scala.util.Properties.envOrElse类的典型用法代码示例。如果您正苦于以下问题:Scala envOrElse类的具体用法?Scala envOrElse怎么用?Scala envOrElse使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了envOrElse类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Scala代码示例。
示例1: MicroServiceBuild
//设置package包名称以及导入依赖的类
import sbt._
object MicroServiceBuild extends Build with MicroService {
import scala.util.Properties.envOrElse
val appName = "OrderMicroservice"
val appVersion = envOrElse("OrderMicroservice", "999-SNAPSHOT")
override lazy val appDependencies: Seq[ModuleID] = AppDependencies()
}
private object AppDependencies {
import play.sbt.PlayImport._
private val microserviceBootstrapVersion = "5.8.0"
private val playHealthVersion = "2.0.0"
private val playConfigVersion = "3.0.0"
private val logbackJsonLoggerVersion = "3.1.0"
private val playReactiveMongoVersion = "5.1.0"
private val akkaXMLParserVersion = "0.13.0"
private val serviceContractCacheVersion = "0.10.0"
private val hmrcTestVersion = "2.2.0"
val compile = Seq(
ws,
cache,
"uk.gov.hmrc" %% "microservice-bootstrap" % microserviceBootstrapVersion,
"uk.gov.hmrc" %% "play-health" % playHealthVersion,
"uk.gov.hmrc" %% "play-config" % playConfigVersion,
"uk.gov.hmrc" %% "logback-json-logger" % logbackJsonLoggerVersion,
"uk.gov.hmrc" %% "play-reactivemongo" % playReactiveMongoVersion,
"uk.gov.hmrc" %% "akka-xml-parser" % akkaXMLParserVersion,
"uk.gov.hmrc" %% "service-contract-cache" % serviceContractCacheVersion,
"org.scalatestplus.play" % "scalatestplus-play_2.11" % "1.5.1"
)
trait TestDependencies {
lazy val test: Seq[ModuleID] = ???
}
object Test {
def apply() = new TestDependencies {
override lazy val test = Seq(
"uk.gov.hmrc" %% "hmrctest" % hmrcTestVersion % "it,test",
"org.mockito" % "mockito-core" % "1.9.0" % "test",
"uk.gov.hmrc" %% "reactivemongo-test" % "1.6.0" % "it"
)
}.test
}
def apply() = compile ++ Test()
}
示例2: IntegrationTestSpec
//设置package包名称以及导入依赖的类
package com.microsoft.partnercatalyst.fortis.spark
import org.scalatest.FlatSpec
import scala.util.Properties.{envOrElse, envOrNone}
class IntegrationTestSpec extends FlatSpec {
protected def checkIfShouldRunWithLocalModels(): Option[String] = {
val runIntegrationTests = envOrElse("FORTIS_INTEGRATION_TESTS", "false").toBoolean
val localModels = envOrNone("FORTIS_MODELS_DIRECTORY")
if (!runIntegrationTests && localModels.isEmpty) {
cancel("Integration tests disabled and no local models available")
}
localModels
}
}
示例3: FrontendBuild
//设置package包名称以及导入依赖的类
import sbt._
object FrontendBuild extends Build with MicroService {
import scala.util.Properties.envOrElse
val appName = "lisa-frontend"
val appVersion = envOrElse("LISA_FRONTEND_VERSION", "999-SNAPSHOT")
override lazy val appDependencies: Seq[ModuleID] = AppDependencies()
}
private object AppDependencies {
import play.sbt.PlayImport._
import play.core.PlayVersion
val compile = Seq(
ws,
"uk.gov.hmrc" %% "frontend-bootstrap" % "7.25.0",
"uk.gov.hmrc" %% "play-partials" % "5.3.0",
"uk.gov.hmrc" %% "play-auth" % "1.0.0",
"uk.gov.hmrc" %% "play-config" % "4.2.0",
"uk.gov.hmrc" %% "logback-json-logger" % "3.1.0",
"uk.gov.hmrc" %% "govuk-template" % "5.1.0",
"uk.gov.hmrc" %% "play-health" % "2.1.0",
"uk.gov.hmrc" %% "play-ui" % "7.2.1",
"uk.gov.hmrc" %% "http-caching-client" % "6.2.0"
)
def test(scope: String = "test") = Seq(
"uk.gov.hmrc" %% "hmrctest" % "2.3.0" % scope,
"org.scalatest" %% "scalatest" % "2.2.6" % scope,
"org.pegdown" % "pegdown" % "1.6.0" % scope,
"org.jsoup" % "jsoup" % "1.8.1" % scope,
"com.typesafe.play" %% "play-test" % PlayVersion.current % scope,
"org.mockito" % "mockito-core" % "1.9.0" % scope,
"org.scalatestplus.play" %% "scalatestplus-play" % "2.0.0" % scope
)
def apply() = compile ++ test()
}
示例4: StubServiceBuild
//设置package包名称以及导入依赖的类
import sbt._
object StubServiceBuild extends Build with MicroService {
import scala.util.Properties.envOrElse
val appName = "file-transfer-stub"
val appVersion = envOrElse("FILE_TRANSFER_STUB_VERSION", "999-SNAPSHOT")
override lazy val appDependencies: Seq[ModuleID] = AppDependencies()
}
private object AppDependencies {
import play.sbt.PlayImport._
import play.core.PlayVersion
private val microserviceBootstrapVersion = "5.8.0"
private val playHealthVersion = "2.0.0"
private val playConfigVersion = "3.0.0"
private val logbackJsonLoggerVersion = "3.1.0"
private val hmrcTestVersion = "2.1.0"
private val scalaTestVersion = "2.2.6"
private val pegdownVersion = "1.6.0"
private val playUrlBindersVersion = "1.1.0"
val compile = Seq(
ws,
"uk.gov.hmrc" %% "microservice-bootstrap" % microserviceBootstrapVersion,
"uk.gov.hmrc" %% "play-health" % playHealthVersion,
"uk.gov.hmrc" %% "play-config" % playConfigVersion,
"uk.gov.hmrc" %% "logback-json-logger" % logbackJsonLoggerVersion,
"uk.gov.hmrc" %% "play-url-binders" % playUrlBindersVersion
)
trait TestDependencies {
lazy val scope: String = "test"
lazy val test : Seq[ModuleID] = ???
}
object Test {
def apply() = new TestDependencies {
override lazy val test = Seq(
"uk.gov.hmrc" %% "hmrctest" % hmrcTestVersion % scope,
"org.scalatest" %% "scalatest" % scalaTestVersion % scope,
"org.pegdown" % "pegdown" % pegdownVersion % scope,
"com.typesafe.play" %% "play-test" % PlayVersion.current % scope
)
}.test
}
def apply() = compile ++ Test()
}
示例5: FrontendBuild
//设置package包名称以及导入依赖的类
import sbt._
import scala.util.Properties.envOrElse
object FrontendBuild extends Build with MicroService {
val appName = "example-play-25-frontend"
val appVersionKey = appName.toUpperCase.replace('-', '_') + "_VERSION"
val appVersion = envOrElse(appVersionKey, "999-SNAPSHOT")
override lazy val appDependencies: Seq[ModuleID] = AppDependencies()
}
private object AppDependencies {
import play.sbt.PlayImport._
import play.core.PlayVersion
private val jacksonVersion = "2.7.4"
val compile = Seq(
ws,
"uk.gov.hmrc" %% "frontend-bootstrap" % "7.10.0",
"uk.gov.hmrc" %% "play-partials" % "5.2.0",
"uk.gov.hmrc" %% "play-authorised-frontend" % "6.2.0",
"uk.gov.hmrc" %% "play-config" % "3.0.0",
"uk.gov.hmrc" %% "logback-json-logger" % "3.1.0",
"uk.gov.hmrc" %% "govuk-template" % "5.0.0",
"uk.gov.hmrc" %% "play-health" % "2.0.0",
"uk.gov.hmrc" %% "play-ui" % "5.0.0",
"com.fasterxml.jackson.core" % "jackson-core" % jacksonVersion,
"com.fasterxml.jackson.core" % "jackson-databind" % jacksonVersion,
"com.fasterxml.jackson.core" % "jackson-annotations" % jacksonVersion,
"com.fasterxml.jackson.dataformat" % "jackson-dataformat-xml" % jacksonVersion,
"com.fasterxml.jackson.dataformat" % "jackson-dataformat-properties" % jacksonVersion,
"com.fasterxml.jackson.module" %% "jackson-module-scala" % jacksonVersion
)
trait TestDependencies {
lazy val scope: String = "test"
lazy val test : Seq[ModuleID] = ???
}
object Test {
def apply() = new TestDependencies {
override lazy val test = Seq(
"uk.gov.hmrc" %% "hmrctest" % "2.1.0" % scope,
"org.scalatest" %% "scalatest" % "2.2.6" % scope,
"org.pegdown" % "pegdown" % "1.6.0" % scope,
"org.jsoup" % "jsoup" % "1.8.1" % scope,
"org.mockito" % "mockito-all" % "1.10.19" % scope,
"com.typesafe.play" %% "play-test" % PlayVersion.current % scope,
"org.scalatestplus.play" %% "scalatestplus-play" % "1.5.1" % scope
)
}.test
}
def apply() = compile ++ Test()
}
示例6: StubServiceBuild
//设置package包名称以及导入依赖的类
import sbt._
object StubServiceBuild extends Build with MicroService {
import scala.util.Properties.envOrElse
val appName = "sa-stub"
val appVersion = envOrElse("SA_STUB_VERSION", "999-SNAPSHOT")
override lazy val appDependencies: Seq[ModuleID] = AppDependencies()
}
private object AppDependencies {
import play.sbt.PlayImport._
import play.core.PlayVersion
private val microserviceBootstrapVersion = "5.13.0"
private val playHealthVersion = "2.1.0"
private val playConfigVersion = "4.2.0"
private val logbackJsonLoggerVersion = "3.1.0"
private val hmrcTestVersion = "2.3.0"
private val scalaTestVersion = "2.2.6"
private val pegdownVersion = "1.6.0"
val compile = Seq(
ws,
"uk.gov.hmrc" %% "microservice-bootstrap" % microserviceBootstrapVersion,
"uk.gov.hmrc" %% "play-health" % playHealthVersion,
"uk.gov.hmrc" %% "play-config" % playConfigVersion,
"uk.gov.hmrc" %% "logback-json-logger" % logbackJsonLoggerVersion
)
trait TestDependencies {
lazy val scope: String = "test"
lazy val test : Seq[ModuleID] = ???
}
object Test {
def apply() = new TestDependencies {
override lazy val test = Seq(
"uk.gov.hmrc" %% "hmrctest" % hmrcTestVersion % scope,
"org.scalatest" %% "scalatest" % scalaTestVersion % scope,
"org.pegdown" % "pegdown" % pegdownVersion % scope,
"com.typesafe.play" %% "play-test" % PlayVersion.current % scope
)
}.test
}
def apply() = compile ++ Test()
}