Skip to content

Commit f087290

Browse files
committed
Simplify build
1 parent bd856a9 commit f087290

File tree

2 files changed

+56
-37
lines changed

2 files changed

+56
-37
lines changed

build.sbt

Lines changed: 4 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -4,35 +4,13 @@ name := "sparklingml"
44

55
publishMavenStyle := true
66

7-
version := "0.1.0"
7+
version := "0.0.1"
88

99
sparkVersion := "2.1.1"
1010

11-
scalaVersion := {
12-
if (sparkVersion.value >= "2.0.0") {
13-
"2.11.8"
14-
} else {
15-
"2.10.6"
16-
}
17-
}
18-
19-
// See https://github.com/scala/scala/pull/3799
20-
coverageHighlighting := {
21-
if (sparkVersion.value >= "2.0.0") {
22-
true
23-
} else {
24-
false
25-
}
26-
}
11+
scalaVersion := "2.11.8"
2712

28-
29-
crossScalaVersions := {
30-
if (sparkVersion.value > "2.0.0") {
31-
Seq("2.11.11")
32-
} else {
33-
Seq("2.10.6", "2.11.11")
34-
}
35-
}
13+
coverageHighlighting := true
3614

3715
javacOptions ++= Seq("-source", "1.8", "-target", "1.8")
3816

@@ -46,10 +24,7 @@ parallelExecution in Test := false
4624
fork := true
4725

4826

49-
coverageHighlighting := {
50-
if (scalaBinaryVersion.value == "2.10") false
51-
else true
52-
}
27+
coverageHighlighting := true
5328

5429

5530

@@ -67,14 +42,6 @@ scalacOptions ++= Seq("-deprecation", "-unchecked")
6742
pomIncludeRepository := { x => false }
6843

6944
resolvers ++= Seq(
70-
"JBoss Repository" at "http://repository.jboss.org/nexus/content/repositories/releases/",
71-
"Spray Repository" at "http://repo.spray.cc/",
72-
"Cloudera Repository" at "https://repository.cloudera.com/artifactory/cloudera-repos/",
73-
"Akka Repository" at "http://repo.akka.io/releases/",
74-
"Twitter4J Repository" at "http://twitter4j.org/maven2/",
75-
"Apache HBase" at "https://repository.apache.org/content/repositories/releases",
76-
"Twitter Maven Repo" at "http://maven.twttr.com/",
77-
"scala-tools" at "https://oss.sonatype.org/content/groups/scala-tools",
7845
"sonatype-releases" at "https://oss.sonatype.org/content/repositories/releases/",
7946
"Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/",
8047
"Second Typesafe repo" at "http://repo.typesafe.com/typesafe/maven-releases/",

build/sbt

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
#!/bin/bash
2+
3+
#
4+
# Licensed to the Apache Software Foundation (ASF) under one or more
5+
# contributor license agreements. See the NOTICE file distributed with
6+
# this work for additional information regarding copyright ownership.
7+
# The ASF licenses this file to You under the Apache License, Version 2.0
8+
# (the "License"); you may not use this file except in compliance with
9+
# the License. You may obtain a copy of the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0
12+
#
13+
# Unless required by applicable law or agreed to in writing, software
14+
# distributed under the License is distributed on an "AS IS" BASIS,
15+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
# See the License for the specific language governing permissions and
17+
# limitations under the License.
18+
#
19+
20+
# This script launches sbt for this project. If present it uses the system
21+
# version of sbt. If there is no system version of sbt it attempts to download
22+
# sbt locally.
23+
SBT_VERSION=0.13.15
24+
URL1=http://typesafe.artifactoryonline.com/typesafe/ivy-releases/org.scala-sbt/sbt-launch/${SBT_VERSION}/sbt-launch.jar
25+
URL2=http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/sbt-launch/${SBT_VERSION}/sbt-launch.jar
26+
JAR=build/sbt-launch-${SBT_VERSION}.jar
27+
28+
# Download sbt launch jar if it hasn't been downloaded yet
29+
if [ ! -f ${JAR} ]; then
30+
# Download
31+
printf "Attempting to fetch sbt\n"
32+
set -x
33+
JAR_DL=${JAR}.part
34+
if hash wget 2>/dev/null; then
35+
(wget --progress=bar ${URL1} -O ${JAR_DL} || wget --progress=bar ${URL2} -O ${JAR_DL}) && mv ${JAR_DL} ${JAR}
36+
elif hash axel 2>/dev/null; then
37+
(axel ${URL1} -o ${JAR_DL} || axel ${URL2} -o ${JAR_DL}) && mv ${JAR_DL} ${JAR}
38+
else
39+
printf "You do not have curl or wget installed, please install sbt manually from http://www.scala-sbt.org/\n"
40+
exit -1
41+
fi
42+
fi
43+
if [ ! -f ${JAR} ]; then
44+
# We failed to download
45+
printf "Our attempt to download sbt locally to ${JAR} failed. Please install sbt manually from http://www.scala-sbt.org/\n"
46+
exit -1
47+
fi
48+
printf "Launching sbt from ${JAR}\n"
49+
java \
50+
-Xmx1200m -XX:MaxPermSize=350m -XX:ReservedCodeCacheSize=256m \
51+
-jar ${JAR} \
52+
"$@"

0 commit comments

Comments
 (0)