当前位置: 首页>>代码示例>>Scala>>正文


Scala envOrElse类代码示例

本文整理汇总了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()
} 
开发者ID:Harl0,项目名称:OrderMicroservice,代码行数:55,代码来源:MicroServiceBuild.scala

示例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
  }
} 
开发者ID:CatalystCode,项目名称:project-fortis-spark,代码行数:17,代码来源:IntegrationTestSpec.scala

示例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()

} 
开发者ID:hmrc,项目名称:lisa-frontend,代码行数:43,代码来源:FrontendBuild.scala

示例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()
} 
开发者ID:hmrc,项目名称:file-transfer-stub,代码行数:54,代码来源:StubServiceBuild.scala

示例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()
} 
开发者ID:hmrc,项目名称:example-play-25-frontend,代码行数:59,代码来源:FrontendBuild.scala

示例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()
} 
开发者ID:hmrc,项目名称:sa-stub,代码行数:52,代码来源:StubServiceBuild.scala


注:本文中的scala.util.Properties.envOrElse类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。