mirror of https://github.com/sbt/sbt.git
going on, everything but sbt-plugins looks working
This commit is contained in:
parent
21e2c5f904
commit
d18c37974a
|
|
@ -18,6 +18,7 @@ script: sbt -Dfile.encoding=UTF8 -J-XX:ReservedCodeCacheSize=256M
|
|||
whitesourceCheckPolicies
|
||||
test
|
||||
scriptedIvy
|
||||
scriptedCoursier
|
||||
packagedArtifacts # ensure that all artifacts for publish package without failure
|
||||
|
||||
env:
|
||||
|
|
|
|||
|
|
@ -17,10 +17,10 @@ case class CoursierModuleDescriptor(
|
|||
|
||||
case class CoursierModuleSettings() extends ModuleSettings
|
||||
|
||||
private[sbt] class CoursierDependencyResolution(resolvers: Seq[Resolver])
|
||||
private[sbt] class CoursierDependencyResolution(resolvers: Vector[Resolver])
|
||||
extends DependencyResolutionInterface {
|
||||
|
||||
private[coursier] val reorderedResolvers = Resolvers.reorder(resolvers)
|
||||
private[coursier] val reorderedResolvers = Resolvers.reorder(resolvers.toSeq)
|
||||
|
||||
/**
|
||||
* Builds a ModuleDescriptor that describes a subproject with dependencies.
|
||||
|
|
@ -38,6 +38,21 @@ private[sbt] class CoursierDependencyResolution(resolvers: Seq[Resolver])
|
|||
)
|
||||
}
|
||||
|
||||
val ivyHome = sys.props.getOrElse(
|
||||
"ivy.home",
|
||||
new File(sys.props("user.home")).toURI.getPath + ".ivy2"
|
||||
)
|
||||
|
||||
val sbtIvyHome = sys.props.getOrElse(
|
||||
"sbt.ivy.home",
|
||||
ivyHome
|
||||
)
|
||||
|
||||
val ivyProperties = Map(
|
||||
"ivy.home" -> ivyHome,
|
||||
"sbt.ivy.home" -> sbtIvyHome
|
||||
) ++ sys.props
|
||||
|
||||
/**
|
||||
* Resolves the given module's dependencies performing a retrieval.
|
||||
*
|
||||
|
|
@ -61,7 +76,7 @@ private[sbt] class CoursierDependencyResolution(resolvers: Seq[Resolver])
|
|||
val dependencies = module.directDependencies.map(toCoursierDependency).toSet
|
||||
val start = Resolution(dependencies)
|
||||
val authentication = None // TODO: get correct value
|
||||
val ivyConfiguration = Map("ivy.home" -> "~/.ivy2/") // TODO: get correct value
|
||||
val ivyConfiguration = ivyProperties // TODO: is it enough?
|
||||
val repositories =
|
||||
reorderedResolvers.flatMap(r => FromSbt.repository(r, ivyConfiguration, log, authentication)) ++ Seq(
|
||||
Cache.ivy2Local,
|
||||
|
|
@ -239,6 +254,6 @@ private[sbt] class CoursierDependencyResolution(resolvers: Seq[Resolver])
|
|||
}
|
||||
|
||||
object CoursierDependencyResolution {
|
||||
def apply(resolvers: Seq[Resolver]) =
|
||||
def apply(resolvers: Vector[Resolver]) =
|
||||
DependencyResolution(new CoursierDependencyResolution(resolvers))
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,4 +47,5 @@ object Resolvers {
|
|||
|
||||
reordered
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -85,15 +85,17 @@ object SbtScriptedIT extends AutoPlugin {
|
|||
scriptedTests := {
|
||||
val targetDir = target.value / "sbt"
|
||||
|
||||
cloneSbt(targetDir, scriptedTestSbtRepo.value, scriptedTestSbtRef.value)
|
||||
if (!targetDir.exists) {
|
||||
cloneSbt(targetDir, scriptedTestSbtRepo.value, scriptedTestSbtRef.value)
|
||||
|
||||
publishLocalSbt(
|
||||
targetDir,
|
||||
version.value,
|
||||
organization.value,
|
||||
s"librarymanagement-${scriptedTestLMImpl.value}",
|
||||
scriptedSbtVersion.value
|
||||
)
|
||||
publishLocalSbt(
|
||||
targetDir,
|
||||
version.value,
|
||||
organization.value,
|
||||
s"librarymanagement-${scriptedTestLMImpl.value}",
|
||||
scriptedSbtVersion.value
|
||||
)
|
||||
}
|
||||
|
||||
setScriptedTestsSbtVersion(
|
||||
sbtTestDirectory.value / thisProject.value.id,
|
||||
|
|
|
|||
|
|
@ -0,0 +1,6 @@
|
|||
|
||||
object Main {
|
||||
|
||||
println("hello, world!")
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
|
||||
{
|
||||
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
|
||||
)
|
||||
}
|
||||
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)"""
|
||||
)
|
||||
case Some("coursier") =>
|
||||
writePluginsSbt("""dependencyResolution := sbt.librarymanagement.coursier.CoursierDependencyResolution(Resolver.combineDefaultResolvers(resolvers.value.toVector))""")
|
||||
addCommandAlias(
|
||||
"setDependencyResolution",
|
||||
"""set dependencyResolution := sbt.librarymanagement.coursier.CoursierDependencyResolution(Resolver.combineDefaultResolvers(resolvers.value.toVector))"""
|
||||
)
|
||||
case _ => sys.error("""|The system property 'dependency.resolution' is not defined.
|
||||
|Specify this property using the scriptedLaunchOpts -D.""".stripMargin)
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
dependencyResolution := sbt.librarymanagement.coursier.CoursierDependencyResolution(Resolver.combineDefaultResolvers(resolvers.value.toVector))
|
||||
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.8")
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
> reload
|
||||
> sbtVersion
|
||||
> setDependencyResolution
|
||||
> clean
|
||||
> compile
|
||||
> assembly
|
||||
|
|
@ -1,14 +1,19 @@
|
|||
|
||||
sys.props.get("dependency.resolution") match {
|
||||
case Some("ivy") =>
|
||||
dependencyResolution := sbt.librarymanagement.ivy.IvyDependencyResolution(ivyConfiguration.value)
|
||||
addCommandAlias(
|
||||
"setDependencyResolution",
|
||||
"""set dependencyResolution := sbt.librarymanagement.ivy.IvyDependencyResolution(ivyConfiguration.value)"""
|
||||
)
|
||||
case Some("coursier") =>
|
||||
dependencyResolution := sbt.librarymanagement.coursier.CoursierDependencyResolution(resolvers.value)
|
||||
addCommandAlias(
|
||||
"setDependencyResolution",
|
||||
"""set dependencyResolution := sbt.librarymanagement.coursier.CoursierDependencyResolution(Resolver.combineDefaultResolvers(resolvers.value.toVector))"""
|
||||
)
|
||||
case _ => sys.error("""|The system property 'dependency.resolution' is not defined.
|
||||
|Specify this property using the scriptedLaunchOpts -D.""".stripMargin)
|
||||
}
|
||||
|
||||
libraryDependencies ++= Seq(
|
||||
"com.typesafe" % "config" % "1.3.2",
|
||||
// "org.scala-lang" % "scala-compiler" % "2.12.7" % Compile
|
||||
"com.typesafe" % "config" % "1.3.3"
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
> sbtVersion
|
||||
> setDependencyResolution
|
||||
> clean
|
||||
> compile
|
||||
|
|
|
|||
|
|
@ -0,0 +1,14 @@
|
|||
|
||||
object Main {
|
||||
|
||||
import akka.actor._
|
||||
|
||||
val system = ActorSystem()
|
||||
|
||||
system.terminate()
|
||||
|
||||
import com.typesafe.config.ConfigFactory
|
||||
|
||||
val x = ConfigFactory.load()
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
|
||||
sys.props.get("dependency.resolution") match {
|
||||
case Some("ivy") =>
|
||||
addCommandAlias(
|
||||
"setDependencyResolution",
|
||||
"""set dependencyResolution := sbt.librarymanagement.ivy.IvyDependencyResolution(ivyConfiguration.value)"""
|
||||
)
|
||||
case Some("coursier") =>
|
||||
addCommandAlias(
|
||||
"setDependencyResolution",
|
||||
"""set dependencyResolution := sbt.librarymanagement.coursier.CoursierDependencyResolution(Resolver.combineDefaultResolvers(resolvers.value.toVector))"""
|
||||
)
|
||||
case _ => sys.error("""|The system property 'dependency.resolution' is not defined.
|
||||
|Specify this property using the scriptedLaunchOpts -D.""".stripMargin)
|
||||
}
|
||||
|
||||
libraryDependencies ++= Seq(
|
||||
"com.typesafe.akka" %% "akka-actor" % "2.5.17"
|
||||
)
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
> sbtVersion
|
||||
> setDependencyResolution
|
||||
> clean
|
||||
> compile
|
||||
Loading…
Reference in New Issue