An sbt plugin that provides various functionality for advanced cleanup of scala projects
This sbt plugin is available for sbt 1.x
To use the latest version of plugins, include the following in your project/plugins.sbt
:
addSbtPlugin("io.kinoplan" % "sbt-clean" % ${version})
where you need to replace ${version}
with the version you want to use.
- CleanAllPlugin:
- 🚀 cleanAll: Task that executes clean all projects in a build
- CleanTriggerPlugin:
- 🚀 triggeredClean: Task that executes the clean task based on whether the sources is changed
- ⚙️ cleanTriggerSources (Default: Nil): Sources used to determine whether clean should be run
Start by enabling the plugin in your build.sbt
file or for specific projects:
enablePlugins(CleanAllPlugin)
after that, to start clearing all projects, run the command in sbt shell:
cleanAll
Start by enabling the plugin for specific project:
enablePlugins(CleanTriggerPlugin)
then configure the sources whose changes will trigger the command to clean the /target
folder and compile
the project, for example:
lazy val shared = project
.in(file("shared"))
.settings(
...
)
lazy val server = project
.in(file("server"))
.enablePlugins(CleanTriggerPlugin)
.settings(
cleanTriggerSources := Seq(
(ThisBuild / baseDirectory).value / "shared" / "src" / "main" / "scala" / "api" / "internal",
(ThisBuild / baseDirectory).value / "shared" / "src" / "main" / "scala" / "api" / "external" / "FooApi.scala"
)
)
See CONTRIBUTING.md for more details about how to contribute.
This project is licensed under the terms of the Apache License, Version 2.0.