@@ -402,10 +402,11 @@ object SbtWeb extends AutoPlugin {
402
402
* Create package mappings for assets in the webjar format. Use the webjars path prefix and exclude all web module
403
403
* assets.
404
404
*/
405
- def createWebJarMappings : Def .Initialize [Task [Seq [(File , String )]]] = Def .task {
405
+ def createWebJarMappings : Def .Initialize [Task [Seq [(FileRef , String )]]] = Def .task {
406
406
def webModule (file : File ) = webModuleDirectories.value.exists(dir => IO .relativize(dir, file).isDefined)
407
+ implicit val fc : FileConverter = fileConverter.value
407
408
mappings.value flatMap {
408
- case (file, path) if webModule(file) => None
409
+ case (file, path) if webModule(toFile( file) ) => None
409
410
case (file, path) => Some (file -> (webJarsPathPrefix.value + path))
410
411
}
411
412
}
@@ -434,7 +435,8 @@ object SbtWeb extends AutoPlugin {
434
435
if (state.value.get(disableExportedProducts).getOrElse(false )) {
435
436
Seq .empty
436
437
} else {
437
- Seq (Attributed .blank(exportTask.value).put(toKey(webModulesLib), moduleName.value))
438
+ implicit val fc : FileConverter = fileConverter.value
439
+ Seq (Attributed .blank(toFileRef(exportTask.value)).put(toKey(webModulesLib), moduleName.value))
438
440
}
439
441
}
440
442
@@ -546,9 +548,9 @@ object SbtWeb extends AutoPlugin {
546
548
mappings.groupBy(_._2 /* path*/ ).toSeq flatMap { grouped =>
547
549
val (path, group) = grouped
548
550
if (group.size > 1 ) {
549
- val files = group.map(_ ._1)
551
+ val files = group.map(mapping => toFile(mapping ._1) )
550
552
val deduplicated = firstResult(deduplicators)(files)
551
- deduplicated.fold(group)(file => Seq ((file, path)))
553
+ deduplicated.fold(group)(file => Seq ((toFileRef( file) , path)))
552
554
} else {
553
555
group
554
556
}
@@ -563,18 +565,6 @@ object SbtWeb extends AutoPlugin {
563
565
(fs.toStream flatMap { f => f(a).toSeq }).headOption
564
566
}
565
567
566
- /**
567
- * Deduplicator that selects the first file contained in the base directory.
568
- *
569
- * @param base
570
- * the base directory to check against
571
- * @return
572
- * a deduplicator function that prefers files in the base directory
573
- */
574
- def selectFileFrom (base : File ): Deduplicator = { (files : Seq [File ]) =>
575
- files.find(_.relativeTo(base).isDefined)
576
- }
577
-
578
568
/**
579
569
* Deduplicator that checks whether all duplicates are directories and if so will simply select the first one.
580
570
*
0 commit comments