@@ -10,7 +10,8 @@ import com.amazonaws.services.s3.model.PutObjectResult
1010
1111// can't call it Universal -- that's taken by the packager
1212object ScalaDist {
13- val upload = TaskKey [Seq [PutObjectResult ]](" s3-upload" ," Uploads files to an S3 bucket." )
13+ val s3Upload = TaskKey [Seq [PutObjectResult ]](" s3Upload" ," Uploads files to an S3 bucket." )
14+ val ghUpload = TaskKey [Seq [Unit ]](" ghUpload" ," Uploads files to GitHub Releases." )
1415
1516 def createMappingsWith (deps : Seq [(sbt.librarymanagement.ConfigRef , ModuleID , Artifact , File )],
1617 distMappingGen : (ModuleID , Artifact , File ) => Seq [(File , String )]): Seq [(File , String )] =
@@ -21,30 +22,30 @@ object ScalaDist {
2122 case _ => Seq ()
2223 }
2324
24- // used to make s3-upload upload the file produced by fileTask to the path scala/$version/${file.name}
25+ // used to make s3Upload upload the file produced by fileTask to the path scala/$version/${file.name}
2526 private def uploadMapping (fileTask : TaskKey [File ]) = Def .task {
2627 val file = fileTask.value
2728 file -> s " scala/ ${version.value}/ ${file.getName}"
2829 }
2930
30- // make it so that s3-upload will upload the msi when we're running on windows, and everything else when we're on linux
31- // s3-upload thus depends on the package tasks listed below
31+ // make it so that s3Upload will upload the msi when we're running on windows, and everything else when we're on linux
32+ // s3Upload thus depends on the package tasks listed below
3233 def platformSettings =
3334 if (sys.props(" os.name" ).toLowerCase(java.util.Locale .US ) contains " windows" )
34- Wix .settings :+ (upload / mappings += uploadMapping(Windows / packageBin).value)
35+ Wix .settings :+ (s3Upload / mappings += uploadMapping(Windows / packageBin).value)
3536 else Unix .settings ++ Seq (
36- upload / mappings += uploadMapping(Universal / packageBin).value,
37- upload / mappings += uploadMapping(Universal / packageZipTarball).value,
38- upload / mappings += uploadMapping(UniversalDocs / packageBin).value,
39- upload / mappings += uploadMapping(UniversalDocs / packageZipTarball).value,
40- upload / mappings += uploadMapping(UniversalDocs / packageXzTarball).value,
41- upload / mappings += uploadMapping(Rpm / packageBin).value,
37+ s3Upload / mappings += uploadMapping(Universal / packageBin).value,
38+ s3Upload / mappings += uploadMapping(Universal / packageZipTarball).value,
39+ s3Upload / mappings += uploadMapping(UniversalDocs / packageBin).value,
40+ s3Upload / mappings += uploadMapping(UniversalDocs / packageZipTarball).value,
41+ s3Upload / mappings += uploadMapping(UniversalDocs / packageXzTarball).value,
42+ s3Upload / mappings += uploadMapping(Rpm / packageBin).value,
4243 // Debian needs special handling because the value sbt-native-packager
4344 // gives us for `Debian / packageBin` (coming from the archiveFilename
4445 // method) includes the debian version and arch information,
4546 // which we historically have not included. I don't see a way to
4647 // override the filename on disk, so we re-map at upload time
47- upload / mappings += Def .task {
48+ s3Upload / mappings += Def .task {
4849 (Debian / packageBin).value ->
4950 s " scala/ ${version.value}/ ${(Debian / name).value}- ${version.value}.deb "
5051 }.value
@@ -65,13 +66,6 @@ object ScalaDist {
6566 // create lib directory by resolving scala-dist's dependencies
6667 // to populate the rest of the distribution, explode scala-dist artifact itself
6768 Universal / mappings ++= createMappingsWith(update.value.toSeq, universalMappings),
68-
69- // work around regression in sbt-native-packager 1.0.5 where
70- // these tasks invoke `tar` without any flags at all. the issue
71- // was fixed in 1.1.0, so this could be revisited when we upgrade
72- UniversalDocs / packageZipTarball / universalArchiveOptions := Seq (" --force-local" , " -pcvf" ),
73- UniversalDocs / packageXzTarball / universalArchiveOptions := Seq (" --force-local" , " -pcvf" )
74-
7569 )
7670
7771 // private lazy val onWindows = System.getProperty("os.name").toLowerCase(Locale.ENGLISH).contains("windows")
0 commit comments