Skip to content

Commit

Permalink
Merge pull request #50 from sbt/wip-jsuereth-fix-43
Browse files Browse the repository at this point in the history
Fixes #43 - unable to create MSI of play application
  • Loading branch information
jsuereth committed Oct 21, 2013
2 parents 02ff0bd + 9cb77b6 commit fe77d76
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=0.12.4
sbt.version=0.13.0
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ trait GenericPackageSettings
(file, name) <- mappings
if !file.isDirectory
if name startsWith "conf/"
} yield name
} yield name.replaceAll("//", "/").stripSuffix("/").stripSuffix("/")
val menuLinks =
WindowsFeature(
id="AddConfigLinks",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ object WixHelper {
// Now for directories...
def parentDir(filename: String) = { filename take (filename lastIndexOf '/') }
def simpleName(filename: String) = {
val lastSlash = filename lastIndexOf '/'
val lastSlash =
if(filename contains '/') filename lastIndexOf '/'
else filename lastIndexOf '\\'
filename drop (lastSlash + 1)
}
val dirs = (filenames map parentDir).distinct;
Expand Down Expand Up @@ -105,7 +107,7 @@ object WixHelper {
ComponentInfo(id, xml)
case ComponentFile(name, editable) =>
val uname = name.replaceAll("\\\\", "/")
val dir = parentDir(uname)
val dir = parentDir(uname).replaceAll("//", "/").stripSuffix("/").stripSuffix("/")
val dirRef = if(dir.isEmpty) "INSTALLDIR" else cleanStringForId(dir)
val fname = simpleName(uname)
val id = cleanStringForId(uname).takeRight(67) // Room for "fl_"
Expand Down Expand Up @@ -134,8 +136,9 @@ object WixHelper {
for(target <- targets) yield {
val name = simpleName(target)
val desc = "Edit configuration file: " + name
val cleanName = name.replaceAll("[\\.-\\\\//]+","_")
<Shortcut Id={id+"_SC"}
Name={name}
Name={cleanName}
Description={desc}
Target={"[INSTALLDIR]\\" + target.replaceAll("\\/", "\\\\")}
WorkingDirectory="INSTALLDIR"/>
Expand Down
2 changes: 1 addition & 1 deletion test-project/build.sbt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import NativePackagerKeys._

packageArchetype.java_server
play.Project.playScalaSettings //packageArchetype.java_server

name := "dtest"

Expand Down
1 change: 1 addition & 0 deletions test-project/conf/application.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

3 changes: 3 additions & 0 deletions test-project/project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
resolvers += Resolver.typesafeRepo("releases")

addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.2.0")

0 comments on commit fe77d76

Please sign in to comment.