Global .sbt files for settings #52

Closed
n8han opened this Issue Jun 12, 2011 · 5 comments

Comments

Projects
None yet
4 participants

n8han commented Jun 12, 2011

For global plugins it would be nice to have global, user-defined settings. For example, the posterous-sbt plugin has settings posterousEmail and posterousPassword that the user must define somewhere before sbt can boot with the plugin on the classpath.

Currently, the recommendation is for users to have a file ~/.sbt/plugins/user.scala that defines the settings manually:

import sbt._
import posterous.Publish._

object User extends Plugin {
  override def settings = Seq(
    posterousEmail := "you@example.com",
    posterousPassword := "yourpassword"
  )
}

Alternatively, you could define these in a user.sbt within every project:

posterousEmail := "you@example.com",
posterousPassword := "yourpassword"

It would be great if we could place a file like this in ~/.sbt/ or some other location and have it be loaded for every project.

+1 on this. The CloudBees deployment plugin also needs something similar in terms of having that global configuration values which you wouldn't want to commit to the main build.sbt

Owner

harrah commented Jun 12, 2011

Note that the need for this is not to keep things out of /build.sbt. You can easily create a /local.sbt that you don't check into version control. It is so that you only have to define the settings once.

Thanks for the clarification Mark, my wording was just poorly chosen there. The use case I have is identical to Nathans. Cheers

@harrah harrah closed this in 9737a30 Jul 9, 2011

Member

MasseGuillaume commented Dec 15, 2012

@harrah what if you accidentally add and push local.sbt ?

Owner

harrah commented Dec 16, 2012

@MasseGuillaume You can add it to .gitignore or use other version control hooks/techniques to avoid that. Note that this feature got implemented and it can be used to specify credentials or other user-global information as requested.

dwijnand added a commit to dwijnand/sbt that referenced this issue Jun 26, 2017

Merge pull request #52 from dwijnand/eval
Really expose Eval. Fixes error in #50

dwijnand added a commit to dwijnand/sbt that referenced this issue Jun 30, 2017

Merge pull request #52 from dwijnand/eval
Really expose Eval. Fixes error in #50

dwijnand added a commit to dwijnand/sbt that referenced this issue Jul 7, 2017

Merge pull request #52 from dwijnand/eval
Really expose Eval. Fixes error in #50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment