@@ -25,14 +25,14 @@ import com.earldouglas.xsbtwebplugin.PluginKeys._
2525import sbt .classpath .ClasspathUtilities
2626import Project .Initialize
2727
28- import sbtassembly .Plugin . AssemblyKeys .assembly
28+ import sbtassembly .AssemblyKeys .assembly
2929
3030import java .nio .file .{ Files , StandardCopyOption }
3131
3232import com .avi .sbt .betterzip .BetterZip .{ Entry => ZipEntry , _ }
3333
3434/** In charge of packaging up the node-webkit packages for distribution.
35- *
35+ *
3636 * @author robertf
3737 */
3838object Distributor extends BuildExtra {
@@ -44,7 +44,7 @@ object Distributor extends BuildExtra {
4444
4545 val rootZipFolder = SettingKey [String ](" root-zip-folder" )
4646 val webappFolder = SettingKey [String ](" webapp-folder" )
47-
47+
4848 val distCommon = SettingKey [File ](" dist-common" )
4949 val distJettyConf = SettingKey [File ](" dist-jetty-conf" )
5050
@@ -57,20 +57,20 @@ object Distributor extends BuildExtra {
5757 }
5858
5959 import Keys ._
60-
60+
6161 object Settings {
6262
6363 /** Each task of this type generates a listing of File->Path, where the File is
6464 * a file in the filesystem that will be packaged in a zip/war/jar, and the Path
6565 * is that file's path once it is packaged.
6666 */
67- type FileMappingTask = Initialize [Task [Seq [(ZipEntry )]]]
67+ type FileMappingTask = Def . Initialize [Task [Seq [(ZipEntry )]]]
6868
6969 def embeddedWar (conf : Configuration ): FileMappingTask = (packageWar in conf, webappFolder in Distribution ) map { (war, path) =>
7070 Seq (war -> (path + " webapps/root.war" ))
7171 }
7272
73- def webappClassesTask : Initialize [Task [Seq [(File , String )]]] = (warContents in Distribution ) map { (contents) =>
73+ def webappClassesTask : Def . Initialize [Task [Seq [(File , String )]]] = (warContents in Distribution ) map { (contents) =>
7474 val classPath = """ WEB-INF[\\ /]classes[\\ /](.*)""" .r
7575
7676 contents flatMap {
@@ -82,7 +82,7 @@ object Distributor extends BuildExtra {
8282 }
8383 }
8484
85- def buildJarTask : Initialize [Task [File ]] = (webappClasses in Distribution , crossTarget, name, version) map { (classes, ct, name, version) =>
85+ def buildJarTask : Def . Initialize [Task [File ]] = (webappClasses in Distribution , crossTarget, name, version) map { (classes, ct, name, version) =>
8686 val jarToMake = ct / (name + '-' + version + " -webapp-classes.jar" )
8787 IO .jar(classes, jarToMake, new java.util.jar.Manifest )
8888 jarToMake
@@ -100,36 +100,36 @@ object Distributor extends BuildExtra {
100100 })
101101 }
102102
103- def jettyDist (platform : String ): FileMappingTask = (jetty in Dependencies , distJettyConf in Distribution , rootZipFolder in Distribution , webappFolder in Distribution ) map { (jetty, confDir, rootZipFolder, webappFolder) =>
103+ def jettyDist (platform : String ): FileMappingTask = (jetty in Dependencies , distJettyConf in Distribution , rootZipFolder in Distribution , webappFolder in Distribution ) map { (jetty, confDir, rootZipFolder, webappFolder) =>
104104 if (! jetty.exists)
105105 sys.error(" Missing jetty. Please run `fetch-package-dependencies` or download and place in " + jetty + " ." )
106106
107107 val jettyExclusions = List (
108108 " demo-base/" , " etc/" , " start.d/" , " start.ini"
109109 ).map(webappFolder + _)
110110
111- val jettyFiles = jetty.*** x rebase(jetty, webappFolder) map {
111+ val jettyFiles = jetty.*** pair rebase(jetty, webappFolder) map {
112112 // replace \ in paths with /, for easier matching below
113113 case (src, dest) => (src, dest.replace('\\ ' , '/' ))
114114 } filter {
115115 case (_, path) if jettyExclusions exists { path startsWith _ } => println(" Excluding " + path); false
116116 case _ => true
117117 }
118118
119- val jettyConf = confDir.*** x rebase(confDir, webappFolder)
119+ val jettyConf = confDir.*** pair rebase(confDir, webappFolder)
120120
121121 appResource(platform, rootZipFolder, jettyFiles ++ jettyConf)
122122 }
123123
124124 def embeddedAppFiles (platform : String ): FileMappingTask = (distCommon in Distribution , rootZipFolder in Distribution ) map { (appFolder, rootZipFolder) =>
125- appResource(platform, rootZipFolder, appFolder.*** x rebase(appFolder, rootZipFolder))
125+ appResource(platform, rootZipFolder, appFolder.*** pair rebase(appFolder, rootZipFolder))
126126 }
127127
128128 def nodeWebkitRuntime (platform : String , nwkKey : SettingKey [File ]): FileMappingTask = (nwkKey in Dependencies , resourcer in Dependencies , rootZipFolder in Distribution , distCommon in Distribution , target, version) map { (nwk, resourcer, rootZipFolder, appFolder, target, version) =>
129129 if (! nwk.exists)
130130 sys.error(" Missing node-webkit for " + platform + " . Please run `fetch-package-dependencies` or download and place in " + nwk + " ." )
131131
132- val nwkFiles : Seq [ZipEntry ] = nwk.*** x rebase(nwk, rootZipFolder) map {
132+ val nwkFiles : Seq [ZipEntry ] = nwk.*** pair rebase(nwk, rootZipFolder) map {
133133 // replace \ in paths with /, for easier matching below
134134 case (src, dest) => (src, dest.replace('\\ ' , '/' ))
135135 }
@@ -169,7 +169,7 @@ object Distributor extends BuildExtra {
169169 Some (ZipEntry (customizedFile, " codepulse/codepulse.exe" , mode))
170170
171171 case e @ ZipEntry (_, path, _) if inclusions contains path => Some (e)
172-
172+
173173 case ZipEntry (_, path, _) if path endsWith " /" => None // silent
174174 case ZipEntry (_, path, _) => println(" Excluding " + path); None
175175 }
@@ -217,7 +217,7 @@ object Distributor extends BuildExtra {
217217
218218 case ZipEntry (file, path, mode) if path startsWith " codepulse/node-webkit.app" =>
219219 Some (ZipEntry (file, rewritePath(path), mode))
220-
220+
221221 case ZipEntry (_, path, _) if path endsWith " /" => None // silent
222222 case ZipEntry (_, path, _) => println(" Excluding " + path); None
223223 }
@@ -240,7 +240,7 @@ object Distributor extends BuildExtra {
240240 if (! jre.exists)
241241 sys.error(" Missing JRE for " + platform + " . Please run `fetch-package-dependencies` or download and place in " + jre + " ." )
242242
243- val jreFiles : Seq [ZipEntry ] = appResource(platform, rootZipFolder, jre.*** x rebase(jre, jreDest)) map {
243+ val jreFiles : Seq [ZipEntry ] = appResource(platform, rootZipFolder, jre.*** pair rebase(jre, jreDest)) map {
244244 // replace \ in paths with /, for easier matching below
245245 case (src, dest) => (src, dest.replace('\\ ' , '/' ))
246246 }
@@ -296,7 +296,7 @@ object Distributor extends BuildExtra {
296296
297297 case e @ ZipEntry (_, path, _) if ! (exclusions contains path) && ! exclusionDirs.exists(path.startsWith) =>
298298 Some (e)
299-
299+
300300 case ZipEntry (_, path, _) if path endsWith " /" => None // silent
301301 case ZipEntry (_, path, _) => println(" Excluding " + path); None
302302 }
@@ -308,7 +308,7 @@ object Distributor extends BuildExtra {
308308 " bin/rmid" , " bin/rmiregistry" , " bin/tnameserv" , " bin/keytool" , " bin/policytool" , " bin/orbd" , " bin/servertool" ,
309309 " bin/ControlPanel" , " bin/javaws" ,
310310 " lib/javafx.properties" , " lib/jfxrt.jar" , " lib/security/javafx.policy" ,
311- " lib/i386/fxavcodecplugin-52.so" , " lib/i386/fxavcodecplugin-53.so" , " lib/i386/fxplugins.so" , " lib/i386/libglass.so" , " lib/i386/libgstplugins-lite.so" , " lib/i386/libgstreamer-lite.so" , " lib/i386/libjavafx-font.so" , " lib/i386/libjavafx-iio.so" , " lib/i386/libjfxmedia.so" , " lib/i386/libjfxwebkit.so" , " lib/i386/libprism-es2.so" ,
311+ " lib/i386/fxavcodecplugin-52.so" , " lib/i386/fxavcodecplugin-53.so" , " lib/i386/fxplugins.so" , " lib/i386/libglass.so" , " lib/i386/libgstplugins-lite.so" , " lib/i386/libgstreamer-lite.so" , " lib/i386/libjavafx-font.so" , " lib/i386/libjavafx-iio.so" , " lib/i386/libjfxmedia.so" , " lib/i386/libjfxwebkit.so" , " lib/i386/libprism-es2.so" ,
312312 " THIRDPARTYLICENSEREADME-JAVAFX.txt" , " Welcome.html"
313313 ).map(base + _).toSet
314314
@@ -322,7 +322,7 @@ object Distributor extends BuildExtra {
322322
323323 case e @ ZipEntry (_, path, _) if ! (exclusions contains path) && ! exclusionDirs.exists(path.startsWith) =>
324324 Some (e)
325-
325+
326326 case ZipEntry (_, path, _) if path endsWith " /" => None // silent
327327 case ZipEntry (_, path, _) => println(" Excluding " + path); None
328328 }
@@ -365,18 +365,18 @@ object Distributor extends BuildExtra {
365365 out
366366 }
367367 )}
368-
369- lazy val distribSettings : Seq [Setting [_]] =
368+
369+ lazy val distribSettings : Seq [Setting [_]] =
370370 Seq (
371371 rootZipFolder in Distribution := " codepulse/" ,
372372 webappFolder in Distribution <<= (rootZipFolder in Distribution ) { _ + " backend/" },
373-
373+
374374 distCommon in Distribution := file(" distrib/common" ),
375375 distJettyConf in Distribution := file(" distrib/jetty-conf" ),
376-
376+
377377 webappClasses in Distribution <<= webappClassesTask,
378378 webappClassesJar in Distribution <<= buildJarTask
379- ) ++
379+ ) ++
380380 inConfig(DefaultConf ) { warContents in Distribution <<= com.earldouglas.xsbtwebplugin.WarPlugin .packageWarTask(DefaultClasspathConf ) } ++
381381 packageEmbeddedSettingsIn(" win32" , nwkWindows, jreWindows, packageEmbeddedWin32)(Compile ) ++
382382 packageEmbeddedSettingsIn(" osx" , nwkOsx, jreOsx, packageEmbeddedOsx)(Compile ) ++
0 commit comments