Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor improvements #101

Merged
merged 2 commits into from Oct 20, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/main/kotlin/BinaryCompatibilityValidatorPlugin.kt
Expand Up @@ -203,8 +203,8 @@ private fun Project.configureKotlinCompilation(
configureCheckTasks(apiBuildDir, apiBuild, extension, targetConfig, commonApiDump, commonApiCheck)
}

val Project.sourceSets: SourceSetContainer
get() = convention.getPlugin(JavaPluginConvention::class.java).sourceSets
internal val Project.sourceSets: SourceSetContainer
get() = extensions.getByName("sourceSets") as SourceSetContainer

internal val Project.apiValidationExtensionOrNull: ApiValidationExtension?
get() =
Expand Down
6 changes: 3 additions & 3 deletions src/main/kotlin/KotlinApiCompareTask.kt
Expand Up @@ -91,7 +91,7 @@ open class KotlinApiCompareTask @Inject constructor(private val objects: ObjectF

var expectedApiDeclaration = apiBuildDirFiles.keys.single()
if (expectedApiDeclaration !in expectedApiFiles) {
error("File ${expectedApiDeclaration.lastName} is missing from ${projectApiDir.relativePath()}, please run " +
error("File ${expectedApiDeclaration.lastName} is missing from ${projectApiDir.relativeDirPath()}, please run " +
":$subject:apiDump task to generate one")
}
// Normalize case-sensitivity
Expand All @@ -108,8 +108,8 @@ open class KotlinApiCompareTask @Inject constructor(private val objects: ObjectF
}
}

private fun File.relativePath(): String {
return relativeTo(rootDir).toString() + "/"
private fun File.relativeDirPath(): String {
return toRelativeString(rootDir) + File.separator
}

private fun compareFiles(checkFile: File, builtFile: File): String? {
Expand Down