Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed typo, shortened hash string padding and removed debug printlns #33

Merged
merged 1 commit into from
Sep 5, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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