Howto exclude assets in distribution build

21 views
Skip to first unread message

puperzenkarl

unread,
Aug 3, 2017, 8:04:38 AM8/3/17
to Play Framework
I would like to exclude a specific directory from the distribution build.

My public assets directory:
+ ckeditor
+ ckeditor-dev-4.7.0
+ images
+ javascripts
+ stylesheets

The current distribution build includes all of those assets. But I want to exclude the directory ckeditor-dev-4.7.0, because I only need it in my development environment and not in production.

I added the following lines to build.sbt:
mappings in Assets := {
 
val origMappings = (mappings in Assets).value
  origMappings
.filterNot { case (_, file) => file.contains("ckeditor-dev-4.7.0") }
}

This does exclude the directory from the distribution build, but it is also not available in my development runtime, like it does not even exist. Is it possible to scope this to the dist task?

Will Sargent

unread,
Aug 3, 2017, 12:59:33 PM8/3/17
to play-fr...@googlegroups.com
I think you're close, you want the packageBin scope:

mappings in packageBin ~= { _.filterNot { case (_, name) =>
      ...
--
You received this message because you are subscribed to the Google Groups "Play Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framewor...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/269506c5-baae-4e17-85f4-56ea5a403827%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

puperzenkarl

unread,
Aug 9, 2017, 7:22:53 AM8/9/17
to Play Framework
I get the following error:

Reference to undefined setting: 

  *:packageBin::mappings from *:packageBin::mappings (C:\dev\src\de.fact.finrp\trunk\finrp-web\build.sbt:48)
     Did you mean universal:packageBin::mappings ?
Reply all
Reply to author
Forward
0 new messages