Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions src/main/kotlin/ApiCompareCompareTask.kt
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ open class ApiCompareCompareTask @Inject constructor(private val objects: Object
@Optional
val dummyOutputFile: File? = null

@get:Input
internal val projectName = objects.property(String::class.java)
private val projectName = project.name

private val rootDir = project.rootProject.rootDir

Expand All @@ -52,7 +51,7 @@ open class ApiCompareCompareTask @Inject constructor(private val objects: Object
"Please ensure that ':apiDump' was executed in order to get API dump to compare the build against")
}

val subject = projectName.get()
val subject = projectName
val apiBuildDirFiles = mutableSetOf<RelativePath>()
val expectedApiFiles = mutableSetOf<RelativePath>()
objects.fileTree().from(apiBuildDir).visit { file ->
Expand Down
3 changes: 0 additions & 3 deletions src/main/kotlin/BinaryCompatibilityValidatorPlugin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ private fun Project.configureKotlinCompilation(
inputDependencies = files(provider<Any> { if (isEnabled) compilation.compileDependencyFiles else emptyList<Any>() })
}
outputApiDir = apiBuildDir
this.projectName.set(project.name)
}
configureCheckTasks(apiBuildDir, apiBuild, extension)
}
Expand All @@ -119,7 +118,6 @@ private fun Project.configureApiTasks(sourceSet: SourceSet, extension: ApiValida
inputClassesDirs = files(provider<Any> { if (isEnabled) sourceSet.output.classesDirs else emptyList<Any>() })
inputDependencies = files(provider<Any> { if (isEnabled) sourceSet.output.classesDirs else emptyList<Any>() })
outputApiDir = apiBuildDir
this.projectName.set(project.name)
}

configureCheckTasks(apiBuildDir, apiBuild, extension)
Expand All @@ -143,7 +141,6 @@ private fun Project.configureCheckTasks(
null
}
this.apiBuildDir = apiBuildDir
this.projectName.set(project.name)
dependsOn(apiBuild)
}

Expand Down
6 changes: 3 additions & 3 deletions src/main/kotlin/KotlinApiBuildTask.kt
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ open class KotlinApiBuildTask @Inject constructor(
@get:Input
val ignoredClasses : Set<String> get() = extension.ignoredClasses

@get:Input
val projectName = project.objects.property(String::class.java)
@get:Internal
internal val projectName = project.name

@TaskAction
fun generate() {
Expand All @@ -53,7 +53,7 @@ open class KotlinApiBuildTask @Inject constructor(
.filterOutNonPublic(ignoredPackages, ignoredClasses)
.filterOutAnnotated(nonPublicMarkers.map { it.replace(".", "/") }.toSet())

outputApiDir.resolve("${projectName.get()}.api").bufferedWriter().use { writer ->
outputApiDir.resolve("$projectName.api").bufferedWriter().use { writer ->
signatures
.sortedBy { it.name }
.forEach { api ->
Expand Down