Skip to content

Commit 9c44d42

Browse files
committed
Work around deprecation warning
1 parent 03abd80 commit 9c44d42

File tree

6 files changed

+15
-16
lines changed

6 files changed

+15
-16
lines changed

build.gradle.kts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,22 +30,22 @@ val platformProjects by extra(listOf(
3030
projects.junitPlatformSuiteCommons,
3131
projects.junitPlatformSuiteEngine,
3232
projects.junitPlatformTestkit
33-
).map { it.actualProject })
33+
).map { dependencyProject(it) })
3434

3535
val jupiterProjects by extra(listOf(
3636
projects.junitJupiter,
3737
projects.junitJupiterApi,
3838
projects.junitJupiterEngine,
3939
projects.junitJupiterMigrationsupport,
4040
projects.junitJupiterParams
41-
).map { it.actualProject })
41+
).map { dependencyProject(it) })
4242

4343
val vintageProjects by extra(listOf(
44-
projects.junitVintageEngine.actualProject
44+
dependencyProject(projects.junitVintageEngine)
4545
))
4646

4747
val mavenizedProjects by extra(platformProjects + jupiterProjects + vintageProjects)
48-
val modularProjects by extra(mavenizedProjects - listOf(projects.junitPlatformConsoleStandalone.actualProject))
48+
val modularProjects by extra(mavenizedProjects - setOf(dependencyProject(projects.junitPlatformConsoleStandalone)))
4949

5050
dependencies {
5151
modularProjects.forEach {

documentation/documentation.gradle.kts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -553,14 +553,14 @@ tasks {
553553

554554
eclipse {
555555
classpath {
556-
plusConfigurations.add(projects.junitPlatformConsole.actualProject.configurations["shadowedClasspath"])
557-
plusConfigurations.add(projects.junitJupiterParams.actualProject.configurations["shadowedClasspath"])
556+
plusConfigurations.add(dependencyProject(projects.junitPlatformConsole).configurations["shadowedClasspath"])
557+
plusConfigurations.add(dependencyProject(projects.junitJupiterParams).configurations["shadowedClasspath"])
558558
}
559559
}
560560

561561
idea {
562562
module {
563-
scopes["PROVIDED"]!!["plus"]!!.add(projects.junitPlatformConsole.actualProject.configurations["shadowedClasspath"])
564-
scopes["PROVIDED"]!!["plus"]!!.add(projects.junitJupiterParams.actualProject.configurations["shadowedClasspath"])
563+
scopes["PROVIDED"]!!["plus"]!!.add(dependencyProject(projects.junitPlatformConsole).configurations["shadowedClasspath"])
564+
scopes["PROVIDED"]!!["plus"]!!.add(dependencyProject(projects.junitJupiterParams).configurations["shadowedClasspath"])
565565
}
566566
}

gradle/plugins/common/src/main/kotlin/ProjectExtensions.kt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@ val ProjectDependency.javaModuleName: String
1212

1313
private fun toModuleName(name: String) = "org.${name.replace('-', '.')}"
1414

15-
val ProjectDependency.actualProject: Project
16-
@Suppress("DEPRECATION")
17-
get() = this.dependencyProject
15+
fun Project.dependencyProject(dependency: ProjectDependency) =
16+
project(dependency.path)
1817

1918
fun Project.requiredVersionFromLibs(name: String) =
2019
libsVersionCatalog.findVersion(name).get().requiredVersion

junit-platform-console-standalone/junit-platform-console-standalone.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@ tasks {
4141
// https://github.com/junit-team/junit5/issues/761
4242
// prevent duplicates, add 3rd-party licenses explicitly
4343
exclude("META-INF/LICENSE*.md")
44-
from(project.projects.junitPlatformConsole.actualProject.projectDir) {
44+
from(dependencyProject(project.projects.junitPlatformConsole).projectDir) {
4545
include("LICENSE-picocli.md")
4646
into("META-INF")
4747
}
48-
from(project.projects.junitJupiterParams.actualProject.projectDir) {
48+
from(dependencyProject(project.projects.junitJupiterParams).projectDir) {
4949
include("LICENSE-univocity-parsers.md")
5050
into("META-INF")
5151
}

platform-tests/platform-tests.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,12 @@ tasks {
8484

8585
eclipse {
8686
classpath {
87-
plusConfigurations.add(projects.junitPlatformConsole.actualProject.configurations["shadowedClasspath"])
87+
plusConfigurations.add(dependencyProject(projects.junitPlatformConsole).configurations["shadowedClasspath"])
8888
}
8989
}
9090

9191
idea {
9292
module {
93-
scopes["PROVIDED"]!!["plus"]!!.add(projects.junitPlatformConsole.actualProject.configurations["shadowedClasspath"])
93+
scopes["PROVIDED"]!!["plus"]!!.add(dependencyProject(projects.junitPlatformConsole).configurations["shadowedClasspath"])
9494
}
9595
}

platform-tooling-support-tests/platform-tooling-support-tests.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ val normalizeMavenRepo by tasks.registering(Sync::class) {
109109
val tempRepoName: String by rootProject
110110

111111
// All maven-aware projects must be published to the local temp repository
112-
(mavenizedProjects + projects.junitBom.actualProject)
112+
(mavenizedProjects + dependencyProject(projects.junitBom))
113113
.map { project -> project.tasks.named("publishAllPublicationsTo${tempRepoName.capitalized()}Repository") }
114114
.forEach { dependsOn(it) }
115115

0 commit comments

Comments
 (0)