build.sbt 3.87 KB
Newer Older
snehal jagtap's avatar
snehal jagtap committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
import org.opengroup.osdu.production.dependencies.CommanCompilerFlags._
import org.opengroup.osdu.production.dependencies.CommonLibs._
import sbt.Keys._
import sbt._

lazy val scalaVer = "2.12.4" 
lazy val osduOrg = "org.opengroup.osdu.production"
lazy val ItTest = config("it") extend Test

fork in IntegrationTest := false
parallelExecution in IntegrationTest := false

coverageExcludedPackages := "org.opengroup.osdu.production.domain.generated;org.opengroup.osdu.production.backup;org.opengroup.osdu.production.restore.*"
coverageMinimum := 90
coverageFailOnMinimum := true

lazy val core =
  Project("osdu-cloud-data-ingestion", file("."))
    .configs(IntegrationTest)
    .configs(ItTest)
    .settings(Defaults.itSettings: _*)
    .settings(
      organization := osduOrg,
      scalaVersion := scalaVer,
      scalacOptions ++= org.opengroup.osdu.production.dependencies.CommanCompilerFlags.scalaOptions,
      javacOptions ++= javac18,
      fork in Test := true,
      resolvers ++= Seq(GCSResolver.forBucket("pdi-ivy-snapshots-repo"), GCSResolver.forBucket("pdi-ivy-release-repo")),
      dependencyOverrides += "commons-codec" % "commons-codec" % "1.13",
      libraryDependencies ++= Seq( "org.quartz-scheduler" % "quartz" % "2.3.2" ),
      libraryDependencies ++= Seq(
        typeSafeconfig,
        scalactic,
        scalaLogging,
        logBack,
        scalaTest,
        akkaActor,
        akkaTestKit,
        akkaSlf4j,
        akkaStream,
        scoverage,
        mockito,
        scalaMock,
        scalaCheck,
        json4sNative,
        bigtableGrpcClient,
        cloudPubsub,
        protobuf,
        googleCloudStorage,
        "org.opengroup.osdu.production" %% "osdu-redis-common" % "0.2.13" exclude("io.spray", "spray-json_2.12") exclude("commons-io", "commons-io"),
        "org.opengroup.osdu.production" %% "osdu-akka-stream-commons" % "0.2.26",
        "org.opengroup.osdu.production" %% "osdu-scala-commons"       % "0.3.36",
        "org.opengroup.osdu.production" %% "osdu-security-commons"    % "0.1.40" exclude("com.fasterxml.jackson.core","jackson-databind"),
        "com.fasterxml.jackson.core" % "jackson-databind" % "2.11.2",
        akkaQuartzScheduler,
        "commons-io" % "commons-io" % "2.7"
      ).map(_.exclude("org.slf4j", "slf4j-log4j12"))
        .map(_.exclude("com.google.guava","guava-20.0"))
		    .map(_.exclude("com.google.guava","guava-19.0"))
		    .map(_.exclude("commons-codec" , "commons-codec"))
        .map(_.exclude("com.google.oauth-client", "google-oauth-client"))
        .map(_.exclude("com.mchange", "c3p0"))
        .map(_.exclude("org.quartz-scheduler", "quartz"))
        .map(_.exclude("org.apache.httpcomponents", "httpclient")),
      libraryDependencies ++= Seq ("org.apache.httpcomponents" % "httpclient" % "4.5.13")
    ).enablePlugins(JavaAppPackaging)
    .enablePlugins(UniversalPlugin)

name := "osdu-cloud-data-ingestion"
version := "1.0.0-SNAPSHOT"
name in Universal := name.value
packageName in Universal := packageName.value
mainClass in Compile := Some("org.opengroup.osdu.production.App")

mappings in Universal += ((resourceDirectory in Compile).value / "logback.xml") -> "logback.xml"
mappings in Universal += ((resourceDirectory in Compile).value / "logback-restore.xml") -> "logback-restore.xml"
mappings in Universal += ((resourceDirectory in Compile).value / "restore.conf") -> "restore.conf"


publishArtifact in(Compile, packageDoc) := false
publishArtifact in(Universal, packageDoc) := false
publishArtifact in(Universal, packageSrc) := false

lazy val ClasspathPattern = "declare -r app_classpath=\"(.*)\"\n".r

bashScriptDefines := bashScriptDefines.value.map {
  case ClasspathPattern(classpath) => "declare -r app_classpath=\".:" + classpath + "\"\n"
  case _@entry => entry
}
artifactName := { (sv: ScalaVersion, module: ModuleID, artifact: Artifact) =>
  artifact.name + "-" + module.revision + "-" + artifact.`type` + "." + artifact.extension
}