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.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.
## 📋 Pull Request Information
**Original PR:** https://github.com/apple/pkl/pull/821
**Author:** [@bioball](https://github.com/bioball)
**Created:** 11/17/2024
**Status:** ✅ Merged
**Merged:** 11/18/2024
**Merged by:** [@bioball](https://github.com/bioball)
**Base:** `main` ← **Head:** `transitive-modules-fix`
---
### 📝 Commits (2)
- [`da7871a`](https://github.com/apple/pkl/commit/da7871a0c90bd0de22a16a0ff80b9c8212eff72d) Exclude non file-based modules from synthesized *GatherImports task
- [`487c5b9`](https://github.com/apple/pkl/commit/487c5b9085e4ac157204e2ce13c01340f0624a57) Fix bug when generating pkldoc on Windows
### 📊 Changes
**7 files changed** (+216 additions, -134 deletions)
<details>
<summary>View changed files</summary>
📝 `pkl-doc/src/main/kotlin/org/pkl/doc/DocGenerator.kt` (+1 -1)
📝 `pkl-gradle/src/main/java/org/pkl/gradle/PklPlugin.java` (+36 -3)
📝 `pkl-gradle/src/main/java/org/pkl/gradle/task/BasePklTask.java` (+3 -102)
📝 `pkl-gradle/src/main/java/org/pkl/gradle/task/ModulesTask.java` (+4 -26)
➕ `pkl-gradle/src/main/java/org/pkl/gradle/utils/PluginUtils.java` (+128 -0)
➕ `pkl-gradle/src/main/java/org/pkl/gradle/utils/package-info.java` (+4 -0)
📝 `pkl-gradle/src/test/kotlin/org/pkl/gradle/PkldocGeneratorsTest.kt` (+40 -2)
</details>
### 📄 Description
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.
Closes https://github.com/apple/pkl/issues/791
---
<sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
📋 Pull Request Information
Original PR: https://github.com/apple/pkl/pull/821
Author: @bioball
Created: 11/17/2024
Status: ✅ Merged
Merged: 11/18/2024
Merged by: @bioball
Base:
main← Head:transitive-modules-fix📝 Commits (2)
da7871aExclude non file-based modules from synthesized *GatherImports task487c5b9Fix bug when generating pkldoc on Windows📊 Changes
7 files changed (+216 additions, -134 deletions)
View changed files
📝
pkl-doc/src/main/kotlin/org/pkl/doc/DocGenerator.kt(+1 -1)📝
pkl-gradle/src/main/java/org/pkl/gradle/PklPlugin.java(+36 -3)📝
pkl-gradle/src/main/java/org/pkl/gradle/task/BasePklTask.java(+3 -102)📝
pkl-gradle/src/main/java/org/pkl/gradle/task/ModulesTask.java(+4 -26)➕
pkl-gradle/src/main/java/org/pkl/gradle/utils/PluginUtils.java(+128 -0)➕
pkl-gradle/src/main/java/org/pkl/gradle/utils/package-info.java(+4 -0)📝
pkl-gradle/src/test/kotlin/org/pkl/gradle/PkldocGeneratorsTest.kt(+40 -2)📄 Description
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.
Closes https://github.com/apple/pkl/issues/791
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.