Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@ final case class ResolutionOptions(

@Group(OptionGroup.resolution)
@Hidden
@HelpMessage("Default configuration (default(compile) by default)")
@HelpMessage("Default configuration (default(runtime) by default)")
@ValueDescription("configuration")
@ExtraName("c")
defaultConfiguration: String = "default(compile)",
defaultConfiguration: String = "default(runtime)",

@Group(OptionGroup.resolution)
@Hidden
Expand Down
4 changes: 2 additions & 2 deletions modules/cli/src/test/scala/coursier/cli/ResolveTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ object ResolveTests extends TestSuite {
| not found: https://repo1.maven.org/maven2/ioi/get-coursier/coursier-core_2.12/1.1.0-M9/coursier-core_2.12-1.1.0-M9.pom
|io.get-coursier:coursier-cache_2.12:1.1.0-M9:default
|io.get-coursier:coursier-core_2.12:1.1.0-M9:default
|ioi.get-coursier:coursier-core_2.12:1.1.0-M9:default(compile)
|ioi.get-coursier:coursier-core_2.12:1.1.0-M9:default(runtime)
|org.scala-lang:scala-library:2.12.7:default
|org.scala-lang.modules:scala-xml_2.12:1.1.0:default
|""".stripMargin
Expand Down Expand Up @@ -251,7 +251,7 @@ object ResolveTests extends TestSuite {
|com.squareup.okio:okio:1.12.0:default
|com.typesafe:config:1.2.0:default
|com.typesafe:ssl-config-core_2.12:0.2.2:default
|com.typesafe.sbt:sbt-native-packager;sbtVersion=1.0;scalaVersion=2.12:1.3.3:compile
|com.typesafe.sbt:sbt-native-packager;sbtVersion=1.0;scalaVersion=2.12:1.3.3:runtime
|commons-codec:commons-codec:1.9:default
|commons-io:commons-io:2.5:default
|commons-lang:commons-lang:2.6:default
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ object Configuration {

val default = Configuration("default")
val defaultCompile = Configuration("default(compile)")
val defaultRuntime = Configuration("default(runtime)")

val provided = Configuration("provided")
val `import` = Configuration("import")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -439,8 +439,10 @@ object Resolution {
forceDepMgmtVersions,
keepConfiguration = config =>
config == Configuration.compile ||
config == Configuration.runtime ||
config == Configuration.default ||
config == Configuration.defaultCompile
config == Configuration.defaultCompile ||
config == Configuration.defaultRuntime
)

@deprecated(
Expand Down Expand Up @@ -823,7 +825,7 @@ object Resolution {
mapDependencies: Option[Dependency => Dependency] = None,
extraProperties: Seq[(String, String)] = Nil,
forceProperties: Map[String, String] = Map.empty, // FIXME Make that a seq too?
defaultConfiguration: Configuration = Configuration.defaultCompile,
defaultConfiguration: Configuration = Configuration.defaultRuntime,
@since("2.1.9")
keepProvidedDependencies: Boolean = false,
@since("2.1.17")
Expand Down
4 changes: 2 additions & 2 deletions modules/core/shared/src/main/scala/coursier/ivy/IvyXml.scala
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ object IvyXml {
)
}

// FIXME "default(compile)" likely not to be always the default
// FIXME "default(runtime)" likely not to be always the default
def mappings(mapping: String): Seq[(Configuration, Configuration)] =
mapping.split(';').toSeq.flatMap { m =>
val (froms, tos) = m.split("->", 2) match {
case Array(from) => (from, Configuration.defaultCompile.value)
case Array(from) => (from, Configuration.defaultRuntime.value)
case Array(from, to) => (from, to)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import dataclass.data
jdkVersionOpt: Option[Version] = None,
useSystemOsInfo: Boolean = true,
useSystemJdkVersion: Boolean = true,
defaultConfiguration: Configuration = Configuration.defaultCompile,
defaultConfiguration: Configuration = Configuration.defaultRuntime,
@since("2.0.17")
overrideFullSuffixOpt: Option[Boolean] = None,
@since("2.1.9")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ object ResolveTests extends TestSuite {
resolve
.addDependencies(
dep"com.netflix.karyon:karyon-eureka:1.0.28"
.withConfiguration(Configuration.defaultCompile)
.withConfiguration(Configuration.defaultRuntime)
)
.future()
}
Expand Down Expand Up @@ -939,7 +939,7 @@ object ResolveTests extends TestSuite {
test("runtime dependencies") {
async {

// default configuration "default(compile)" should fetch runtime JARs too ("default" scope pulls the runtime one)
// default configuration "default(runtime)" should fetch runtime JARs too

val res: coursier.core.Resolution = await {
resolve
Expand Down Expand Up @@ -1613,7 +1613,7 @@ object ResolveTests extends TestSuite {
check(
dep"org.scalatestplus.play:scalatestplus-play_2.13:7.0.1".addBom(
dep"org.apache.spark:spark-parent_2.13:3.5.3"
.withConfiguration(Configuration.defaultCompile)
.withConfiguration(Configuration.defaultRuntime)
.asBomDependency
)
)
Expand Down Expand Up @@ -1716,7 +1716,7 @@ object ResolveTests extends TestSuite {
check(
dep"com.google.protobuf:protobuf-java-util:3.7.1".addBom(
dep"org.apache.spark:spark-parent_2.13:3.5.3"
.withConfiguration(Configuration.defaultCompile)
.withConfiguration(Configuration.defaultRuntime)
.asBomDependency
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ object TestHelpers extends PlatformTestHelpers {
import coursier.core.Configuration
// hack not to have to edit / review lots of test fixtures
val params0 =
if (params.defaultConfiguration == Configuration.defaultCompile)
if (params.defaultConfiguration == Configuration.defaultRuntime)
params.withDefaultConfiguration(Configuration.compile)
else if (params.defaultConfiguration == Configuration.compile)
params.withDefaultConfiguration(Configuration("really-compile"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ object RawAppDescriptor {
private def parseDependenices(dependencies: Seq[String])
: ValidatedNel[String, Seq[JavaOrScalaDependency]] =
validationNelToCats(
DependencyParser.javaOrScalaDependencies(dependencies, Configuration.defaultCompile)
DependencyParser.javaOrScalaDependencies(dependencies, Configuration.defaultRuntime)
)

private def parseRepositories(repositories: Seq[String]): ValidatedNel[String, Seq[Repository]] =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ object IvyTests extends TestSuite {
),
version = "0.6.6",
extraRepos = Seq(sbtRepo),
configuration = Configuration.defaultCompile
configuration = Configuration.defaultRuntime
)
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
com.github.ddispaltro:sbt-reactjs;sbtVersion=0.13;scalaVersion=2.10:0.6.8:compile
com.github.ddispaltro:sbt-reactjs;sbtVersion=0.13;scalaVersion=2.10:0.6.8:runtime
org.webjars:react:0.14.8:default
org.webjars.npm:react-tools:0.13.3:default
org.webjars:jstransform:10.1.0:default
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
io.get-coursier.test:sbt-coursier-exclude-dependencies-2_2.12:0.1.0-SNAPSHOT:compile
io.get-coursier.test:sbt-coursier-exclude-dependencies-2_2.12:0.1.0-SNAPSHOT:runtime
org.scala-lang:scala-library:2.12.8:default
com.github.alexarchambault:argonaut-shapeless_6.2_2.12:1.2.0-M11:default
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
io.get-coursier.test:sbt-coursier-override-dependencies-2_2.12:0.1.0-SNAPSHOT:compile
io.get-coursier.test:sbt-coursier-override-dependencies-2_2.12:0.1.0-SNAPSHOT:runtime
org.scala-lang:scala-library:2.12.15:default
com.github.alexarchambault:argonaut-shapeless_6.2_2.12:1.2.0-M11:default
io.argonaut:argonaut_2.12:6.2.2:default
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
io.get-coursier:coursier-core_2.12:0.1.2-publish-local:compile
io.get-coursier:coursier-core_2.12:0.1.2-publish-local:runtime
io.get-coursier:coursier-util_2.12:0.1.2-publish-local:compile
org.scala-lang:scala-library:2.12.10:default
org.scala-lang.modules:scala-xml_2.12:1.2.0:default
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
org.scala-js:sbt-scalajs;sbtVersion=0.13;scalaVersion=2.10:0.6.6:compile
org.scala-js:sbt-scalajs;sbtVersion=0.13;scalaVersion=2.10:0.6.6:runtime
org.scala-js:scalajs-tools_2.10:0.6.6:default
org.scala-js:scalajs-js-envs_2.10:0.6.6:default
org.scala-js:scalajs-sbt-test-adapter_2.10:0.6.6:default
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ abstract class CentralTests extends TestSuite {
.withRootDependencies(Seq(dep))
.withDependencies(
Set(
dep.withCompileScope,
dep"ch.qos.logback:logback-core:1.1.3".withCompileScope,
dep"org.slf4j:slf4j-api:1.7.7".withCompileScope
dep.withDefaultScope,
dep"ch.qos.logback:logback-core:1.1.3".withDefaultScope,
dep"org.slf4j:slf4j-api:1.7.7".withDefaultScope
)
)

Expand All @@ -62,9 +62,9 @@ abstract class CentralTests extends TestSuite {
.withRootDependencies(Seq(dep))
.withDependencies(
Set(
dep.withCompileScope,
dep"org.ow2.asm:asm-tree:5.0.2".withCompileScope,
dep"org.ow2.asm:asm:5.0.2".withCompileScope
dep.withDefaultScope,
dep"org.ow2.asm:asm-tree:5.0.2".withDefaultScope,
dep"org.ow2.asm:asm:5.0.2".withDefaultScope
)
)

Expand All @@ -80,7 +80,7 @@ abstract class CentralTests extends TestSuite {

val expected = Resolution()
.withRootDependencies(Seq(dep))
.withDependencies(Set(dep.withCompileScope))
.withDependencies(Set(dep.withDefaultScope))

assert(res == expected)
assert(res0.projectCache.contains(dep.moduleVersion))
Expand Down
Loading
Loading