2023-01-08 17:13:31 +08:00
|
|
|
/*
|
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
|
* license agreements; and to You under the Apache License, version 2.0:
|
|
|
|
|
*
|
|
|
|
|
* https://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
*
|
2023-06-22 14:19:26 +01:00
|
|
|
* This file is part of the Apache Pekko project, which was derived from Akka.
|
2023-01-08 17:13:31 +08:00
|
|
|
*/
|
|
|
|
|
|
2018-12-05 16:30:21 +08:00
|
|
|
/*
|
2022-02-04 12:36:44 +01:00
|
|
|
* Copyright (C) 2018-2022 Lightbend Inc. <https://www.lightbend.com>
|
2018-12-05 16:30:21 +08:00
|
|
|
*/
|
|
|
|
|
|
2023-07-30 11:55:14 +02:00
|
|
|
import sbt.{ inConfig, AutoPlugin, Def, PluginTrigger, Plugins, Setting }
|
2020-12-09 15:20:13 +07:00
|
|
|
import scalafix.sbt.ScalafixPlugin
|
2018-12-05 16:30:21 +08:00
|
|
|
import scalafix.sbt.ScalafixPlugin.autoImport.scalafixConfigSettings
|
|
|
|
|
|
2018-12-09 05:13:11 +08:00
|
|
|
object ScalafixForMultiNodePlugin extends AutoPlugin with ScalafixSupport {
|
2018-12-05 16:30:21 +08:00
|
|
|
override def trigger: PluginTrigger = allRequirements
|
|
|
|
|
|
2020-12-09 15:20:13 +07:00
|
|
|
override def requires: Plugins = MultiNode && ScalafixPlugin
|
2018-12-09 05:13:11 +08:00
|
|
|
|
2018-12-05 16:30:21 +08:00
|
|
|
import MultiJvmPlugin.autoImport._
|
|
|
|
|
|
2021-02-01 15:38:29 +00:00
|
|
|
lazy val scalafixIgnoredSetting: Seq[Setting[_]] = Seq(ignore(MultiJvm))
|
2018-12-05 16:30:21 +08:00
|
|
|
|
|
|
|
|
override def projectSettings: Seq[Def.Setting[_]] =
|
2018-12-09 05:13:11 +08:00
|
|
|
Seq(MultiJvm).flatMap(c => inConfig(c)(scalafixConfigSettings(c))) ++
|
2021-02-01 15:38:29 +00:00
|
|
|
scalafixIgnoredSetting ++ Seq(
|
|
|
|
|
updateProjectCommands(alias = "fixall", value = ";scalafixEnable;scalafixAll;scalafmtAll"),
|
|
|
|
|
updateProjectCommands(alias = "sortImports", value = ";scalafixEnable;scalafixAll SortImports;scalafmtAll"))
|
2018-12-05 16:30:21 +08:00
|
|
|
}
|