Skip to content

Commit f8ae22c

Browse files
committed
Update SBT and plugins to latest versions
1 parent 41cc2df commit f8ae22c

File tree

6 files changed

+40
-45
lines changed

6 files changed

+40
-45
lines changed

admin/build.sh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,7 @@ if [[ "$TRAVIS_EVENT_TYPE" == "api" ]]; then
104104
exit 1
105105
fi
106106
else
107-
# although this is the 2.13.x branch, we don't have any 2.13 scala-dist
108-
# artifacts to depend on yet. so for now, just keep using 2.12.4
109-
version="2.12.4"
107+
version="2.13.6"
110108
clearIvyCache
111109
# By default, test building the packages (but don't uplaod)
112110
sbt -Dproject.version=$version "show s3Upload::mappings"

build.sbt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import com.typesafe.sbt.SbtGit._
21
import ScalaDist.upload
32

43
// so we don't require a native git install
@@ -16,11 +15,9 @@ Versioning.settings
1615
// are known/understood, at scala/scala-dist#171
1716
scalaVersion := version.value
1817

19-
mappings in upload := Seq()
18+
upload / mappings := Seq()
2019

2120
upload := {
22-
import com.amazonaws.{ClientConfiguration, Protocol}
23-
import com.amazonaws.auth.DefaultAWSCredentialsProviderChain
2421
import com.amazonaws.services.s3.AmazonS3ClientBuilder
2522
import com.amazonaws.services.s3.model.PutObjectRequest
2623
import com.amazonaws.regions.Regions
@@ -29,8 +26,7 @@ upload := {
2926
val client = AmazonS3ClientBuilder.standard.withRegion(Regions.US_EAST_1).build
3027

3128
val log = streams.value.log
32-
33-
(mappings in upload).value map { case (file, key) =>
29+
(upload / mappings).value map { case (file, key) =>
3430
log.info("Uploading "+ file.getAbsolutePath() +" as "+ key)
3531
client.putObject(new PutObjectRequest("downloads.typesafe.com", key, file))
3632
}

project/Docs.scala

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,17 @@ object Docs {
1616
import ScalaDist._
1717

1818
def settings: Seq[Setting[_]] = Seq(
19-
packageName in UniversalDocs := s"scala-docs-${version.value}",
19+
UniversalDocs / packageName := s"scala-docs-${version.value}",
2020
// libraryDependencies += scalaDistDep(version.value, "javadoc"), // seems not to be necessary
2121
// need updateClassifiers to get javadoc jars
22-
mappings in UniversalDocs ++= createMappingsWith(updateClassifiers.value.toSeq, universalDocsMappings)
22+
UniversalDocs / mappings ++= createMappingsWith(updateClassifiers.value.toSeq, universalDocsMappings)
2323
)
2424

2525
private def universalDocsMappings(id: ModuleID, artifact: Artifact, file: File): Seq[(File, String)] = {
2626
def includeJar = (file -> s"api/jars/${id.name}-${id.revision}-javadoc.jar")
27-
artifact match {
28-
case Artifact("scala-library" | "scala-reflect" | "scala-compiler", "doc", _, _, _, _, _) =>
27+
if (artifact.`type` != "doc") Seq()
28+
else artifact.name match {
29+
case "scala-library" | "scala-reflect" | "scala-compiler" =>
2930
val tmpdir = IO.createTemporaryDirectory
3031
IO.unzip(file, tmpdir)
3132
// IO.listFiles(tmpdir) does not recurse, use ** with glob "*" to find all files
@@ -35,7 +36,6 @@ object Docs {
3536
Seq(file -> s"api/${id.name}/$relative")
3637
}
3738
includeJar +: exploded
38-
case Artifact(_, "doc", _, _, _, _, _) =>
3939
Seq(includeJar)
4040
case _ => Seq()
4141
}

project/ScalaDist.scala

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ import com.amazonaws.services.s3.model.PutObjectResult
1212
object ScalaDist {
1313
val upload=TaskKey[Seq[PutObjectResult]]("s3-upload","Uploads files to an S3 bucket.")
1414

15-
def createMappingsWith(deps: Seq[(String, ModuleID, Artifact, File)],
15+
def createMappingsWith(deps: Seq[(sbt.librarymanagement.ConfigRef, ModuleID, Artifact, File)],
1616
distMappingGen: (ModuleID, Artifact, File) => Seq[(File, String)]): Seq[(File, String)] =
1717
deps flatMap {
18-
case d@(ScalaDistConfig, id, artifact, file) => distMappingGen(id, artifact, file)
18+
case (configRef, id, artifact, file) if configRef.name == ScalaDistConfigName => distMappingGen(id, artifact, file)
1919
case _ => Seq()
2020
}
2121

@@ -29,22 +29,22 @@ object ScalaDist {
2929
// s3-upload thus depends on the package tasks listed below
3030
def platformSettings =
3131
if (sys.props("os.name").toLowerCase(java.util.Locale.US) contains "windows")
32-
Wix.settings :+ (mappings in upload += uploadMapping(packageBin in Windows).value)
32+
Wix.settings :+ (upload / mappings += uploadMapping(Windows / packageBin).value)
3333
else Unix.settings ++ Seq(
34-
mappings in upload += uploadMapping(packageBin in Universal).value,
35-
mappings in upload += uploadMapping(packageZipTarball in Universal).value,
36-
mappings in upload += uploadMapping(packageBin in UniversalDocs).value,
37-
mappings in upload += uploadMapping(packageZipTarball in UniversalDocs).value,
38-
mappings in upload += uploadMapping(packageXzTarball in UniversalDocs).value,
39-
mappings in upload += uploadMapping(packageBin in Rpm).value,
34+
upload / mappings += uploadMapping(Universal / packageBin).value,
35+
upload / mappings += uploadMapping(Universal / packageZipTarball).value,
36+
upload / mappings += uploadMapping(UniversalDocs / packageBin).value,
37+
upload / mappings += uploadMapping(UniversalDocs / packageZipTarball).value,
38+
upload / mappings += uploadMapping(UniversalDocs / packageXzTarball).value,
39+
upload / mappings += uploadMapping(Rpm / packageBin).value,
4040
// Debian needs special handling because the value sbt-native-packager
41-
// gives us for `packageBin in Debian` (coming from the archiveFilename
41+
// gives us for `Debian / packageBin` (coming from the archiveFilename
4242
// method) includes the debian version and arch information,
4343
// which we historically have not included. I don't see a way to
4444
// override the filename on disk, so we re-map at upload time
45-
mappings in upload += Def.task {
46-
(packageBin in Debian).value ->
47-
s"scala/${version.value}/${(name in Debian).value}-${version.value}.deb"
45+
upload / mappings += Def.task {
46+
(Debian / packageBin).value ->
47+
s"scala/${version.value}/${(Debian / name).value}-${version.value}.deb"
4848
}.value
4949
)
5050

@@ -57,31 +57,32 @@ object ScalaDist {
5757
packageDescription := "Have the best of both worlds. Construct elegant class hierarchies for maximum code reuse and extensibility, implement their behavior using higher-order functions. Or anything in-between.",
5858
crossPaths := false,
5959

60-
ivyConfigurations += config(ScalaDistConfig),
60+
ivyConfigurations += ScalaDistConfig,
6161
libraryDependencies += scalaDistDep(version.value, "runtime"),
6262

6363
// create lib directory by resolving scala-dist's dependencies
6464
// to populate the rest of the distribution, explode scala-dist artifact itself
65-
mappings in Universal ++= createMappingsWith(update.value.toSeq, universalMappings),
65+
Universal / mappings ++= createMappingsWith(update.value.toSeq, universalMappings),
6666

67-
// work around regression in sbt-native-packager 1.0.5 where
67+
// work around sbt / regression-native-packager 1.0.5 where
6868
// these tasks invoke `tar` without any flags at all. the issue
69-
// was fixed in 1.1.0, so this could be revisited when we upgrade
70-
universalArchiveOptions in (UniversalDocs, packageZipTarball) := Seq("--force-local", "-pcvf"),
71-
universalArchiveOptions in (UniversalDocs, packageXzTarball ) := Seq("--force-local", "-pcvf")
69+
// was 1 / fixed.1.0, so this could be revisited when we upgrade
70+
UniversalDocs / packageZipTarball / universalArchiveOptions := Seq("--force-local", "-pcvf"),
71+
UniversalDocs / packageXzTarball / universalArchiveOptions := Seq("--force-local", "-pcvf")
7272

7373
)
7474

7575
// private lazy val onWindows = System.getProperty("os.name").toLowerCase(Locale.ENGLISH).contains("windows")
7676
// only used for small batch files, normalize line endings in-place
7777
// private def toDosInPlace(f: File) = IO.writeLines(file, IO.readLines(file))
7878

79-
private lazy val ScalaDistConfig = "scala-dist"
79+
private lazy val ScalaDistConfigName = "scala-dist"
80+
private lazy val ScalaDistConfig = config(ScalaDistConfigName)
8081
// segregate scala-dist's compile dependencies into the scala-dist config
8182
private def scalaDistDep(v: String, config: String): ModuleID =
82-
"org.scala-lang" % "scala-dist" % v % s"${ScalaDistConfig}; ${ScalaDistConfig}->${config}"
83+
"org.scala-lang" % "scala-dist" % v % s"${ScalaDistConfigName}; ${ScalaDistConfigName}->${config}"
8384

84-
// map module to the corresponding file mappings (unzipping scala-dist in the process)
85+
// map module to the corresponding file mappings (unzipping scala-the / dist process)
8586
private def universalMappings(id: ModuleID, artifact: Artifact, file: File): Seq[(File, String)] = id.name match {
8687
// scala-dist: explode (drop META-INF/)
8788
case "scala-dist" =>
@@ -90,7 +91,7 @@ object ScalaDist {
9091

9192
// create mappings from the unzip scala-dist zip
9293
contentOf(tmpdir) filter {
93-
case (file, dest) => !(dest.endsWith("MANIFEST.MF") || dest.endsWith("META-INF"))
94+
case (_, dest) => !(dest.endsWith("MANIFEST.MF") || dest.endsWith("META-INF"))
9495
} map {
9596
// make unix scripts executable (heuristically...)
9697
case (file, dest) if (dest startsWith "bin/") && !(dest endsWith ".bat") =>

project/build.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
sbt.version=0.13.18
1+
sbt.version=1.5.4

project/plugins.sbt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
scalacOptions ++= Seq("-deprecation", "-feature", "-Xlint")
1+
scalacOptions ++= Seq("-deprecation", "-feature", "-Xlint:_,-unused")
22

33
// jdeb and spotify docker are 'provided' in sbt-native-packager
4-
libraryDependencies += "org.vafer" % "jdeb" % "1.3" artifacts (Artifact("jdeb", "jar", "jar"))
5-
libraryDependencies += "com.spotify" % "docker-client" % "8.9.0"
6-
addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.3.3")
4+
libraryDependencies += "org.vafer" % "jdeb" % "1.9" artifacts (Artifact("jdeb", "jar", "jar"))
5+
libraryDependencies += "com.spotify" % "docker-client" % "8.16.0"
6+
addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.8.1")
77

8-
libraryDependencies += "com.amazonaws" % "aws-java-sdk-s3" % "1.11.277"
8+
libraryDependencies += "com.amazonaws" % "aws-java-sdk-s3" % "1.12.5"
99

1010
// git plugin
11-
resolvers += "jgit-repo" at "http://download.eclipse.org/jgit/maven"
11+
resolvers += "jgit-repo" at "https://download.eclipse.org/jgit/maven"
1212

13-
addSbtPlugin("com.typesafe.sbt" % "sbt-git" % "0.6.4")
13+
addSbtPlugin("com.typesafe.sbt" % "sbt-git" % "1.0.1")
1414

0 commit comments

Comments
 (0)