Exclude non file-based modules from synthesized *GatherImports task (#821)

This fixes an issue where certain modules tasks fail due to the plugin
attempting to analyze their imports, but the arguments may not actually be
Pkl modules.

For example, the pkldoc task accepts entire packages in its "sourceMoules" property.

This changes the gather imports logic to only analyze file-based modules.
This is also a performance improvement; non file-based modules are unlikely to import
files due to insufficient trust levels.

Also: fix a bug when generating pkldoc on Windows
This commit is contained in:
Daniel Chao
2024-11-18 11:14:17 -08:00
committed by Islon Scherer
parent d6ba021e12
commit c2096f633b
7 changed files with 216 additions and 134 deletions

View File

@@ -117,7 +117,7 @@ class DocGenerator(
}
private fun DocPackage.deletePackageDir() {
outputDir.resolve("$name/$version").deleteRecursively()
outputDir.resolve(IoUtils.encodePath("$name/$version")).deleteRecursively()
}
private fun createSymlinks(currentPackagesData: List<PackageData>) {