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

Runner settings not scoped #16

Open
steinybot opened this issue May 11, 2021 · 0 comments · May be fixed by #17
Open

Runner settings not scoped #16

steinybot opened this issue May 11, 2021 · 0 comments · May be fixed by #17

Comments

@steinybot
Copy link

steinybot commented May 11, 2021

When using the Kanela runner it behaves a bit differently to other runners as the settings are not scoped correctly. The settings it uses such as baseDirectory should be scoped to Compile/run.

For example, if I set:

run / baseDirectory := "foo"

Then the Kanela runner will not use this and instead it will use baseDirectory which by default is the project base directory.

The settings used in kanelaRunnerTask are mostly raw which is good it's just where they are used in projectSettings is where the scoping problem is.

See how sbt does it:

https://github.com/sbt/sbt/blob/ce59ea754a12709a978ac1f54306a81c6c6d68d7/main/src/main/scala/sbt/Defaults.scala#L2582

inConfig(Compile)(compileSettings)

https://github.com/sbt/sbt/blob/ce59ea754a12709a978ac1f54306a81c6c6d68d7/main/src/main/scala/sbt/Defaults.scala#L994

inTask(run)(runnerSettings ++ newRunnerSettings)

The workaround is fairly straight forward:

inConfig(Compile) {
  inTask(run) {
    runner := SbtKanelaRunner.kanelaRunnerTask.value
  }
}
@steinybot steinybot linked a pull request May 11, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant