Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set mode in every scope #143

Merged
merged 1 commit into from
Mar 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -110,15 +110,15 @@ object TpolecatPlugin extends AutoPlugin {
val commandAliases =
addCommandAlias(
"tpolecatDevMode",
"set ThisBuild / tpolecatOptionsMode := _root_.io.github.davidgregory084.DevMode"
"set every tpolecatOptionsMode := _root_.io.github.davidgregory084.DevMode"
) ++
addCommandAlias(
"tpolecatCiMode",
"set ThisBuild / tpolecatOptionsMode := _root_.io.github.davidgregory084.CiMode"
"set every tpolecatOptionsMode := _root_.io.github.davidgregory084.CiMode"
) ++
addCommandAlias(
"tpolecatReleaseMode",
"set ThisBuild / tpolecatOptionsMode := _root_.io.github.davidgregory084.ReleaseMode"
"set every tpolecatOptionsMode := _root_.io.github.davidgregory084.ReleaseMode"
)

override def buildSettings: Seq[Setting[_]] = Seq(
Expand Down
13 changes: 13 additions & 0 deletions plugin/src/sbt-test/sbt-tpolecat/modeCommand/build.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import _root_.io.github.davidgregory084._

lazy val subProject = project
.settings(tpolecatOptionsMode := CiMode)

lazy val subProjectWithConfig = project
.settings(Test / tpolecatOptionsMode := CiMode)

TaskKey[Unit]("check") := {
assert(tpolecatOptionsMode.value == DevMode)
assert((subProject / tpolecatOptionsMode).value == DevMode)
assert((subProjectWithConfig / Test / tpolecatOptionsMode).value == DevMode)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sbt.version=1.7.1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
addSbtPlugin("io.github.davidgregory084" % "sbt-tpolecat" % System.getProperty("plugin.version"))
3 changes: 3 additions & 0 deletions plugin/src/sbt-test/sbt-tpolecat/modeCommand/test
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Check that the mode is applied everywhere.
> tpolecatDevMode
> +check