From b572b79f65a3f3d49f801ce98cf3a0e8e3f300c2 Mon Sep 17 00:00:00 2001 From: Peter Bartz Date: Thu, 5 Sep 2013 10:58:13 +0200 Subject: [PATCH] Fixed typo, shortened hash string padding and removed debug printlns --- src/main/scala/com/typesafe/sbt/PackagerPlugin.scala | 2 +- .../com/typesafe/sbt/packager/windows/WixHelper.scala | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/main/scala/com/typesafe/sbt/PackagerPlugin.scala b/src/main/scala/com/typesafe/sbt/PackagerPlugin.scala index ef13e10a8..a8c877991 100644 --- a/src/main/scala/com/typesafe/sbt/PackagerPlugin.scala +++ b/src/main/scala/com/typesafe/sbt/PackagerPlugin.scala @@ -24,7 +24,7 @@ object SbtNativePackager extends Plugin windowsSettings ++ universalSettings ++ Seq( // Bad defaults that let us at least not explode users who don't care about native packagers - NativePackagerKeys. maintainer := "", + NativePackagerKeys.maintainer := "", NativePackagerKeys.packageDescription := "", NativePackagerKeys.packageSummary := "" ) diff --git a/src/main/scala/com/typesafe/sbt/packager/windows/WixHelper.scala b/src/main/scala/com/typesafe/sbt/packager/windows/WixHelper.scala index 153fc2c56..5579053f4 100644 --- a/src/main/scala/com/typesafe/sbt/packager/windows/WixHelper.scala +++ b/src/main/scala/com/typesafe/sbt/packager/windows/WixHelper.scala @@ -65,16 +65,14 @@ object WixHelper { } yield allParentDirs(file(name)) val filenames = filenamesPrep.flatten.map(_.toString.replaceAll("\\\\","/")).filter(_ != "") // Now for directories... - def parentDir(filename: String) = {/*println("xxxxxxxxxxx: " + (filename take (filename lastIndexOf '/')));*/ filename take (filename lastIndexOf '/') } + def parentDir(filename: String) = { filename take (filename lastIndexOf '/') } def simpleName(filename: String) = { val lastSlash = filename lastIndexOf '/' filename drop (lastSlash + 1) } val dirs = (filenames map parentDir).distinct; - // TODO println("DDDDDDDDDDDDDDD:" + dirs.toString) // Now we need our directory tree xml? val dirToChildren = dirs groupBy parentDir; - // TODO println("CCCCCCCCCCCCCCC:" + dirToChildren.toString) def dirXml(currentDir: String): scala.xml.Node = if(!currentDir.isEmpty) { val children = dirToChildren.getOrElse(currentDir, Seq.empty) @@ -194,7 +192,7 @@ object WixHelper { + DowngradeErrorMessage="A later version of [ProductName] is already installed. Setup will now exit."/> @@ -235,7 +233,7 @@ object WixHelper { * 72) so we can safely add a few later. */ def cleanStringForId(n: String) = { - n.replaceAll("[^0-9a-zA-Z_]", "_").takeRight(50) + (math.abs(n.hashCode).toString + "xxxxxxxxxxxxxxxxxxx").substring(0, 19) + n.replaceAll("[^0-9a-zA-Z_]", "_").takeRight(60) + (math.abs(n.hashCode).toString + "xxxxxxxxx").substring(0, 9) } /** Cleans a file name for the Wix pre-processor. Every $ should be doubled. */