mirror of
https://github.com/nix-community/home-manager
synced 2025-01-30 21:05:02 +01:00
sbt: Scoping credentials to ThisBuild
In Sbt (prior to 2.0) a sbt key not scoped to `ThisBuild` will always be at the project level, rather than at the build level. In order to do some things, like use a private repository configured by sbt with sbt-scalafix, we need the credentials scope to the build, otherwise the credentials show as non-existent.
This commit is contained in:
parent
e83414058e
commit
df4c36c082
2 changed files with 3 additions and 3 deletions
|
@ -12,7 +12,7 @@ let
|
||||||
let symbol = "credential_${toString idx}";
|
let symbol = "credential_${toString idx}";
|
||||||
in ''
|
in ''
|
||||||
lazy val ${symbol} = "${cred.passwordCommand}".!!.trim
|
lazy val ${symbol} = "${cred.passwordCommand}".!!.trim
|
||||||
credentials += Credentials("${cred.realm}", "${cred.host}", "${cred.user}", ${symbol})
|
ThisBuild / credentials += Credentials("${cred.realm}", "${cred.host}", "${cred.user}", ${symbol})
|
||||||
'';
|
'';
|
||||||
|
|
||||||
renderCredentials = creds: ''
|
renderCredentials = creds: ''
|
||||||
|
|
|
@ -20,9 +20,9 @@ let
|
||||||
expectedCredentialsSbt = pkgs.writeText "credentials.sbt" ''
|
expectedCredentialsSbt = pkgs.writeText "credentials.sbt" ''
|
||||||
import scala.sys.process._
|
import scala.sys.process._
|
||||||
lazy val credential_0 = "echo password".!!.trim
|
lazy val credential_0 = "echo password".!!.trim
|
||||||
credentials += Credentials("Sonatype Nexus Repository Manager", "example.com", "user", credential_0)
|
ThisBuild / credentials += Credentials("Sonatype Nexus Repository Manager", "example.com", "user", credential_0)
|
||||||
lazy val credential_1 = "echo password1".!!.trim
|
lazy val credential_1 = "echo password1".!!.trim
|
||||||
credentials += Credentials("Sonatype Nexus Repository Manager X", "v2.example.com", "user1", credential_1)
|
ThisBuild / credentials += Credentials("Sonatype Nexus Repository Manager X", "v2.example.com", "user1", credential_1)
|
||||||
'';
|
'';
|
||||||
credentialsSbtPath = ".sbt/1.0/credentials.sbt";
|
credentialsSbtPath = ".sbt/1.0/credentials.sbt";
|
||||||
in {
|
in {
|
||||||
|
|
Loading…
Add table
Reference in a new issue