-
Notifications
You must be signed in to change notification settings - Fork 130
/
Copy pathbuild.sbt
108 lines (95 loc) · 3.7 KB
/
build.sbt
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
organization := "com.amazonaws"
organizationName := "Amazon Web Services"
organizationHomepage := Some(url("https://aws.amazon.com"))
name := "sagemaker-spark"
description := "SageMaker Spark provides a Spark interface to Amazon SageMaker, allowing " +
"customers to train using the Spark Estimator API, host their model on Amazon SageMaker, and " +
"make predictions with their model using the Spark Transformer API."
homepage := Some(url("https://github.com/aws/sagemaker-spark"))
scmInfo := Some(
ScmInfo(
url("https://github.com/aws/sagemaker-spark"),
"https://github.com/aws/sagemaker-spark.git"
)
)
licenses := Seq("Apache License, Version 2.0" -> url("https://aws.amazon.com/apache2.0"))
scalaVersion := "2.12.16"
// to change the version of spark add -DSPARK_VERSION=2.x.x when running sbt
// for example: "sbt -DSPARK_VERSION=2.1.1 clean compile test doc package"
val sparkVersion = System.getProperty("SPARK_VERSION", "3.3.0")
lazy val SageMakerSpark = (project in file("."))
version := {
val base = baseDirectory.in(SageMakerSpark).value
val packageVersion = IO.read(base / ".." / "VERSION").trim
s"spark_$sparkVersion-$packageVersion"
}
libraryDependencies ++= Seq(
"org.apache.hadoop" % "hadoop-aws" % "3.3.1",
"com.amazonaws" % "aws-java-sdk-s3" % "1.12.262",
"com.amazonaws" % "aws-java-sdk-sts" % "1.12.262",
"com.amazonaws" % "aws-java-sdk-sagemaker" % "1.12.262",
"com.amazonaws" % "aws-java-sdk-sagemakerruntime" % "1.12.262",
"org.apache.spark" %% "spark-core" % sparkVersion % "provided",
"org.apache.spark" %% "spark-mllib" % sparkVersion % "provided",
"org.apache.spark" %% "spark-sql" % sparkVersion % "provided",
"org.scalatest" %% "scalatest" % "3.0.9" % "test",
"org.mockito" % "mockito-all" % "2.0.2-beta" % "test"
)
// add a task to print the classpath. Also use the packaged JAR instead
// of the .class files.
exportJars := true
lazy val printClasspath = taskKey[Unit]("Dump classpath")
printClasspath := (fullClasspath in Runtime value) foreach { e => println(e.data) }
// set coverage threshold
coverageFailOnMinimum := true
coverageMinimumStmtTotal := 90
coverageMinimumBranchTotal := 90
coverageMinimumStmtPerPackage := 83
coverageMinimumBranchPerPackage := 75
// make scalastyle gate the build
(compile in Compile) := {
scalastyle.in(Compile).toTask("").value
(compile in Compile).value
}
(test in Test) := {
scalastyle.in(Test).toTask("").value
(test in Test).value
}
parallelExecution in Test := false
// https://github.com/sbt/sbt/issues/3570
updateOptions := updateOptions.value.withGigahorse(false)
// publishing configuration
publishMavenStyle := true
pomIncludeRepository := { _ => false }
publishArtifact in Test := false
val nexusUriHost = "aws.oss.sonatype.org"
val nexusUriHostWithScheme = "https://" + nexusUriHost + "/"
val snapshotUrl = nexusUriHostWithScheme + "content/repositories/snapshots"
val localReleaseUrl = nexusUriHostWithScheme + "service/local"
val releaseUrl = localReleaseUrl + "/staging/deploy/maven2"
publishTo := {
if (isSnapshot.value)
Some("snapshots" at snapshotUrl)
else
Some("releases" at releaseUrl)
}
Sonatype.SonatypeKeys.sonatypeRepository := localReleaseUrl
Sonatype.SonatypeKeys.sonatypeCredentialHost := nexusUriHost
credentials += Credentials(
"Sonatype Nexus Repository Manager",
nexusUriHost,
sys.env.getOrElse("SONATYPE_USERNAME", "NOT_A_PUBLISH_BUILD"),
sys.env.getOrElse("SONATYPE_PASSWORD", "NOT_A_PUBLISH_BUILD")
)
pomExtra := (
<developers>
<developer>
<id>amazonwebservices</id>
<organization>Amazon Web Services</organization>
<organizationUrl>https://aws.amazon.com</organizationUrl>
<roles>
<role>developer</role>
</roles>
</developer>
</developers>
)