Skip to content

Commit

Permalink
Fix more lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
raghulvelusamy committed Dec 18, 2023
1 parent 38971d4 commit 1ae9b7c
Showing 1 changed file with 15 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -509,22 +509,24 @@ private fun JvmCompilationTask.updateBuilder(
/**
* Copy generated manifest files from KSP task into generated folder
*/
internal fun Iterator<String>.copyManifestFilesToGeneratedClasses(directories: Directories): Iterator<String> {
internal fun Iterator<String>.copyManifestFilesToGeneratedClasses(
directories: Directories,
): Iterator<String> {
val result = mutableSetOf<String>()
this.forEach {
if ("/$MANIFEST_DIR" in it) {
val path = Paths.get(it)
val srcJarsPath = Paths.get(directories.temp, SOURCE_JARS_DIR)
if (srcJarsPath.exists()) {
val relativePath = srcJarsPath.relativize(path)
val destPath = Paths.get(directories.generatedClasses).resolve(relativePath)
destPath.parent.toFile().mkdirs()
Files.copy(path, destPath, StandardCopyOption.REPLACE_EXISTING)
}
this.forEach {
if ("/$MANIFEST_DIR" in it) {
val path = Paths.get(it)
val srcJarsPath = Paths.get(directories.temp, SOURCE_JARS_DIR)
if (srcJarsPath.exists()) {
val relativePath = srcJarsPath.relativize(path)
val destPath = Paths.get(directories.generatedClasses).resolve(relativePath)
destPath.parent.toFile().mkdirs()
Files.copy(path, destPath, StandardCopyOption.REPLACE_EXISTING)
}
result.add(it)
}
return result.iterator()
result.add(it)
}
return result.iterator()
}

/**
Expand Down

0 comments on commit 1ae9b7c

Please sign in to comment.