Build: Fix deprecated Gradle configurations usages
for migration to Gradle 7+ #KTI-559
This commit is contained in:
@@ -33,7 +33,7 @@ import plugins.mainPublicationName
|
||||
private const val MAGIC_DO_NOT_CHANGE_TEST_JAR_TASK_NAME = "testJar"
|
||||
|
||||
fun Project.testsJar(body: Jar.() -> Unit = {}): Jar {
|
||||
val testsJarCfg = configurations.getOrCreate("tests-jar").extendsFrom(configurations["testCompile"])
|
||||
val testsJarCfg = configurations.getOrCreate("tests-jar").extendsFrom(configurations["testApi"])
|
||||
|
||||
return task<Jar>(MAGIC_DO_NOT_CHANGE_TEST_JAR_TASK_NAME) {
|
||||
dependsOn("testClasses")
|
||||
|
||||
@@ -142,14 +142,14 @@ fun DependencyHandler.jpsLikeJarDependency(
|
||||
JpsDepScope.COMPILE -> {
|
||||
if (exported) {
|
||||
add("api", dependencyNotation, dependencyConfiguration)
|
||||
add("testCompile", dependencyNotation, dependencyConfiguration)
|
||||
add("testApi", dependencyNotation, dependencyConfiguration)
|
||||
} else {
|
||||
add("implementation", dependencyNotation, dependencyConfiguration)
|
||||
}
|
||||
}
|
||||
JpsDepScope.TEST -> {
|
||||
if (exported) {
|
||||
add("testCompile", dependencyNotation, dependencyConfiguration)
|
||||
add("testApi", dependencyNotation, dependencyConfiguration)
|
||||
} else {
|
||||
add("testImplementation", dependencyNotation, dependencyConfiguration)
|
||||
}
|
||||
@@ -160,7 +160,7 @@ fun DependencyHandler.jpsLikeJarDependency(
|
||||
JpsDepScope.PROVIDED -> {
|
||||
if (exported) {
|
||||
add("compileOnlyApi", dependencyNotation, dependencyConfiguration)
|
||||
add("testCompile", dependencyNotation, dependencyConfiguration)
|
||||
add("testApi", dependencyNotation, dependencyConfiguration)
|
||||
} else {
|
||||
add("compileOnly", dependencyNotation, dependencyConfiguration)
|
||||
add("testImplementation", dependencyNotation, dependencyConfiguration)
|
||||
|
||||
@@ -140,7 +140,7 @@ abstract class IntelliJInstrumentCodeTask : ConventionTask() {
|
||||
|
||||
// Instrumentation needs to have access to sources of forms for inclusion
|
||||
private val depSourceDirectorySets by lazy {
|
||||
project.configurations["compile"].dependencies.withType(ProjectDependency::class.java)
|
||||
project.configurations["api"].dependencies.withType(ProjectDependency::class.java)
|
||||
.map { p -> p.dependencyProject.mainSourceSet.allSource.sourceDirectories }
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user