The project base directory is by default a source directory in addition to src/main/scala. You can exclude source files by name like:
excludeFilter in unmanagedSources := "butler.scala"
-Mark
>
> Regards,
> Hendy
>
Thank you Mark!
Much thanks!
Hendy
--
You received this message because you are subscribed to the Google Groups "simple-build-tool" group.
To post to this group, send email to simple-b...@googlegroups.com.
To unsubscribe from this group, send email to simple-build-t...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/simple-build-tool?hl=en.
> excludeFilter :== (".*" - ".") || HiddenFileFilter
Does setting it to be "butler.scala" not result in hidden files no
longer being excluded? And what (if any) are the bad effects of this?
Not a big thing, but I just want to make sure that I'm understanding
things correctly :-)
On Sun, Oct 23, 2011 at 6:57 PM, paulbutcher
<paulra...@googlemail.com> wrote:
>
>> excludeFilter :== (".*" - ".") || HiddenFileFilter
>
> Does setting it to be "butler.scala" not result in hidden files no
> longer being excluded? And what (if any) are the bad effects of this?
>
> Not a big thing, but I just want to make sure that I'm understanding
> things correctly :-)
Keep in mind scopes: https://github.com/harrah/xsbt/wiki/Getting-Started-Scopes
It's a little hard to unpack this from the sbt command line because
the filters' values just show up as "sbt.SimpleFileFilter@8bfdea" when
you "inspect exclude-filter"
But if you look where the excludeFilter :== definition you mention is
defined in Defaults.scala, it's "inScope(GlobalScope)" so that is
defining */*:exclude-filter
Mark's suggestion is to define
excludeFilter in unmanagedSources := "butler.scala"
which is specifically for the unmanagedSources task only rather than global.
That already has a whitelist:
includeFilter in unmanagedSources :== "*.java" | "*.scala"
I think you may be right that hidden files would no longer be
excluded, but unless your hidden files end in .scala or .java then
perhaps it won't really matter since they won't be in the
includeFilter.
If you messed with excludeFilter globally rather than in
unmanaged-sources, there could maybe be more side effects, I don't
know.
Havoc
> Hi,
>
> On Sun, Oct 23, 2011 at 6:57 PM, paulbutcher
> <paulra...@googlemail.com> wrote:
> >
> >> excludeFilter :== (".*" - ".") || HiddenFileFilter
> >
> > Does setting it to be "butler.scala" not result in hidden files no
> > longer being excluded? And what (if any) are the bad effects of this?
Yes, you're right, perhaps I simplified the answer too much.
> > Not a big thing, but I just want to make sure that I'm understanding
> > things correctly :-)
>
> Keep in mind scopes: https://github.com/harrah/xsbt/wiki/Getting-Started-Scopes
>
> It's a little hard to unpack this from the sbt command line because
> the filters' values just show up as "sbt.SimpleFileFilter@8bfdea" when
> you "inspect exclude-filter"
>
> But if you look where the excludeFilter :== definition you mention is
> defined in Defaults.scala, it's "inScope(GlobalScope)" so that is
> defining */*:exclude-filter
>
> Mark's suggestion is to define
>
> excludeFilter in unmanagedSources := "butler.scala"
>
> which is specifically for the unmanagedSources task only rather than global.
>
> That already has a whitelist:
>
> includeFilter in unmanagedSources :== "*.java" | "*.scala"
>
> I think you may be right that hidden files would no longer be
> excluded, but unless your hidden files end in .scala or .java then
> perhaps it won't really matter since they won't be in the
> includeFilter.
The main reason you'd probably want to keep the hidden file exclusion is to exclude source files in .svn directories, for example. You can augment the current filter instead of completely replacing it with something like:
excludeFilter in unmanagedSources ~= { _ || "butler.scala" }
which is equivalent to:
excludeFilter in unmanagedSources <<=
(excludeFilter in unmanagedSources) { (currentFilter: FileFilter) =>
currentFilter || "butler.scala"
}
-Mark
That should be unmanagedResources instead of resources (for sources, it is unmanagedSources). The reason is that sbt only automatically traverses unmanaged resource directories looking for resources. 'resources' contains both 'unmanagedResources' and 'managedResources' and no filtering is done on 'resources'.
-Mark
> jan
>