-
Notifications
You must be signed in to change notification settings - Fork 443
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
Should employ mappings in ThisScope instead of mappings in Universal #746
Comments
I'm adding this from the gitter chat as well:
So, let's go through this one by one.
SBT native packager provides two categories of AutoPlugins: FormatPlugins and ArchetypePlugins. FormatPlugins provide a new package format, e.g.
mappings in ParentFormatPluginScope := (mappings in FormatPluginScope).value So for docker it looks like this mappings in Docker := (mappings in Universal).value The linux format plugins use specialized mappings to preserve file permissions, but are basically the same.
Yes. If you want to define your own scope and inherit the mappings and change them you have to do this, like all other packaging plugins, too. I recommend putting this code into custom For example (not tested, imports may be missing )
You package stuff by specifying the scope:
So if you need to customize your output format you are doing this in the respecting scope. mappings in Docker := (mappings in Docker).value.filter( /* what ever you want to filter */) |
I have a multi-project build with a particularly messy module which contain several mainClasses. I would like to create several distribution packages for this messy module, each distribution package employing distinct file sets and employing different formats.
The basic idea consists on having multiple configurations for different packages to be generated. Each configuration tells which files will be present in the package. This is the code:
Now observe the configuration
BuilderRV
which in comments.It is basically the same thing as configuration
BuilderRS
, except that we are now deploying a different shell script in thebin
folder. There some other small differences, but not relevant to this argumentation. There are two problems:sbt-native-packager
plugin always pickmappings in Universal
. This is not ideal. It should conceptually pickmappings in ThisScope
.sbt-native-packager
plugin always pickmappings in Universal
, I have to redefinemappings in Universal
in each of my configurations. And this is a problem becausemappings in Universal
is defined as a function of itself in all configurations: the result is that we ended up chaining logic tomapppings in Universal
each time we redefined it in each configuration. This causes trouble in this example in particular because the configurationBuilderRV
(the second one) will perform not only its filter, but also the filter defined inBuilderRS
(the first one), which is not what I want.The text was updated successfully, but these errors were encountered: