mirror of https://github.com/sbt/sbt.git
Allow to specify Maven profiles via the CLI app
This commit is contained in:
parent
f4dc1044e3
commit
efb4f6c5c0
|
|
@ -273,11 +273,13 @@ class Helper(
|
|||
}
|
||||
}
|
||||
|
||||
val userEnabledProfiles = profile.toSet
|
||||
|
||||
val startRes = Resolution(
|
||||
dependencies.toSet,
|
||||
forceVersions = forceVersions,
|
||||
filter = Some(dep => keepOptional || !dep.optional)
|
||||
filter = Some(dep => keepOptional || !dep.optional),
|
||||
profileActivation = Some(core.Resolution.userProfileActivation(userEnabledProfiles))
|
||||
)
|
||||
|
||||
val loggerFallbackMode =
|
||||
|
|
|
|||
|
|
@ -74,6 +74,10 @@ case class CommonOptions(
|
|||
@Help("Print dependencies as an inversed tree (dependees as children)")
|
||||
@Short("T")
|
||||
reverseTree: Boolean,
|
||||
@Help("Enable profile")
|
||||
@Value("profile")
|
||||
@Short("F")
|
||||
profile: List[String],
|
||||
@Recurse
|
||||
cacheOptions: CacheOptions
|
||||
) {
|
||||
|
|
|
|||
|
|
@ -453,6 +453,14 @@ object Resolution {
|
|||
}
|
||||
}
|
||||
|
||||
def userProfileActivation(userProfiles: Set[String])(
|
||||
id: String,
|
||||
activation: Activation,
|
||||
props: Map[String, String]
|
||||
): Boolean =
|
||||
userProfiles(id) ||
|
||||
defaultProfileActivation(id, activation, props)
|
||||
|
||||
/**
|
||||
* Default dependency filter used during resolution.
|
||||
*
|
||||
|
|
|
|||
Loading…
Reference in New Issue