Merge pull request #4605 from eed3si9n/wip/bumplm

bump to lm 1.3.0-M3
This commit is contained in:
eugene yokota 2019-04-23 13:52:08 -04:00 committed by GitHub
commit 4074cb32d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 80 additions and 59 deletions

View File

@ -30,7 +30,7 @@ import sbt.internal._
import sbt.internal.inc.JavaInterfaceUtil._ import sbt.internal.inc.JavaInterfaceUtil._
import sbt.internal.inc.ZincUtil import sbt.internal.inc.ZincUtil
import sbt.internal.io.{ Source, WatchState } import sbt.internal.io.{ Source, WatchState }
import sbt.internal.librarymanagement._ import sbt.internal.librarymanagement.{ CustomHttp => _, _ }
import sbt.internal.librarymanagement.mavenint.{ import sbt.internal.librarymanagement.mavenint.{
PomExtraDependencyAttributes, PomExtraDependencyAttributes,
SbtPomExtraProperties SbtPomExtraProperties
@ -217,6 +217,8 @@ object Defaults extends BuildCommon {
artifactClassifier :== None, artifactClassifier :== None,
checksums := Classpaths.bootChecksums(appConfiguration.value), checksums := Classpaths.bootChecksums(appConfiguration.value),
conflictManager := ConflictManager.default, conflictManager := ConflictManager.default,
CustomHttp.okhttpClientBuilder :== CustomHttp.defaultHttpClientBuilder,
CustomHttp.okhttpClient := CustomHttp.okhttpClientBuilder.value.build,
pomExtra :== NodeSeq.Empty, pomExtra :== NodeSeq.Empty,
pomPostProcess :== idFun, pomPostProcess :== idFun,
pomAllRepositories :== false, pomAllRepositories :== false,
@ -2179,8 +2181,11 @@ object Classpaths {
) )
else None else None
}, },
dependencyResolution := IvyDependencyResolution(ivyConfiguration.value), dependencyResolution := IvyDependencyResolution(
publisher := IvyPublisher(ivyConfiguration.value), ivyConfiguration.value,
CustomHttp.okhttpClient.value
),
publisher := IvyPublisher(ivyConfiguration.value, CustomHttp.okhttpClient.value),
ivyConfiguration := mkIvyConfiguration.value, ivyConfiguration := mkIvyConfiguration.value,
ivyConfigurations := { ivyConfigurations := {
val confs = thisProject.value.configurations val confs = thisProject.value.configurations
@ -2427,7 +2432,7 @@ object Classpaths {
private[sbt] def ivySbt0: Initialize[Task[IvySbt]] = private[sbt] def ivySbt0: Initialize[Task[IvySbt]] =
Def.task { Def.task {
Credentials.register(credentials.value, streams.value.log) Credentials.register(credentials.value, streams.value.log)
new IvySbt(ivyConfiguration.value) new IvySbt(ivyConfiguration.value, CustomHttp.okhttpClient.value)
} }
def moduleSettings0: Initialize[Task[ModuleSettings]] = Def.task { def moduleSettings0: Initialize[Task[ModuleSettings]] = Def.task {
ModuleDescriptorConfiguration(projectID.value, projectInfo.value) ModuleDescriptorConfiguration(projectID.value, projectInfo.value)
@ -2498,7 +2503,10 @@ object Classpaths {
).withScalaOrganization(scalaOrganization.value) ).withScalaOrganization(scalaOrganization.value)
) )
}, },
dependencyResolution := IvyDependencyResolution(ivyConfiguration.value), dependencyResolution := IvyDependencyResolution(
ivyConfiguration.value,
CustomHttp.okhttpClient.value
),
updateSbtClassifiers in TaskGlobal := (Def.task { updateSbtClassifiers in TaskGlobal := (Def.task {
val lm = dependencyResolution.value val lm = dependencyResolution.value
val s = streams.value val s = streams.value

View File

@ -0,0 +1,25 @@
/*
* sbt
* Copyright 2011 - 2018, Lightbend, Inc.
* Copyright 2008 - 2010, Mark Harrah
* Licensed under Apache License 2.0 (see LICENSE)
*/
package sbt.internal
import sbt.internal.librarymanagement.{ CustomHttp => LMCustomHttp }
import okhttp3._
import sbt.BuildSyntax._
import sbt.KeyRanks._
object CustomHttp {
val okhttpClientBuilder =
settingKey[OkHttpClient.Builder]("Builder for the HTTP client.").withRank(CSetting)
val okhttpClient =
settingKey[OkHttpClient]("HTTP client used for library management.").withRank(CSetting)
def defaultHttpClientBuilder: OkHttpClient.Builder = {
LMCustomHttp.defaultHttpClientBuilder
}
}

View File

@ -14,7 +14,7 @@ object Dependencies {
private val lmVersion = private val lmVersion =
sys.props.get("sbt.build.lm.version") match { sys.props.get("sbt.build.lm.version") match {
case Some(version) => version case Some(version) => version
case _ => "1.3.0-M2" case _ => "1.3.0-M3"
} }
private val zincVersion = "1.3.0-M3" private val zincVersion = "1.3.0-M3"

View File

@ -1,11 +0,0 @@
publishTo := Some(Resolver.file("test-publish", (baseDirectory in ThisBuild).value / "repo/"))
resolvers += ("test" at ((baseDirectory in ThisBuild).value / "repo/").asURL.toString)
resolvers += Resolver.mavenLocal
name := "demo1"
organization := "org.example"
version := "0.1"
sbtPlugin := true

View File

@ -1,13 +0,0 @@
publishTo := Some(Resolver.file("test-publish", (baseDirectory in ThisBuild).value / "repo"))
resolvers += ("test" at ((baseDirectory in ThisBuild).value / "repo").asURL.toString)
resolvers += Resolver.mavenLocal
name := "demo2"
organization := "org.example"
version := "0.2"
sbtPlugin := true
addSbtPlugin("org.example" % "demo1" % "0.1")

View File

@ -1,17 +1,44 @@
ThisBuild / organization := "org.example"
lazy val root = (project in file(".")) lazy val root = (project in file("."))
.settings(
lazy val a = proj(project in file("a")) commonSettings
lazy val b = proj(project in file("b")) )
lazy val c = proj(project in file("c"))
lazy val commonSettings = Seq(
def proj(p: Project): Project = ivyPaths := IvyPaths((baseDirectory in ThisBuild).value, Some((target in LocalRootProject).value / "ivy-cache")),
p.settings( publishTo := Some(Resolver.file("test-publish", (baseDirectory in ThisBuild).value / "repo/")),
ivyPaths := IvyPaths((baseDirectory in root).value, Some((target in root).value / "ivy-cache")), // to get sbt artifacts
resolvers += { resolvers += {
val ivyHome = Classpaths.bootIvyHome(appConfiguration.value) getOrElse sys.error("Launcher did not provide the Ivy home directory.") val ivyHome = Classpaths.bootIvyHome(appConfiguration.value) getOrElse sys.error("Launcher did not provide the Ivy home directory.")
Resolver.file("real-local", ivyHome / "local")(Resolver.ivyStylePatterns) Resolver.file("real-local", ivyHome / "local")(Resolver.ivyStylePatterns)
}, },
resolvers += Resolver.typesafeIvyRepo("releases"), // not sure why this isn't included by default resolvers += Resolver.mavenLocal,
resolvers += Resolver.mavenLocal resolvers += ("test-repo" at ((baseDirectory in ThisBuild).value / "repo/").asURL.toString)
)
lazy val a = (project in file("a"))
.enablePlugins(SbtPlugin)
.settings(
commonSettings,
name := "demo1",
version := "0.1"
)
lazy val b = (project in file("b"))
.enablePlugins(SbtPlugin)
.settings(
commonSettings,
name := "demo2",
version := "0.2",
addSbtPlugin("org.example" % "demo1" % "0.1")
)
lazy val c = (project in file("c"))
.enablePlugins(SbtPlugin)
.settings(
commonSettings,
name := "demo3",
version := "0.3",
addSbtPlugin("org.example" % "demo2" % "0.2")
) )

View File

@ -1,15 +0,0 @@
publishTo := Some(Resolver.file("test-publish", (baseDirectory in ThisBuild).value / "repo"))
resolvers += ("test" at ((baseDirectory in ThisBuild).value / "repo").asURL.toString)
resolvers += Resolver.mavenLocal
name := "demo3"
organization := "org.example"
version := "0.3"
sbtPlugin := true
//addSbtPlugin("org.example" % "demo1" % "0.1")
addSbtPlugin("org.example" % "demo2" % "0.2")