@@ -35,7 +35,7 @@ public class BinaryCompatibilityValidatorPlugin : Plugin<Project> {
35
35
private fun Project.validateExtension (extension : ApiValidationExtension ) {
36
36
afterEvaluate {
37
37
val ignored = extension.ignoredProjects
38
- val all = allprojects.map { it.name }
38
+ val all = allprojects.map { it.path }
39
39
for (project in ignored) {
40
40
require(project in all) { " Cannot find excluded project $project in all projects: $all " }
41
41
}
@@ -55,7 +55,7 @@ public class BinaryCompatibilityValidatorPlugin : Plugin<Project> {
55
55
extension : ApiValidationExtension ,
56
56
action : Action <AppliedPlugin >
57
57
) = project.pluginManager.withPlugin(name) {
58
- if (project.name in extension.ignoredProjects) return @withPlugin
58
+ if (project.path in extension.ignoredProjects) return @withPlugin
59
59
action.execute(it)
60
60
}
61
61
@@ -64,7 +64,7 @@ public class BinaryCompatibilityValidatorPlugin : Plugin<Project> {
64
64
extension : ApiValidationExtension ,
65
65
jvmRuntimeClasspath : NamedDomainObjectProvider <Configuration >
66
66
) = configurePlugin(" kotlin-multiplatform" , project, extension) {
67
- if (project.name in extension.ignoredProjects) return @configurePlugin
67
+ if (project.path in extension.ignoredProjects) return @configurePlugin
68
68
val kotlin = project.kotlinMultiplatform
69
69
70
70
// Create common tasks for multiplatform
@@ -208,7 +208,7 @@ private fun Project.configureKotlinCompilation(
208
208
commonApiCheck : TaskProvider <Task >? = null,
209
209
useOutput : Boolean = false,
210
210
) {
211
- val projectName = project.name
211
+ val projectName = project.path
212
212
val dumpFileName = project.jvmDumpFileName
213
213
val apiDirProvider = targetConfig.apiDir
214
214
val apiBuildDir = apiDirProvider.flatMap { f -> layout.buildDirectory.asFile.map { it.resolve(f) } }
@@ -252,7 +252,7 @@ private fun Project.configureApiTasks(
252
252
targetConfig : TargetConfig = TargetConfig (this, extension),
253
253
jvmRuntimeClasspath : NamedDomainObjectProvider <Configuration >,
254
254
) {
255
- val projectName = project.name
255
+ val projectName = project.path
256
256
val dumpFileName = project.jvmDumpFileName
257
257
val apiBuildDir = targetConfig.apiDir.flatMap { f -> layout.buildDirectory.asFile.map { it.resolve(f) } }
258
258
val sourceSetsOutputsProvider = project.provider {
@@ -281,7 +281,7 @@ private fun Project.configureCheckTasks(
281
281
commonApiDump : TaskProvider <Task >? = null,
282
282
commonApiCheck : TaskProvider <Task >? = null,
283
283
) {
284
- val projectName = project.name
284
+ val projectName = project.path
285
285
val apiCheckDir = targetConfig.apiDir.map {
286
286
projectDir.resolve(it).also { r ->
287
287
logger.debug(" Configuring api for ${targetConfig.targetName ? : " jvm" } to $r " )
@@ -398,16 +398,16 @@ private class KlibValidationPipelineBuilder(
398
398
399
399
private fun Project.checkKlibsTask (klibDumpConfig : TargetConfig ) =
400
400
project.task<KotlinApiCompareTask >(klibDumpConfig.apiTaskName(" Check" )) {
401
- isEnabled = klibAbiCheckEnabled(project.name , extension)
401
+ isEnabled = klibAbiCheckEnabled(project.path , extension)
402
402
group = " verification"
403
403
description =
404
- " Checks signatures of a public KLib ABI against the golden value in ABI folder for ${project.name } "
404
+ " Checks signatures of a public KLib ABI against the golden value in ABI folder for ${project.path } "
405
405
}
406
406
407
407
private fun Project.dumpKlibsTask (klibDumpConfig : TargetConfig ) =
408
408
project.task<SyncFile >(klibDumpConfig.apiTaskName(" Dump" )) {
409
- isEnabled = klibAbiCheckEnabled(project.name , extension)
410
- description = " Syncs the KLib ABI file for ${project.name } "
409
+ isEnabled = klibAbiCheckEnabled(project.path , extension)
410
+ description = " Syncs the KLib ABI file for ${project.path } "
411
411
group = " other"
412
412
onlyIf {
413
413
it as SyncFile
@@ -424,7 +424,7 @@ private class KlibValidationPipelineBuilder(
424
424
klibDumpConfig.apiTaskName(" ExtractForValidation" )
425
425
)
426
426
{
427
- isEnabled = klibAbiCheckEnabled(project.name , extension)
427
+ isEnabled = klibAbiCheckEnabled(project.path , extension)
428
428
description = " Prepare a reference KLib ABI file by removing all unsupported targets from " +
429
429
" the golden file stored in the project"
430
430
group = " other"
@@ -443,7 +443,7 @@ private class KlibValidationPipelineBuilder(
443
443
klibDumpConfig.apiTaskName(" MergeInferred" )
444
444
)
445
445
{
446
- isEnabled = klibAbiCheckEnabled(project.name , extension)
446
+ isEnabled = klibAbiCheckEnabled(project.path , extension)
447
447
description = " Merges multiple KLib ABI dump files generated for " +
448
448
" different targets (including inferred dumps for unsupported targets) " +
449
449
" into a single merged KLib ABI dump"
@@ -456,7 +456,7 @@ private class KlibValidationPipelineBuilder(
456
456
klibMergeDir : Provider <File >,
457
457
runtimeClasspath : NamedDomainObjectProvider <Configuration >
458
458
) = project.task<KotlinKlibMergeAbiTask >(klibDumpConfig.apiTaskName(" Merge" )) {
459
- isEnabled = klibAbiCheckEnabled(project.name , extension)
459
+ isEnabled = klibAbiCheckEnabled(project.path , extension)
460
460
description = " Merges multiple KLib ABI dump files generated for " +
461
461
" different targets into a single merged KLib ABI dump"
462
462
mergedApiFile.fileProvider(klibMergeDir.map { it.resolve(klibDumpFileName) })
@@ -577,7 +577,7 @@ private class KlibValidationPipelineBuilder(
577
577
apiBuildDir : Provider <File >,
578
578
runtimeClasspath : NamedDomainObjectProvider <Configuration >
579
579
): TaskProvider <KotlinKlibAbiBuildTask > {
580
- val projectName = project.name
580
+ val projectName = project.path
581
581
val buildTask = project.task<KotlinKlibAbiBuildTask >(targetConfig.apiTaskName(" Build" )) {
582
582
isEnabled = klibAbiCheckEnabled(projectName, extension)
583
583
// 'group' is not specified deliberately, so it will be hidden from ./gradlew tasks
@@ -594,7 +594,7 @@ private class KlibValidationPipelineBuilder(
594
594
595
595
private fun Project.mergeDependencyForUnsupportedTarget (targetConfig : TargetConfig ): TaskProvider <DefaultTask > {
596
596
return project.task<DefaultTask >(targetConfig.apiTaskName(" Build" )) {
597
- isEnabled = apiCheckEnabled(project.name , extension)
597
+ isEnabled = apiCheckEnabled(project.path , extension)
598
598
599
599
doLast {
600
600
logger.warn(
@@ -613,7 +613,7 @@ private class KlibValidationPipelineBuilder(
613
613
): TaskProvider <KotlinKlibInferAbiTask > {
614
614
val targetName = targetConfig.targetName!!
615
615
return project.task<KotlinKlibInferAbiTask >(targetConfig.apiTaskName(" Infer" )) {
616
- isEnabled = klibAbiCheckEnabled(project.name , extension)
616
+ isEnabled = klibAbiCheckEnabled(project.path , extension)
617
617
description = " Try to infer the dump for unsupported target $targetName using dumps " +
618
618
" generated for supported targets."
619
619
group = " other"
0 commit comments