Skip to content

Commit ab146bd

Browse files
committed
Build: Fix deprecated Gradle configurations usages
for migration to Gradle 7+ #KTI-559
1 parent dbedff3 commit ab146bd

File tree

158 files changed

+874
-891
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

158 files changed

+874
-891
lines changed

analysis/analysis-api-fir/build.gradle.kts

+20-20
Original file line numberDiff line numberDiff line change
@@ -5,29 +5,29 @@ plugins {
55
}
66

77
dependencies {
8-
compile(project(":compiler:psi"))
9-
compile(project(":compiler:fir:fir2ir"))
10-
compile(project(":compiler:ir.tree"))
11-
compile(project(":compiler:fir:resolve"))
12-
compile(project(":compiler:fir:checkers"))
13-
compile(project(":compiler:fir:checkers:checkers.jvm"))
14-
compile(project(":compiler:fir:java"))
15-
compile(project(":analysis:low-level-api-fir"))
16-
compile(project(":analysis:analysis-api"))
17-
compile(project(":compiler:light-classes"))
18-
compile(intellijCoreDep())
8+
api(project(":compiler:psi"))
9+
api(project(":compiler:fir:fir2ir"))
10+
api(project(":compiler:ir.tree"))
11+
api(project(":compiler:fir:resolve"))
12+
api(project(":compiler:fir:checkers"))
13+
api(project(":compiler:fir:checkers:checkers.jvm"))
14+
api(project(":compiler:fir:java"))
15+
api(project(":analysis:low-level-api-fir"))
16+
api(project(":analysis:analysis-api"))
17+
api(project(":compiler:light-classes"))
18+
api(intellijCoreDep())
1919
implementation(project(":analysis:analysis-api-providers"))
2020

21-
testCompile(projectTests(":analysis:low-level-api-fir"))
22-
testCompile(projectTests(":compiler:tests-common"))
23-
testCompile(projectTests(":compiler:test-infrastructure-utils"))
24-
testCompile(projectTests(":compiler:test-infrastructure"))
25-
testCompile(projectTests(":compiler:tests-common-new"))
26-
testCompile(projectTests(":compiler:fir:analysis-tests:legacy-fir-tests"))
27-
testCompile(project(":kotlin-test:kotlin-test-junit"))
28-
testCompile(toolsJar())
21+
testApi(projectTests(":analysis:low-level-api-fir"))
22+
testApi(projectTests(":compiler:tests-common"))
23+
testApi(projectTests(":compiler:test-infrastructure-utils"))
24+
testApi(projectTests(":compiler:test-infrastructure"))
25+
testApi(projectTests(":compiler:tests-common-new"))
26+
testApi(projectTests(":compiler:fir:analysis-tests:legacy-fir-tests"))
27+
testApi(project(":kotlin-test:kotlin-test-junit"))
28+
testApi(toolsJar())
2929
testApiJUnit5()
30-
testRuntime(project(":analysis:symbol-light-classes"))
30+
testRuntimeOnly(project(":analysis:symbol-light-classes"))
3131

3232
testRuntimeOnly(intellijDep()) {
3333
includeJars(

analysis/analysis-api/build.gradle.kts

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ dependencies {
1717
compileOnly(project(":analysis:low-level-api-fir"))
1818
implementation(project(":analysis:analysis-api-providers"))
1919

20-
compile(intellijCoreDep()) { includeJars("intellij-core", "guava", rootProject = rootProject) }
20+
api(intellijCoreDep()) { includeJars("intellij-core", "guava", rootProject = rootProject) }
2121
}
2222

2323
kotlin {

analysis/low-level-api-fir/build.gradle.kts

+19-19
Original file line numberDiff line numberDiff line change
@@ -4,35 +4,35 @@ plugins {
44
}
55

66
dependencies {
7-
compile(project(":compiler:psi"))
7+
api(project(":compiler:psi"))
88
implementation(project(":analysis:project-structure"))
9-
compile(project(":compiler:fir:fir2ir"))
10-
compile(project(":compiler:fir:fir2ir:jvm-backend"))
11-
compile(project(":compiler:ir.serialization.common"))
12-
compile(project(":compiler:fir:resolve"))
13-
compile(project(":compiler:fir:checkers"))
14-
compile(project(":compiler:fir:checkers:checkers.jvm"))
15-
compile(project(":compiler:fir:java"))
16-
compile(project(":compiler:backend.common.jvm"))
17-
testCompile(project(":analysis:analysis-api-fir"))
9+
api(project(":compiler:fir:fir2ir"))
10+
api(project(":compiler:fir:fir2ir:jvm-backend"))
11+
api(project(":compiler:ir.serialization.common"))
12+
api(project(":compiler:fir:resolve"))
13+
api(project(":compiler:fir:checkers"))
14+
api(project(":compiler:fir:checkers:checkers.jvm"))
15+
api(project(":compiler:fir:java"))
16+
api(project(":compiler:backend.common.jvm"))
17+
testApi(project(":analysis:analysis-api-fir"))
1818
implementation(project(":compiler:ir.psi2ir"))
1919
implementation(project(":compiler:fir:entrypoint"))
2020
implementation(project(":analysis:analysis-api-providers"))
2121

22-
compile(intellijCoreDep()) { includeJars("intellij-core", "guava", rootProject = rootProject) }
22+
api(intellijCoreDep()) { includeJars("intellij-core", "guava", rootProject = rootProject) }
2323

2424

25-
testCompile(projectTests(":compiler:test-infrastructure-utils"))
26-
testCompile(projectTests(":compiler:test-infrastructure"))
27-
testCompile(projectTests(":compiler:tests-common-new"))
25+
testApi(projectTests(":compiler:test-infrastructure-utils"))
26+
testApi(projectTests(":compiler:test-infrastructure"))
27+
testApi(projectTests(":compiler:tests-common-new"))
2828

2929
testImplementation("org.opentest4j:opentest4j:1.2.0")
30-
testCompile(toolsJar())
31-
testCompile(projectTests(":compiler:tests-common"))
32-
testCompile(projectTests(":compiler:fir:analysis-tests:legacy-fir-tests"))
33-
testCompile(project(":kotlin-test:kotlin-test-junit"))
30+
testApi(toolsJar())
31+
testApi(projectTests(":compiler:tests-common"))
32+
testApi(projectTests(":compiler:fir:analysis-tests:legacy-fir-tests"))
33+
testApi(project(":kotlin-test:kotlin-test-junit"))
3434
testApiJUnit5()
35-
testCompile(project(":kotlin-reflect"))
35+
testApi(project(":kotlin-reflect"))
3636
testImplementation(project(":analysis:symbol-light-classes"))
3737

3838
testRuntimeOnly(intellijDep()) {

ant/build.gradle.kts

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ plugins {
66
}
77

88
dependencies {
9-
compile(commonDep("org.apache.ant", "ant"))
10-
compile(project(":kotlin-preloader"))
11-
compile(kotlinStdlib())
9+
api(commonDep("org.apache.ant", "ant"))
10+
api(project(":kotlin-preloader"))
11+
api(kotlinStdlib())
1212
}
1313

1414
sourceSets {

benchmarks/build.gradle.kts

+9-9
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ plugins {
99
}
1010

1111
dependencies {
12-
compile(kotlinStdlib())
13-
compile(project(":compiler:frontend"))
14-
compile(projectTests(":compiler:tests-common"))
15-
compile(project(":compiler:cli"))
16-
compile(intellijCoreDep()) { includeJars("intellij-core") }
17-
compile(jpsStandalone()) { includeJars("jps-model") }
18-
compile(intellijPluginDep("java"))
19-
compile(intellijDep()) { includeIntellijCoreJarDependencies(project) }
20-
compile("org.jetbrains.kotlinx:kotlinx-benchmark-runtime:$benchmarks_version")
12+
api(kotlinStdlib())
13+
api(project(":compiler:frontend"))
14+
api(projectTests(":compiler:tests-common"))
15+
api(project(":compiler:cli"))
16+
api(intellijCoreDep()) { includeJars("intellij-core") }
17+
api(jpsStandalone()) { includeJars("jps-model") }
18+
api(intellijPluginDep("java"))
19+
api(intellijDep()) { includeIntellijCoreJarDependencies(project) }
20+
api("org.jetbrains.kotlinx:kotlinx-benchmark-runtime:$benchmarks_version")
2121
}
2222

2323
sourceSets {

build-common/build.gradle.kts

+5-5
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ dependencies {
1919
compileOnly(project(":kotlin-reflect-api"))
2020

2121
testCompileOnly(project(":compiler:cli-common"))
22-
testCompile(projectTests(":compiler:tests-common"))
23-
testCompile(commonDep("junit:junit"))
24-
testCompile(protobufFull())
25-
testCompile(kotlinStdlib())
26-
testRuntime(project(":kotlin-reflect"))
22+
testApi(projectTests(":compiler:tests-common"))
23+
testApi(commonDep("junit:junit"))
24+
testApi(protobufFull())
25+
testApi(kotlinStdlib())
26+
testImplementation(project(":kotlin-reflect"))
2727
}
2828

2929
sourceSets {

buildSrc/src/main/kotlin/artifacts.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import plugins.mainPublicationName
3333
private const val MAGIC_DO_NOT_CHANGE_TEST_JAR_TASK_NAME = "testJar"
3434

3535
fun Project.testsJar(body: Jar.() -> Unit = {}): Jar {
36-
val testsJarCfg = configurations.getOrCreate("tests-jar").extendsFrom(configurations["testCompile"])
36+
val testsJarCfg = configurations.getOrCreate("tests-jar").extendsFrom(configurations["testApi"])
3737

3838
return task<Jar>(MAGIC_DO_NOT_CHANGE_TEST_JAR_TASK_NAME) {
3939
dependsOn("testClasses")

buildSrc/src/main/kotlin/dependencies.kt

+3-3
Original file line numberDiff line numberDiff line change
@@ -142,14 +142,14 @@ fun DependencyHandler.jpsLikeJarDependency(
142142
JpsDepScope.COMPILE -> {
143143
if (exported) {
144144
add("api", dependencyNotation, dependencyConfiguration)
145-
add("testCompile", dependencyNotation, dependencyConfiguration)
145+
add("testApi", dependencyNotation, dependencyConfiguration)
146146
} else {
147147
add("implementation", dependencyNotation, dependencyConfiguration)
148148
}
149149
}
150150
JpsDepScope.TEST -> {
151151
if (exported) {
152-
add("testCompile", dependencyNotation, dependencyConfiguration)
152+
add("testApi", dependencyNotation, dependencyConfiguration)
153153
} else {
154154
add("testImplementation", dependencyNotation, dependencyConfiguration)
155155
}
@@ -160,7 +160,7 @@ fun DependencyHandler.jpsLikeJarDependency(
160160
JpsDepScope.PROVIDED -> {
161161
if (exported) {
162162
add("compileOnlyApi", dependencyNotation, dependencyConfiguration)
163-
add("testCompile", dependencyNotation, dependencyConfiguration)
163+
add("testApi", dependencyNotation, dependencyConfiguration)
164164
} else {
165165
add("compileOnly", dependencyNotation, dependencyConfiguration)
166166
add("testImplementation", dependencyNotation, dependencyConfiguration)

buildSrc/src/main/kotlin/instrument.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ abstract class IntelliJInstrumentCodeTask : ConventionTask() {
140140

141141
// Instrumentation needs to have access to sources of forms for inclusion
142142
private val depSourceDirectorySets by lazy {
143-
project.configurations["compile"].dependencies.withType(ProjectDependency::class.java)
143+
project.configurations["api"].dependencies.withType(ProjectDependency::class.java)
144144
.map { p -> p.dependencyProject.mainSourceSet.allSource.sourceDirectories }
145145
}
146146

compiler/android-tests/build.gradle.kts

+21-21
Original file line numberDiff line numberDiff line change
@@ -6,37 +6,37 @@ plugins {
66
}
77

88
dependencies {
9-
testCompile(project(":core:descriptors"))
10-
testCompile(project(":core:descriptors.jvm"))
11-
testCompile(project(":compiler:util"))
12-
testCompile(project(":compiler:cli"))
13-
testCompile(project(":compiler:frontend"))
14-
testCompile(project(":compiler:backend"))
15-
testCompile(project(":compiler:incremental-compilation-impl"))
16-
testCompile(project(":compiler:frontend.java"))
9+
testApi(project(":core:descriptors"))
10+
testApi(project(":core:descriptors.jvm"))
11+
testApi(project(":compiler:util"))
12+
testApi(project(":compiler:cli"))
13+
testApi(project(":compiler:frontend"))
14+
testApi(project(":compiler:backend"))
15+
testApi(project(":compiler:incremental-compilation-impl"))
16+
testApi(project(":compiler:frontend.java"))
1717

18-
testCompile(kotlinStdlib())
19-
testCompile(project(":kotlin-reflect"))
20-
testCompile(projectTests(":compiler:tests-common"))
21-
testCompile(commonDep("junit:junit"))
18+
testApi(kotlinStdlib())
19+
testApi(project(":kotlin-reflect"))
20+
testApi(projectTests(":compiler:tests-common"))
21+
testApi(commonDep("junit:junit"))
2222
testApi(projectTests(":compiler:test-infrastructure"))
2323
testApi(projectTests(":compiler:test-infrastructure-utils"))
2424
testApi(projectTests(":compiler:tests-compiler-utils"))
2525
testApi(projectTests(":compiler:tests-common-new"))
2626

27-
testCompile(commonDep("junit:junit"))
27+
testApi(commonDep("junit:junit"))
2828

29-
testCompile(intellijDep()) { includeJars("util", "idea", "idea_rt", rootProject = rootProject) }
30-
testCompile(intellijDep()) { includeJars("groovy", rootProject = rootProject) }
29+
testApi(intellijDep()) { includeJars("util", "idea", "idea_rt", rootProject = rootProject) }
30+
testApi(intellijDep()) { includeJars("groovy", rootProject = rootProject) }
3131

32-
testCompile(intellijPluginDep("java")) { includeJars("jps-builders") }
33-
testCompile(jpsStandalone()) { includeJars("jps-model") }
34-
testCompile(jpsBuildTest())
32+
testApi(intellijPluginDep("java")) { includeJars("jps-builders") }
33+
testApi(jpsStandalone()) { includeJars("jps-model") }
34+
testApi(jpsBuildTest())
3535

36-
testRuntimeOnly(compile(intellijCoreDep()) { includeJars("intellij-core") })
37-
testRuntimeOnly(compile(intellijDep()) { includeJars("jna", rootProject = rootProject) })
36+
testRuntimeOnly(intellijCoreDep()) { includeJars("intellij-core") }
37+
testRuntimeOnly(intellijDep()) { includeJars("jna", rootProject = rootProject) }
3838

39-
testCompile("org.junit.platform:junit-platform-launcher:${commonVer("org.junit.platform", "")}")
39+
testApi("org.junit.platform:junit-platform-launcher:${commonVer("org.junit.platform", "")}")
4040
}
4141

4242
sourceSets {

compiler/backend-common/build.gradle.kts

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ plugins {
55
}
66

77
dependencies {
8-
compile(project(":core:descriptors"))
9-
compile(project(":compiler:util"))
10-
compile(project(":compiler:frontend"))
8+
api(project(":core:descriptors"))
9+
api(project(":compiler:util"))
10+
api(project(":compiler:frontend"))
1111
compileOnly(intellijCoreDep()) { includeJars("intellij-core") }
1212
}
1313

compiler/backend/build.gradle.kts

+6-6
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ plugins {
44
}
55

66
dependencies {
7-
compile(project(":kotlin-annotations-jvm"))
8-
compile(project(":compiler:util"))
9-
compile(project(":compiler:backend-common"))
10-
compile(project(":compiler:frontend"))
11-
compile(project(":compiler:frontend.java"))
12-
compile(project(":compiler:serialization"))
7+
api(project(":kotlin-annotations-jvm"))
8+
api(project(":compiler:util"))
9+
api(project(":compiler:backend-common"))
10+
api(project(":compiler:frontend"))
11+
api(project(":compiler:frontend.java"))
12+
api(project(":compiler:serialization"))
1313
api(project(":compiler:backend.common.jvm"))
1414
compileOnly(intellijCoreDep()) { includeJars("intellij-core", "asm-all", "guava", rootProject = rootProject) }
1515
compileOnly(intellijDep()) { includeJars("trove4j", rootProject = rootProject) }

compiler/build.gradle.kts

+17-17
Original file line numberDiff line numberDiff line change
@@ -12,26 +12,26 @@ val otherCompilerModules = compilerModules.filter { it != path }
1212
val antLauncherJar by configurations.creating
1313

1414
dependencies {
15-
testRuntime(intellijDep()) // Should come before compiler, because of "progarded" stuff needed for tests
15+
testImplementation(intellijDep()) // Should come before compiler, because of "progarded" stuff needed for tests
1616

17-
testCompile(project(":kotlin-script-runtime"))
18-
testCompile(project(":kotlin-test:kotlin-test-jvm"))
17+
testApi(project(":kotlin-script-runtime"))
18+
testApi(project(":kotlin-test:kotlin-test-jvm"))
1919

20-
testCompile(kotlinStdlib())
20+
testApi(kotlinStdlib())
2121

22-
testCompile(commonDep("junit:junit"))
22+
testApi(commonDep("junit:junit"))
2323
testCompileOnly(project(":kotlin-test:kotlin-test-jvm"))
2424
testCompileOnly(project(":kotlin-test:kotlin-test-junit"))
25-
testCompile(projectTests(":compiler:tests-common"))
26-
testCompile(projectTests(":compiler:fir:raw-fir:psi2fir"))
27-
testCompile(projectTests(":compiler:fir:raw-fir:light-tree2fir"))
28-
testCompile(projectTests(":compiler:fir:fir2ir"))
29-
testCompile(projectTests(":compiler:fir:analysis-tests:legacy-fir-tests"))
30-
testCompile(projectTests(":generators:test-generator"))
31-
testCompile(project(":compiler:ir.ir2cfg"))
32-
testCompile(project(":compiler:ir.tree")) // used for deepCopyWithSymbols call that is removed by proguard from the compiler TODO: make it more straightforward
33-
testCompile(project(":kotlin-scripting-compiler"))
34-
testCompile(project(":kotlin-script-util"))
25+
testApi(projectTests(":compiler:tests-common"))
26+
testApi(projectTests(":compiler:fir:raw-fir:psi2fir"))
27+
testApi(projectTests(":compiler:fir:raw-fir:light-tree2fir"))
28+
testApi(projectTests(":compiler:fir:fir2ir"))
29+
testApi(projectTests(":compiler:fir:analysis-tests:legacy-fir-tests"))
30+
testApi(projectTests(":generators:test-generator"))
31+
testApi(project(":compiler:ir.ir2cfg"))
32+
testApi(project(":compiler:ir.tree")) // used for deepCopyWithSymbols call that is removed by proguard from the compiler TODO: make it more straightforward
33+
testApi(project(":kotlin-scripting-compiler"))
34+
testApi(project(":kotlin-script-util"))
3535
testCompileOnly(project(":kotlin-reflect-api"))
3636
otherCompilerModules.forEach {
3737
testCompileOnly(project(it))
@@ -41,8 +41,8 @@ dependencies {
4141

4242
testRuntimeOnly(intellijPluginDep("java"))
4343

44-
testRuntime(project(":kotlin-reflect"))
45-
testRuntime(toolsJar())
44+
testImplementation(project(":kotlin-reflect"))
45+
testImplementation(toolsJar())
4646

4747
antLauncherJar(commonDep("org.apache.ant", "ant"))
4848
antLauncherJar(toolsJar())

0 commit comments

Comments
 (0)