Skip to content

Commit eaa386b

Browse files
committed
Merge pull request #162 from SethTisue/native-packager-downgrade
downgrade sbt-native-packager to 0.6.4
2 parents eeefb5c + 23d097e commit eaa386b

File tree

6 files changed

+20
-33
lines changed

6 files changed

+20
-33
lines changed

build.sbt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ Docs.settings
2323

2424
ScalaDist.platformSettings
2525

26-
enablePlugins(UniversalPlugin, RpmPlugin, JDebPackaging, WindowsPlugin)
27-
2826
// resolvers += "local" at "file:///e:/.m2/repository"
2927
// resolvers += Resolver.mavenLocal
3028
// to test, run e.g., stage, or windows:packageBin, show s3-upload::mappings

project/Docs.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ object Docs {
1616
import ScalaDist._
1717

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

project/ScalaDist.scala

Lines changed: 13 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ import sbt._
22
import sbt.Keys._
33

44
import com.typesafe.sbt.SbtNativePackager._
5-
import com.typesafe.sbt.packager.MappingsHelper._
6-
import com.typesafe.sbt.packager.universal.UniversalPlugin.autoImport.useNativeZip
75
import com.typesafe.sbt.packager.Keys._
86

97
import com.typesafe.sbt.S3Plugin.S3.upload
@@ -40,18 +38,11 @@ object ScalaDist {
4038
mappings in upload += uploadMapping(packageZipTarball in UniversalDocs).value,
4139
mappings in upload += uploadMapping(packageXzTarball in UniversalDocs).value,
4240
mappings in upload += uploadMapping(packageBin in Rpm).value,
43-
// Debian needs special handling because the value sbt-native-packager
44-
// gives us for `packageBin in Debian` (coming from the archiveFilename
45-
// method) includes the debian version and arch information,
46-
// which we historically have not included. I don't see a way to
47-
// override the filename on disk, so we re-map at upload time
48-
mappings in upload += Def.task {
49-
(packageBin in Debian).value ->
50-
s"scala/${version.value}/${(name in Debian).value}-${version.value}.deb"
51-
}.value
41+
mappings in upload += uploadMapping(packageBin in Debian).value
5242
)
5343

5444
def settings: Seq[Setting[_]] =
45+
packagerSettings ++
5546
useNativeZip ++ // use native zip to preserve +x permission on scripts
5647
Seq(
5748
name := "scala",
@@ -65,13 +56,7 @@ object ScalaDist {
6556

6657
// create lib directory by resolving scala-dist's dependencies
6758
// to populate the rest of the distribution, explode scala-dist artifact itself
68-
mappings in Universal ++= createMappingsWith(update.value.toSeq, universalMappings),
69-
70-
// work around regression in sbt-native-packager 1.0.5 where
71-
// these tasks invoke `tar` without any flags at all
72-
universalArchiveOptions in (UniversalDocs, packageZipTarball) := Seq("--force-local", "-pcvf"),
73-
universalArchiveOptions in (UniversalDocs, packageXzTarball ) := Seq("--force-local", "-pcvf")
74-
59+
mappings in Universal ++= createMappingsWith(update.value.toSeq, universalMappings)
7560
)
7661

7762
// private lazy val onWindows = System.getProperty("os.name").toLowerCase(Locale.ENGLISH).contains("windows")
@@ -89,16 +74,19 @@ object ScalaDist {
8974
case "scala-dist" =>
9075
val tmpdir = IO.createTemporaryDirectory
9176
IO.unzip(file, tmpdir)
77+
// IO.listFiles(tmpdir) does not recurse, use ** with glob "*" to find all files
78+
(PathFinder(IO.listFiles(tmpdir)) ** "*").get flatMap { file =>
79+
val relative = IO.relativize(tmpdir, file).get // .get is safe because we just unzipped under tmpdir
80+
81+
// files are stored in repository with platform-appropriate line endings
82+
// if (onWindows && (relative endsWith ".bat")) toDosInPlace(file)
9283

93-
// create mappings from the unzip scala-dist zip
94-
contentOf(tmpdir) filter {
95-
case (file, dest) => !(dest.endsWith("MANIFEST.MF") || dest.endsWith("META-INF"))
96-
} map {
9784
// make unix scripts executable (heuristically...)
98-
case (file, dest) if (dest startsWith "bin/") && !(dest endsWith ".bat") =>
85+
if ((relative startsWith "bin/") && !(file.getName endsWith ".bat"))
9986
file.setExecutable(true, true)
100-
file -> dest
101-
case mapping => mapping
87+
88+
if (relative startsWith "META-INF") Seq()
89+
else Seq(file -> relative)
10290
}
10391

10492
// core jars: use simple name for backwards compat

project/Unix.scala

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import sbt.Keys._
44
import com.typesafe.sbt.SbtNativePackager._
55
import com.typesafe.sbt.packager.Keys._
66
import com.typesafe.sbt.packager.linux.{LinuxPackageMapping => pkgMap, LinuxSymlink}
7-
import com.typesafe.sbt.packager.linux.LinuxPlugin.autoImport.packageMapping
87

98
/** Create debian & rpm packages.
109
*
@@ -66,7 +65,7 @@ object Unix {
6665

6766
// RPM Specific
6867
name in Rpm := "scala",
69-
rpmVendor := "typesafe",
68+
rpmVendor := "lightbend",
7069
rpmUrl := Some("http://github.com/scala/scala"),
7170
rpmLicense := Some("BSD"),
7271
rpmGroup := Some("Development/Languages"),
@@ -92,7 +91,9 @@ object Unix {
9291

9392
linuxPackageMappings in Debian += (packageMapping(
9493
(sourceDirectory.value / "debian" / "changelog") -> "/usr/share/doc/scala/changelog.gz"
95-
).withUser("root").withGroup("root").withPerms("0644").gzipped).asDocs()
94+
).withUser("root").withGroup("root").withPerms("0644").gzipped).asDocs(),
9695

96+
// Hack so we use regular version, rather than debian version.
97+
target in Debian := target.value / s"${(name in Debian).value}-${version.value}"
9798
)
9899
}

project/plugins.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
scalacOptions ++= Seq("-deprecation", "-feature", "-Xlint")
22

3-
addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.0.6")
3+
addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "0.6.4")
44

55
addSbtPlugin("com.typesafe.sbt" % "sbt-s3" % "0.8")
66

scripts/jobs/release/website/archives

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# need to re-declare it as an array, not sure how to do that directly in jenkins
33
declare -a sshCharaArgs="$sshCharaArgs"
44

5-
url="http://downloads.typesafe.com/scala/$version"
5+
url="http://downloads.lightbend.com/scala/$version"
66

77
if [[ "$version" =~ .*-nightly ]]
88
then archivesDir="~linuxsoft/archives/scala/nightly/2.11.x"

0 commit comments

Comments
 (0)