build: make sure ignore files are searched for in base directory
Previously, the paths were just relative paths and depended on the working directory of the sbt process. However, that's unreliable when the akka sources are included in another build as in the akka-http nightlies.
This commit is contained in:
parent
75cb436ce7
commit
f44b777e76
3 changed files with 35 additions and 33 deletions
|
|
@ -6,15 +6,14 @@ import akka.ProjectFileIgnoreSupport
|
|||
import com.lightbend.sbt.JavaFormatterPlugin
|
||||
import sbt.{AutoPlugin, PluginTrigger, Plugins}
|
||||
|
||||
object JavaFormatter extends AutoPlugin with ProjectFileIgnoreSupport {
|
||||
object JavaFormatter extends AutoPlugin {
|
||||
|
||||
override def trigger = PluginTrigger.AllRequirements
|
||||
|
||||
override def requires: Plugins = JavaFormatterPlugin
|
||||
|
||||
final override protected val ignoreConfigFileName: String = ".sbt-java-formatter.conf"
|
||||
|
||||
final override protected val descriptor: String = "sbt-java-formatter"
|
||||
private val ignoreConfigFileName: String = ".sbt-java-formatter.conf"
|
||||
private val descriptor: String = "sbt-java-formatter"
|
||||
|
||||
import JavaFormatterPlugin.autoImport._
|
||||
import sbt.Keys._
|
||||
|
|
@ -24,7 +23,8 @@ object JavaFormatter extends AutoPlugin with ProjectFileIgnoreSupport {
|
|||
override def projectSettings: Seq[Def.Setting[_]] = Seq(
|
||||
//below is for sbt java formatter
|
||||
(excludeFilter in format) := {
|
||||
val simpleFileFilter = new SimpleFileFilter(file => isIgnoredByFileOrPackages(file))
|
||||
val ignoreSupport = new ProjectFileIgnoreSupport((baseDirectory in ThisBuild).value / ignoreConfigFileName, descriptor)
|
||||
val simpleFileFilter = new SimpleFileFilter(file => ignoreSupport.isIgnoredByFileOrPackages(file))
|
||||
simpleFileFilter || (excludeFilter in format).value
|
||||
}
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue