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
|
whitesourceCheckPolicies
|
||||||
test
|
test
|
||||||
scriptedIvy
|
scriptedIvy
|
||||||
|
scriptedCoursier
|
||||||
packagedArtifacts # ensure that all artifacts for publish package without failure
|
packagedArtifacts # ensure that all artifacts for publish package without failure
|
||||||
|
|
||||||
env:
|
env:
|
||||||
|
|
|
||||||
|
|
@ -17,10 +17,10 @@ case class CoursierModuleDescriptor(
|
||||||
|
|
||||||
case class CoursierModuleSettings() extends ModuleSettings
|
case class CoursierModuleSettings() extends ModuleSettings
|
||||||
|
|
||||||
private[sbt] class CoursierDependencyResolution(resolvers: Seq[Resolver])
|
private[sbt] class CoursierDependencyResolution(resolvers: Vector[Resolver])
|
||||||
extends DependencyResolutionInterface {
|
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.
|
* 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.
|
* 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 dependencies = module.directDependencies.map(toCoursierDependency).toSet
|
||||||
val start = Resolution(dependencies)
|
val start = Resolution(dependencies)
|
||||||
val authentication = None // TODO: get correct value
|
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 =
|
val repositories =
|
||||||
reorderedResolvers.flatMap(r => FromSbt.repository(r, ivyConfiguration, log, authentication)) ++ Seq(
|
reorderedResolvers.flatMap(r => FromSbt.repository(r, ivyConfiguration, log, authentication)) ++ Seq(
|
||||||
Cache.ivy2Local,
|
Cache.ivy2Local,
|
||||||
|
|
@ -239,6 +254,6 @@ private[sbt] class CoursierDependencyResolution(resolvers: Seq[Resolver])
|
||||||
}
|
}
|
||||||
|
|
||||||
object CoursierDependencyResolution {
|
object CoursierDependencyResolution {
|
||||||
def apply(resolvers: Seq[Resolver]) =
|
def apply(resolvers: Vector[Resolver]) =
|
||||||
DependencyResolution(new CoursierDependencyResolution(resolvers))
|
DependencyResolution(new CoursierDependencyResolution(resolvers))
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -47,4 +47,5 @@ object Resolvers {
|
||||||
|
|
||||||
reordered
|
reordered
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -85,15 +85,17 @@ object SbtScriptedIT extends AutoPlugin {
|
||||||
scriptedTests := {
|
scriptedTests := {
|
||||||
val targetDir = target.value / "sbt"
|
val targetDir = target.value / "sbt"
|
||||||
|
|
||||||
cloneSbt(targetDir, scriptedTestSbtRepo.value, scriptedTestSbtRef.value)
|
if (!targetDir.exists) {
|
||||||
|
cloneSbt(targetDir, scriptedTestSbtRepo.value, scriptedTestSbtRef.value)
|
||||||
|
|
||||||
publishLocalSbt(
|
publishLocalSbt(
|
||||||
targetDir,
|
targetDir,
|
||||||
version.value,
|
version.value,
|
||||||
organization.value,
|
organization.value,
|
||||||
s"librarymanagement-${scriptedTestLMImpl.value}",
|
s"librarymanagement-${scriptedTestLMImpl.value}",
|
||||||
scriptedSbtVersion.value
|
scriptedSbtVersion.value
|
||||||
)
|
)
|
||||||
|
}
|
||||||
|
|
||||||
setScriptedTestsSbtVersion(
|
setScriptedTestsSbtVersion(
|
||||||
sbtTestDirectory.value / thisProject.value.id,
|
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 {
|
sys.props.get("dependency.resolution") match {
|
||||||
case Some("ivy") =>
|
case Some("ivy") =>
|
||||||
dependencyResolution := sbt.librarymanagement.ivy.IvyDependencyResolution(ivyConfiguration.value)
|
addCommandAlias(
|
||||||
|
"setDependencyResolution",
|
||||||
|
"""set dependencyResolution := sbt.librarymanagement.ivy.IvyDependencyResolution(ivyConfiguration.value)"""
|
||||||
|
)
|
||||||
case Some("coursier") =>
|
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.
|
case _ => sys.error("""|The system property 'dependency.resolution' is not defined.
|
||||||
|Specify this property using the scriptedLaunchOpts -D.""".stripMargin)
|
|Specify this property using the scriptedLaunchOpts -D.""".stripMargin)
|
||||||
}
|
}
|
||||||
|
|
||||||
libraryDependencies ++= Seq(
|
libraryDependencies ++= Seq(
|
||||||
"com.typesafe" % "config" % "1.3.2",
|
"com.typesafe" % "config" % "1.3.3"
|
||||||
// "org.scala-lang" % "scala-compiler" % "2.12.7" % Compile
|
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
> sbtVersion
|
> sbtVersion
|
||||||
|
> setDependencyResolution
|
||||||
> clean
|
> clean
|
||||||
> compile
|
> 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