-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SDKJAVA-271 SBT stuck at Resolving NormalizedArtifact for long time (#29
) Signed-off-by: Oleksandr Vyshniak <[email protected]>
- Loading branch information
Showing
6 changed files
with
94 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import com.here.bom.Bom | ||
import scala.sys.process.Process | ||
|
||
lazy val scalaCompilerOptions = Seq( | ||
"-deprecation", | ||
"-encoding", | ||
"UTF-8", | ||
"-feature", | ||
"-language:existentials", | ||
"-language:higherKinds", | ||
"-language:implicitConversions", | ||
"-unchecked", | ||
"-Xfatal-warnings", | ||
"-Xlint", | ||
"-Ywarn-dead-code", | ||
"-Ywarn-numeric-widen", | ||
"-Ywarn-value-discard", | ||
) | ||
|
||
lazy val akkaBom = Bom("com.lightbend.akka" %% "akka-dependencies" % "23.05.4") | ||
def akkaDependencies(bom: Bom) = { | ||
Seq( | ||
"com.lightbend.akka.grpc" %% "akka-grpc-runtime" % bom | ||
) | ||
} | ||
|
||
lazy val `test-downloaded-deps` = project | ||
.in(file(".")) | ||
.settings(akkaBom) | ||
.settings( | ||
name := "test-downloaded-deps", | ||
scalaVersion := "2.13.2", | ||
resolvers := Resolver.DefaultMavenRepository +: resolvers.value, | ||
libraryDependencies ++= akkaDependencies(akkaBom.key.value), | ||
dependencyOverrides ++= akkaBom.key.value.bomDependencies, | ||
TaskKey[Unit]("akkaDepsDescriptorExist") := { | ||
val akkaDepsPath =f"${System.getProperty("java.io.tmpdir")}/test-sbt-bom-cache/cache/com.lightbend.akka/akka-dependencies_2.13/ivy-23.05.4.xml" | ||
if (!new File(akkaDepsPath).exists()) { | ||
sys.error(f"Akka deps file is not exists: $akkaDepsPath") | ||
} | ||
}, | ||
TaskKey[Unit]("akkaGrpcRuntimeDescriptorNotExist") := { | ||
val akkaDepsPath =f"${System.getProperty("java.io.tmpdir")}/test-sbt-bom-cache/cache/com.lightbend.akka.grpc/akka-grpc-runtime_2.13" | ||
if (new File(akkaDepsPath).exists()) { | ||
sys.error(f"GRPC core exits: $akkaDepsPath") | ||
} | ||
} | ||
) | ||
|
||
ThisBuild / scalacOptions ++= scalaCompilerOptions | ||
Global / onChangedBuildSource := ReloadOnSourceChanges |
1 change: 1 addition & 0 deletions
1
plugin/src/sbt-test/psv/test_downloaded_deps/project/build.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
sbt.version=1.6.1 |
7 changes: 7 additions & 0 deletions
7
plugin/src/sbt-test/psv/test_downloaded_deps/project/plugins.sbt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
addSbtPlugin("com.here.platform.artifact" % "sbt-resolver" % "2.0.24") | ||
|
||
sys.props.get("plugin.version") match { | ||
case Some(x) => addSbtPlugin("com.here.platform" % "sbt-bom" % x) | ||
case _ => sys.error("""|The system property 'plugin.version' is not defined. | ||
|Specify this property using the scriptedLaunchOpts -D.""".stripMargin) | ||
} |
24 changes: 24 additions & 0 deletions
24
plugin/src/sbt-test/psv/test_downloaded_deps/src/main/scala/TestApp.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* | ||
* Copyright (C) 2019-2024 HERE Europe B.V. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* License-Filename: LICENSE | ||
*/ | ||
package com.here.bom | ||
|
||
object TestApp extends App { | ||
// test that transient dependency of com.lightbend.akka.grpc:akka-grpc-runtime is available | ||
println("io.grpc.internal.GrpcUtil.TIMEOUT value is " + io.grpc.internal.GrpcUtil.TIMEOUT) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
> set scriptedBufferLog := false | ||
> eval System.setProperty("sbt.ivy.home", System.getProperty("java.io.tmpdir")+"/test-sbt-bom-cache") | ||
> eval System.setProperty("ivy.home", System.getProperty("java.io.tmpdir")+"/test-sbt-bom-cache") | ||
> set ivyPaths := IvyPaths.apply(file(System.getProperty("java.io.tmpdir")+"/test-sbt-bom-cache"), file(System.getProperty("java.io.tmpdir")+"/test-sbt-bom-cache")) | ||
> reload | ||
> package | ||
# check that declared dependency descriptor downloaded and stored in the ivy cache dir | ||
> akkaDepsDescriptorExist | ||
# check that transient dependency (io.grpc:grpc-core) descriptor is not downloaded during resolution | ||
> akkaGrpcRuntimeDescriptorNotExist |