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(
|
val startRes = Resolution(
|
||||||
dependencies.toSet,
|
dependencies.toSet,
|
||||||
forceVersions = forceVersions,
|
forceVersions = forceVersions,
|
||||||
filter = Some(dep => keepOptional || !dep.optional)
|
filter = Some(dep => keepOptional || !dep.optional),
|
||||||
|
profileActivation = Some(core.Resolution.userProfileActivation(userEnabledProfiles))
|
||||||
)
|
)
|
||||||
|
|
||||||
val loggerFallbackMode =
|
val loggerFallbackMode =
|
||||||
|
|
|
||||||
|
|
@ -74,6 +74,10 @@ case class CommonOptions(
|
||||||
@Help("Print dependencies as an inversed tree (dependees as children)")
|
@Help("Print dependencies as an inversed tree (dependees as children)")
|
||||||
@Short("T")
|
@Short("T")
|
||||||
reverseTree: Boolean,
|
reverseTree: Boolean,
|
||||||
|
@Help("Enable profile")
|
||||||
|
@Value("profile")
|
||||||
|
@Short("F")
|
||||||
|
profile: List[String],
|
||||||
@Recurse
|
@Recurse
|
||||||
cacheOptions: CacheOptions
|
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.
|
* Default dependency filter used during resolution.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue