sbt-protobuf
sbt-protobuf copied to clipboard
add `protobufExcludePaths` setting key
It would be helpful to have a protobufExcludePaths setting key. Example use case: excluding conflicting schema definitions from multiple external sources. The granularity would probably be best at the individual file level (not directory). happy to contribute this if others are in favor of this feature!
sbt's unmanagedSource looks like this:
https://github.com/sbt/sbt/blob/v1.5.5/main/src/main/scala/sbt/Defaults.scala#L590-L603
unmanagedSources / fileInputs := {
val include = (unmanagedSources / includeFilter).value
val filter = (unmanagedSources / excludeFilter).value match {
// Hidden files are already filtered out by the FileStamps method
case NothingFilter | HiddenFileFilter => include
case exclude => include -- exclude
}
val baseSources =
if (sourcesInBase.value) Globs(baseDirectory.value.toPath, recursive = false, filter) :: Nil
else Nil
unmanagedSourceDirectories.value
.map(d => Globs(d.toPath, recursive = true, filter)) ++ baseSources
},
unmanagedSources := (unmanagedSources / inputFileStamps).value.map(_._1.toFile),
This allows include and exclude filtering, and and it automatically registers the inputs to watch ~.
Here's my PR for this - https://github.com/sbt/sbt-protobuf/pull/175