Skip to content

Commit 205455a

Browse files
style95rabbah
authored andcommitted
Constraint all transitive akka-* dependencies
1 parent 411a662 commit 205455a

2 files changed

Lines changed: 24 additions & 0 deletions

File tree

settings.gradle

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,14 @@ gradle.ext.openwhisk = [
3535

3636
gradle.ext.scala = [
3737
version: '2.12.7',
38+
depVersion : '2.12',
3839
compileFlags: ['-feature', '-unchecked', '-deprecation', '-Xfatal-warnings', '-Ywarn-unused-import']
3940
]
4041

42+
43+
gradle.ext.akka = [version : '2.6.12']
44+
gradle.ext.akka_http = [version : '10.2.4']
45+
4146
gradle.ext.scalafmt = [
4247
version: '1.5.0',
4348
config: new File(rootProject.projectDir, '.scalafmt.conf')

tests/build.gradle

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,25 @@ repositories {
2424
mavenLocal()
2525
}
2626

27+
pluginManager.withPlugin('scala') {
28+
// Constraint all transitive akka-* dependencies to the one we want to use to avoid issues.
29+
// List generated via
30+
// ./gradlew :test:dependencies | grep -o 'akka-.*_' | cut -c 6- | rev | cut -c 2- | rev | sort -u
31+
def cons = project.getDependencies().getConstraints()
32+
def akka = ['akka-actor', 'akka-cluster', 'akka-cluster-metrics', 'akka-cluster-tools', 'akka-coordination',
33+
'akka-discovery', 'akka-distributed-data', 'akka-protobuf', 'akka-remote', 'akka-slf4j',
34+
'akka-stream', 'akka-stream-testkit', 'akka-testkit']
35+
def akkaHttp = ['akka-http', 'akka-http-core', 'akka-http-spray-json', 'akka-http-testkit', 'akka-http-xml',
36+
'akka-parsing', 'akka-http2-support']
37+
38+
akka.forEach {
39+
cons.add('compile', "com.typesafe.akka:${it}_${gradle.scala.depVersion}:${gradle.akka.version}")
40+
}
41+
akkaHttp.forEach {
42+
cons.add('compile', "com.typesafe.akka:${it}_${gradle.scala.depVersion}:${gradle.akka_http.version}")
43+
}
44+
}
45+
2746
tasks.withType(Test) {
2847
testLogging {
2948
events "passed", "skipped", "failed"

0 commit comments

Comments
 (0)