diff --git a/scripted-test/src/sbt-test/lmScriptedTest/sbt-plugins/build.sbt b/scripted-test/src/sbt-test/lmScriptedTest/sbt-plugins/build.sbt index 0a0172b37..7c0d20685 100644 --- a/scripted-test/src/sbt-test/lmScriptedTest/sbt-plugins/build.sbt +++ b/scripted-test/src/sbt-test/lmScriptedTest/sbt-plugins/build.sbt @@ -2,28 +2,26 @@ { def writePluginsSbt(str: String) = { val pluginsSbt = file(".") / "project" / "plugins.sbt" - if (!pluginsSbt.exists) - IO.write( - pluginsSbt, - s"""$str - |addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.8") - |""".stripMargin - ) + if (!pluginsSbt.exists) + IO.write( + pluginsSbt, + s"""$str + |addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.8") + |""".stripMargin + ) } - sys.props.get("dependency.resolution") match { + val dr = sys.props.get("dependency.resolution") match { case Some("ivy") => - writePluginsSbt("""dependencyResolution := sbt.librarymanagement.ivy.IvyDependencyResolution(ivyConfiguration.value)""") - addCommandAlias( - "setDependencyResolution", - """set dependencyResolution := sbt.librarymanagement.ivy.IvyDependencyResolution(ivyConfiguration.value)""" - ) + """dependencyResolution := sbt.librarymanagement.ivy.IvyDependencyResolution(ivyConfiguration.value)""" case Some("coursier") => - writePluginsSbt("""dependencyResolution := sbt.librarymanagement.coursier.CoursierDependencyResolution(sbt.librarymanagement.coursier.CoursierConfiguration())""") - addCommandAlias( - "setDependencyResolution", - """set dependencyResolution := sbt.librarymanagement.coursier.CoursierDependencyResolution(sbt.librarymanagement.coursier.CoursierConfiguration())""" - ) + """dependencyResolution := sbt.librarymanagement.coursier.CoursierDependencyResolution(sbt.librarymanagement.coursier.CoursierConfiguration())""" case _ => sys.error("""|The system property 'dependency.resolution' is not defined. |Specify this property using the scriptedLaunchOpts -D.""".stripMargin) } + + writePluginsSbt(dr) + addCommandAlias( + "setDependencyResolution", + s"""set $dr""" + ) } diff --git a/scripted-test/src/sbt-test/lmScriptedTest/sbt-plugins/test b/scripted-test/src/sbt-test/lmScriptedTest/sbt-plugins/test index 2e53ac9dc..15ad081ac 100755 --- a/scripted-test/src/sbt-test/lmScriptedTest/sbt-plugins/test +++ b/scripted-test/src/sbt-test/lmScriptedTest/sbt-plugins/test @@ -1,6 +1,2 @@ > reload -> sbtVersion -> setDependencyResolution -> clean -> compile > assembly diff --git a/scripted-test/src/sbt-test/lmScriptedTest/simple/test b/scripted-test/src/sbt-test/lmScriptedTest/simple/test index b801e7add..5df2af1f3 100755 --- a/scripted-test/src/sbt-test/lmScriptedTest/simple/test +++ b/scripted-test/src/sbt-test/lmScriptedTest/simple/test @@ -1,4 +1 @@ -> sbtVersion -> setDependencyResolution -> clean > compile diff --git a/scripted-test/src/sbt-test/lmScriptedTest/with-trasnsitive/test b/scripted-test/src/sbt-test/lmScriptedTest/with-trasnsitive/test index b801e7add..5df2af1f3 100755 --- a/scripted-test/src/sbt-test/lmScriptedTest/with-trasnsitive/test +++ b/scripted-test/src/sbt-test/lmScriptedTest/with-trasnsitive/test @@ -1,4 +1 @@ -> sbtVersion -> setDependencyResolution -> clean > compile