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