Skip to content

Commit

Permalink
Merge pull request #33 from ptrbrtz/master
Browse files Browse the repository at this point in the history
Fixed typo, shortened hash string padding and removed debug printlns
  • Loading branch information
jsuereth committed Sep 5, 2013
2 parents 756ac36 + b572b79 commit 40941cb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/main/scala/com/typesafe/sbt/PackagerPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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 := ""
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
<Directory Id={cleanStringForId(currentDir)} Name={simpleName(currentDir)}>
Expand Down Expand Up @@ -194,7 +192,7 @@ object WixHelper {
<MajorUpgrade
AllowDowngrades="no"
Schedule="afterInstallInitialize"
DowngradeErrorMessage="A later version of [ProductName] is already installed. Setup will no exit."/>
DowngradeErrorMessage="A later version of [ProductName] is already installed. Setup will now exit."/>
<UIRef Id="WixUI_FeatureTree"/>
<UIRef Id="WixUI_ErrorProgressText"/>
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLDIR"/>
Expand Down Expand Up @@ -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. */
Expand Down

0 comments on commit 40941cb

Please sign in to comment.