Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Global .sbt files for settings #52

Closed
n8han opened this Issue · 5 comments

4 participants

@n8han

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.

@timperrett

+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

@harrah
Owner

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.

@timperrett

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
@MasseGuillaume

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

@harrah
Owner

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.